summaryrefslogtreecommitdiff
path: root/libjava/javax
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 /libjava/javax
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
Diffstat (limited to 'libjava/javax')
-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
884 files changed, 0 insertions, 191060 deletions
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);
-
-}