History

My first initial commit with all of mine experimental changes.

Dmitry Kabak (userdima committed 13 years ago

Commit d37b88d1 parent 3f5b46618352 files · +2598093 −-8690Browse files

Showing the changes to java/pkg (1423 of 18352 files). Show all

Unified · Split

1423 files
  1. java/pkg/NOTICE +1 −0
  2. java/pkg/awt/awt_Color.b +338 −0
  3. java/pkg/awt/awt_Color.m +13 −0
  4. java/pkg/awt/awt_Frame.b +250 −0
  5. java/pkg/awt/awt_Frame.m +46 −0
  6. java/pkg/awt/awt_Graphics.b +209 −0
  7. java/pkg/awt/awt_Graphics.m +43 −0
  8. java/pkg/awt/awt_Image.m +36 −0
  9. java/pkg/awt/iDrawingSurfaceInfo.java +117 −0
  10. java/pkg/awt/iDrawingSurfaceInfo_L.b +56 −0
  11. java/pkg/awt/iDrawingSurfaceInfo_L.m +21 −0
  12. java/pkg/awt/iFontMetrics.java +266 −0
  13. java/pkg/awt/iFontMetrics_L.b +123 −0
  14. java/pkg/awt/iFontMetrics_L.m +27 −0
  15. java/pkg/awt/iFontPeer.java +276 −0
  16. java/pkg/awt/iFontPeer_L.b +115 −0
  17. java/pkg/awt/iFontPeer_L.m +20 −0
  18. java/pkg/awt/iFramePeer.java +527 −0
  19. java/pkg/awt/iFramePeer_L.b +588 −0
  20. java/pkg/awt/iFramePeer_L.m +36 −0
  21. java/pkg/awt/iGraphics.java +606 −0
  22. java/pkg/awt/iGraphics_L.b +245 −0
  23. java/pkg/awt/iGraphics_L.m +50 −0
  24. java/pkg/awt/iImage.java +51 −0
  25. java/pkg/awt/iImageConsumer.java +0 −0
  26. java/pkg/awt/iImageRepresentation.java +91 −0
  27. java/pkg/awt/iImageRepresentation_L.b +152 −0
  28. java/pkg/awt/iImageRepresentation_L.m +36 −0
  29. java/pkg/awt/iImage_L.b +180 −0
  30. java/pkg/awt/iImage_L.m +26 −0
  31. java/pkg/awt/iMenuBarPeer.java +906 −0
  32. java/pkg/awt/iOffScreenImage.java +33 −0
  33. java/pkg/awt/iPopupMenuPeer.java +652 −0
  34. java/pkg/awt/iToolkit.java +303 −0
  35. java/pkg/awt/iToolkit_L.b +85 −0
  36. java/pkg/awt/iToolkit_L.m +19 −0
  37. java/pkg/awt/iWindowPeer.java +411 −0
  38. java/pkg/awt/iWindowPeer_L.b +377 −0
  39. java/pkg/awt/iWindowPeer_L.m +36 −0
  40. java/pkg/awt/mkfile +126 −0
  41. java/pkg/com/mkfile +7 −0
  42. java/pkg/com/oracle/mkfile +6 −0
  43. java/pkg/com/oracle/net/Sdp.java +201 −0
  44. java/pkg/com/oracle/net/mkfile +8 −0
  45. java/pkg/com/sun/accessibility/internal/mkfile +6 −0
  46. java/pkg/com/sun/accessibility/internal/resources/accessibility.properties +146 −0
  47. java/pkg/com/sun/accessibility/internal/resources/accessibility_de.properties +146 −0
  48. java/pkg/com/sun/accessibility/internal/resources/accessibility_en.properties +142 −0
  49. java/pkg/com/sun/accessibility/internal/resources/accessibility_es.properties +146 −0
  50. java/pkg/com/sun/accessibility/internal/resources/accessibility_fr.properties +146 −0
  51. java/pkg/com/sun/accessibility/internal/resources/accessibility_it.properties +146 −0
  52. java/pkg/com/sun/accessibility/internal/resources/accessibility_ja.properties +146 −0
  53. java/pkg/com/sun/accessibility/internal/resources/accessibility_ko.properties +146 −0
  54. java/pkg/com/sun/accessibility/internal/resources/accessibility_pt_BR.properties +146 −0
  55. java/pkg/com/sun/accessibility/internal/resources/accessibility_sv.properties +146 −0
  56. java/pkg/com/sun/accessibility/internal/resources/accessibility_zh_CN.properties +146 −0
  57. java/pkg/com/sun/accessibility/internal/resources/accessibility_zh_TW.properties +146 −0
  58. java/pkg/com/sun/accessibility/internal/resources/mkfile +2 −0
  59. java/pkg/com/sun/accessibility/mkfile +6 −0
  60. java/pkg/com/sun/awt/AWTUtilities$1.class +0 −0
  61. java/pkg/com/sun/awt/AWTUtilities$Translucency.class +0 −0
  62. java/pkg/com/sun/awt/AWTUtilities.class +0 −0
  63. java/pkg/com/sun/awt/AWTUtilities.java +462 −0
  64. java/pkg/com/sun/awt/SecurityWarning.java +169 −0
  65. java/pkg/com/sun/awt/mkfile +9 −0
  66. java/pkg/com/sun/beans/TypeResolver.class +0 −0
  67. java/pkg/com/sun/beans/TypeResolver.java +410 −0
  68. java/pkg/com/sun/beans/WeakCache.class +0 −0
  69. java/pkg/com/sun/beans/WeakCache.java +91 −0
  70. java/pkg/com/sun/beans/WildcardTypeImpl.class +0 −0
  71. java/pkg/com/sun/beans/WildcardTypeImpl.java +161 −0
  72. java/pkg/com/sun/beans/decoder/AccessorElementHandler.class +0 −0
  73. java/pkg/com/sun/beans/decoder/AccessorElementHandler.java +105 −0
  74. java/pkg/com/sun/beans/decoder/ArrayElementHandler.class +0 −0
  75. java/pkg/com/sun/beans/decoder/ArrayElementHandler.java +133 −0
  76. java/pkg/com/sun/beans/decoder/BooleanElementHandler.class +0 −0
  77. java/pkg/com/sun/beans/decoder/BooleanElementHandler.java +69 −0
  78. java/pkg/com/sun/beans/decoder/ByteElementHandler.class +0 −0
  79. java/pkg/com/sun/beans/decoder/ByteElementHandler.java +63 −0
  80. java/pkg/com/sun/beans/decoder/CharElementHandler.class +0 −0
  81. java/pkg/com/sun/beans/decoder/CharElementHandler.java +92 −0
  82. java/pkg/com/sun/beans/decoder/ClassElementHandler.class +0 −0
  83. java/pkg/com/sun/beans/decoder/ClassElementHandler.java +62 −0
  84. java/pkg/com/sun/beans/decoder/DocumentHandler.class +0 −0
  85. java/pkg/com/sun/beans/decoder/DocumentHandler.java +389 −0
  86. java/pkg/com/sun/beans/decoder/DoubleElementHandler.class +0 −0
  87. java/pkg/com/sun/beans/decoder/DoubleElementHandler.java +63 −0
  88. java/pkg/com/sun/beans/decoder/ElementHandler.class +0 −0
  89. java/pkg/com/sun/beans/decoder/ElementHandler.java +224 −0
  90. java/pkg/com/sun/beans/decoder/FalseElementHandler.class +0 −0
  91. java/pkg/com/sun/beans/decoder/FalseElementHandler.java +56 −0
  92. java/pkg/com/sun/beans/decoder/FieldElementHandler.class +0 −0
  93. java/pkg/com/sun/beans/decoder/FieldElementHandler.java +189 −0
  94. java/pkg/com/sun/beans/decoder/FloatElementHandler.class +0 −0
  95. java/pkg/com/sun/beans/decoder/FloatElementHandler.java +63 −0
  96. java/pkg/com/sun/beans/decoder/IntElementHandler.class +0 −0
  97. java/pkg/com/sun/beans/decoder/IntElementHandler.java +63 −0
  98. java/pkg/com/sun/beans/decoder/JavaElementHandler.class +0 −0
  99. java/pkg/com/sun/beans/decoder/JavaElementHandler.java +151 −0
  100. java/pkg/com/sun/beans/decoder/LongElementHandler.class +0 −0
  101. java/pkg/com/sun/beans/decoder/LongElementHandler.java +63 −0
  102. java/pkg/com/sun/beans/decoder/MethodElementHandler.class +0 −0
  103. java/pkg/com/sun/beans/decoder/MethodElementHandler.java +109 −0
  104. java/pkg/com/sun/beans/decoder/NewElementHandler.class +0 −0
  105. java/pkg/com/sun/beans/decoder/NewElementHandler.java +205 −0
  106. java/pkg/com/sun/beans/decoder/NullElementHandler.class +0 −0
  107. java/pkg/com/sun/beans/decoder/NullElementHandler.java +76 −0
  108. java/pkg/com/sun/beans/decoder/ObjectElementHandler.class +0 −0
  109. java/pkg/com/sun/beans/decoder/ObjectElementHandler.java +168 −0
  110. java/pkg/com/sun/beans/decoder/PropertyElementHandler.class +0 −0
  111. java/pkg/com/sun/beans/decoder/PropertyElementHandler.java +287 −0
  112. java/pkg/com/sun/beans/decoder/ShortElementHandler.class +0 −0
  113. java/pkg/com/sun/beans/decoder/ShortElementHandler.java +63 −0
  114. java/pkg/com/sun/beans/decoder/StringElementHandler.class +0 −0
  115. java/pkg/com/sun/beans/decoder/StringElementHandler.java +116 −0
  116. java/pkg/com/sun/beans/decoder/TrueElementHandler.class +0 −0
  117. java/pkg/com/sun/beans/decoder/TrueElementHandler.java +56 −0
  118. java/pkg/com/sun/beans/decoder/ValueObject.class +0 −0
  119. java/pkg/com/sun/beans/decoder/ValueObject.java +50 −0
  120. java/pkg/com/sun/beans/decoder/ValueObjectImpl.class +0 −0
  121. java/pkg/com/sun/beans/decoder/ValueObjectImpl.java +88 −0
  122. java/pkg/com/sun/beans/decoder/VarElementHandler.class +0 −0
  123. java/pkg/com/sun/beans/decoder/VarElementHandler.java +82 −0
  124. java/pkg/com/sun/beans/decoder/VoidElementHandler.class +0 −0
  125. java/pkg/com/sun/beans/decoder/VoidElementHandler.java +68 −0
  126. java/pkg/com/sun/beans/decoder/mkfile +34 −0
  127. java/pkg/com/sun/beans/finder/AbstractFinder.class +0 −0
  128. java/pkg/com/sun/beans/finder/AbstractFinder.java +213 −0
  129. java/pkg/com/sun/beans/finder/BeanInfoFinder.class +0 −0
  130. java/pkg/com/sun/beans/finder/BeanInfoFinder.java +98 −0
  131. java/pkg/com/sun/beans/finder/ClassFinder.class +0 −0
  132. java/pkg/com/sun/beans/finder/ClassFinder.java +176 −0
  133. java/pkg/com/sun/beans/finder/ConstructorFinder.class +0 −0
  134. java/pkg/com/sun/beans/finder/ConstructorFinder.java +127 −0
  135. java/pkg/com/sun/beans/finder/FieldFinder.class +0 −0
  136. java/pkg/com/sun/beans/finder/FieldFinder.java +106 −0
  137. java/pkg/com/sun/beans/finder/InstanceFinder.class +0 −0
  138. java/pkg/com/sun/beans/finder/InstanceFinder.java +109 −0
  139. java/pkg/com/sun/beans/finder/MethodFinder.class +0 −0
  140. java/pkg/com/sun/beans/finder/MethodFinder.java +231 −0
  141. java/pkg/com/sun/beans/finder/PersistenceDelegateFinder.class +0 −0
  142. java/pkg/com/sun/beans/finder/PersistenceDelegateFinder.java +68 −0
  143. java/pkg/com/sun/beans/finder/PrimitiveTypeMap.class +0 −0
  144. java/pkg/com/sun/beans/finder/PrimitiveTypeMap.java +70 −0
  145. java/pkg/com/sun/beans/finder/PrimitiveWrapperMap.class +0 −0
  146. java/pkg/com/sun/beans/finder/PrimitiveWrapperMap.java +86 −0
  147. java/pkg/com/sun/beans/finder/PropertyEditorFinder.class +0 −0
  148. java/pkg/com/sun/beans/finder/PropertyEditorFinder.java +87 −0
  149. java/pkg/com/sun/beans/finder/Signature.class +0 −0
  150. java/pkg/com/sun/beans/finder/Signature.java +169 −0
  151. java/pkg/com/sun/beans/finder/mkfile +19 −0
  152. java/pkg/com/sun/beans/mkfile +15 −0
  153. java/pkg/com/sun/crypto/mkfile +6 −0
  154. java/pkg/com/sun/crypto/provider/AESCipher.java +427 −0
  155. java/pkg/com/sun/crypto/provider/AESConstants.java +46 −0
  156. java/pkg/com/sun/crypto/provider/AESCrypt.java +659 −0
  157. java/pkg/com/sun/crypto/provider/AESKeyGenerator.java +117 −0
  158. java/pkg/com/sun/crypto/provider/AESParameters.java +87 −0
  159. java/pkg/com/sun/crypto/provider/AESWrapCipher.java +483 −0
  160. java/pkg/com/sun/crypto/provider/ARCFOURCipher.java +263 −0
  161. java/pkg/com/sun/crypto/provider/BlockCipherParamsCore.java +127 −0
  162. java/pkg/com/sun/crypto/provider/BlowfishCipher.java +428 −0
  163. java/pkg/com/sun/crypto/provider/BlowfishConstants.java +41 −0
  164. java/pkg/com/sun/crypto/provider/BlowfishCrypt.java +558 −0
  165. java/pkg/com/sun/crypto/provider/BlowfishKeyGenerator.java +115 −0
  166. java/pkg/com/sun/crypto/provider/BlowfishParameters.java +88 −0
  167. java/pkg/com/sun/crypto/provider/CipherBlockChaining.java +212 −0
  168. java/pkg/com/sun/crypto/provider/CipherCore.java +943 −0
  169. java/pkg/com/sun/crypto/provider/CipherFeedback.java +272 −0
  170. java/pkg/com/sun/crypto/provider/CipherTextStealing.java +215 −0
  171. java/pkg/com/sun/crypto/provider/CipherWithWrappingSpi.java +261 −0
  172. java/pkg/com/sun/crypto/provider/ConstructKeys.java +191 −0
  173. java/pkg/com/sun/crypto/provider/CounterMode.java +210 −0
  174. java/pkg/com/sun/crypto/provider/DESCipher.java +428 −0
  175. java/pkg/com/sun/crypto/provider/DESConstants.java +39 −0
  176. java/pkg/com/sun/crypto/provider/DESCrypt.java +1145 −0
  177. java/pkg/com/sun/crypto/provider/DESKey.java +161 −0
  178. java/pkg/com/sun/crypto/provider/DESKeyFactory.java +164 −0
  179. java/pkg/com/sun/crypto/provider/DESKeyGenerator.java +147 −0
  180. java/pkg/com/sun/crypto/provider/DESParameters.java +88 −0
  181. java/pkg/com/sun/crypto/provider/DESedeCipher.java +426 −0
  182. java/pkg/com/sun/crypto/provider/DESedeCrypt.java +168 −0
  183. java/pkg/com/sun/crypto/provider/DESedeKey.java +162 −0
  184. java/pkg/com/sun/crypto/provider/DESedeKeyFactory.java +161 −0
  185. java/pkg/com/sun/crypto/provider/DESedeKeyGenerator.java +145 −0
  186. java/pkg/com/sun/crypto/provider/DESedeParameters.java +87 −0
  187. java/pkg/com/sun/crypto/provider/DESedeWrapCipher.java +567 −0
  188. java/pkg/com/sun/crypto/provider/DHKeyAgreement.java +412 −0
  189. java/pkg/com/sun/crypto/provider/DHKeyFactory.java +236 −0
  190. java/pkg/com/sun/crypto/provider/DHKeyPairGenerator.java +186 −0
  191. java/pkg/com/sun/crypto/provider/DHParameterGenerator.java +171 −0
  192. java/pkg/com/sun/crypto/provider/DHParameters.java +144 −0
  193. java/pkg/com/sun/crypto/provider/DHPrivateKey.java +352 −0
  194. java/pkg/com/sun/crypto/provider/DHPublicKey.java +331 −0
  195. java/pkg/com/sun/crypto/provider/ElectronicCodeBook.java +160 −0
  196. java/pkg/com/sun/crypto/provider/EncryptedPrivateKeyInfo.java +130 −0
  197. java/pkg/com/sun/crypto/provider/FeedbackCipher.java +199 −0
  198. java/pkg/com/sun/crypto/provider/HmacCore.java +348 −0
  199. java/pkg/com/sun/crypto/provider/HmacMD5.java +133 −0
  200. java/pkg/com/sun/crypto/provider/HmacMD5KeyGenerator.java +109 −0
  201. java/pkg/com/sun/crypto/provider/HmacPKCS12PBESHA1.java +203 −0
  202. java/pkg/com/sun/crypto/provider/HmacSHA1.java +133 −0
  203. java/pkg/com/sun/crypto/provider/HmacSHA1KeyGenerator.java +109 −0
  204. java/pkg/com/sun/crypto/provider/ISO10126Padding.java +123 −0
  205. java/pkg/com/sun/crypto/provider/JceKeyStore.java +903 −0
  206. java/pkg/com/sun/crypto/provider/KeyGeneratorCore.java +221 −0
  207. java/pkg/com/sun/crypto/provider/KeyProtector.java +410 −0
  208. java/pkg/com/sun/crypto/provider/OAEPParameters.java +259 −0
  209. java/pkg/com/sun/crypto/provider/OutputFeedback.java +229 −0
  210. java/pkg/com/sun/crypto/provider/PBECipherCore.java +541 −0
  211. java/pkg/com/sun/crypto/provider/PBEKey.java +154 −0
  212. java/pkg/com/sun/crypto/provider/PBEKeyFactory.java +203 −0
  213. java/pkg/com/sun/crypto/provider/PBEParameters.java +143 −0
  214. java/pkg/com/sun/crypto/provider/PBEWithMD5AndDESCipher.java +429 −0
  215. java/pkg/com/sun/crypto/provider/PBEWithMD5AndTripleDESCipher.java +435 −0
  216. java/pkg/com/sun/crypto/provider/PBKDF2HmacSHA1Factory.java +154 −0
  217. java/pkg/com/sun/crypto/provider/PBKDF2KeyImpl.java +282 −0
  218. java/pkg/com/sun/crypto/provider/PCBC.java +198 −0
  219. java/pkg/com/sun/crypto/provider/PKCS12PBECipherCore.java +521 −0
  220. java/pkg/com/sun/crypto/provider/PKCS5Padding.java +128 −0
  221. java/pkg/com/sun/crypto/provider/Padding.java +84 −0
  222. java/pkg/com/sun/crypto/provider/PrivateKeyInfo.java +90 −0
  223. java/pkg/com/sun/crypto/provider/RC2Cipher.java +151 −0
  224. java/pkg/com/sun/crypto/provider/RC2Crypt.java +320 −0
  225. java/pkg/com/sun/crypto/provider/RC2Parameters.java +229 −0
  226. java/pkg/com/sun/crypto/provider/RSACipher.java +444 −0
  227. java/pkg/com/sun/crypto/provider/SslMacCore.java +264 −0
  228. java/pkg/com/sun/crypto/provider/SunJCE.java +456 −0
  229. java/pkg/com/sun/crypto/provider/SymmetricCipher.java +102 −0
  230. java/pkg/com/sun/crypto/provider/TlsKeyMaterialGenerator.java +277 −0
  231. java/pkg/com/sun/crypto/provider/TlsMasterSecretGenerator.java +175 −0
  232. java/pkg/com/sun/crypto/provider/TlsPrfGenerator.java +368 −0
  233. java/pkg/com/sun/crypto/provider/TlsRsaPremasterSecretGenerator.java +85 −0
  234. java/pkg/com/sun/crypto/provider/ai.java +64 −0
  235. java/pkg/com/sun/crypto/provider/mkfile +88 −0
  236. java/pkg/com/sun/demo/jvmti/hprof/Tracker.java +102 −0
  237. java/pkg/com/sun/demo/jvmti/hprof/mkfile +8 −0
  238. java/pkg/com/sun/demo/jvmti/mkfile +6 −0
  239. java/pkg/com/sun/demo/mkfile +6 −0
  240. java/pkg/com/sun/imageio/mkfile +8 −0
  241. java/pkg/com/sun/imageio/plugins/bmp/BMPConstants.class +0 −0
  242. java/pkg/com/sun/imageio/plugins/bmp/BMPConstants.java +53 −0
  243. java/pkg/com/sun/imageio/plugins/bmp/BMPImageReader$1.class +0 −0
  244. java/pkg/com/sun/imageio/plugins/bmp/BMPImageReader$2.class +0 −0
  245. java/pkg/com/sun/imageio/plugins/bmp/BMPImageReader$3.class +0 −0
  246. java/pkg/com/sun/imageio/plugins/bmp/BMPImageReader$4.class +0 −0
  247. java/pkg/com/sun/imageio/plugins/bmp/BMPImageReader$5.class +0 −0
  248. java/pkg/com/sun/imageio/plugins/bmp/BMPImageReader$EmbeddedProgressAdapter.class +0 −0
  249. java/pkg/com/sun/imageio/plugins/bmp/BMPImageReader.class +0 −0
  250. java/pkg/com/sun/imageio/plugins/bmp/BMPImageReader.java +1821 −0
  251. java/pkg/com/sun/imageio/plugins/bmp/BMPImageReaderSpi.class +0 −0
  252. java/pkg/com/sun/imageio/plugins/bmp/BMPImageReaderSpi.java +94 −0
  253. java/pkg/com/sun/imageio/plugins/bmp/BMPImageWriter$1.class +0 −0
  254. java/pkg/com/sun/imageio/plugins/bmp/BMPImageWriter$2.class +0 −0
  255. java/pkg/com/sun/imageio/plugins/bmp/BMPImageWriter$IIOWriteProgressAdapter.class +0 −0
  256. java/pkg/com/sun/imageio/plugins/bmp/BMPImageWriter.class +0 −0
  257. java/pkg/com/sun/imageio/plugins/bmp/BMPImageWriter.java +1532 −0
  258. java/pkg/com/sun/imageio/plugins/bmp/BMPImageWriterSpi.class +0 −0
  259. java/pkg/com/sun/imageio/plugins/bmp/BMPImageWriterSpi.java +106 −0
  260. java/pkg/com/sun/imageio/plugins/bmp/BMPMetadata.class +0 −0
  261. java/pkg/com/sun/imageio/plugins/bmp/BMPMetadata.java +307 −0
  262. java/pkg/com/sun/imageio/plugins/bmp/BMPMetadataFormat.java +208 −0
  263. java/pkg/com/sun/imageio/plugins/bmp/BMPMetadataFormatResources.java +69 −0
  264. java/pkg/com/sun/imageio/plugins/bmp/mkfile +15 −0
  265. java/pkg/com/sun/imageio/plugins/common/BitFile.class +0 −0
  266. java/pkg/com/sun/imageio/plugins/common/BitFile.java +123 −0
  267. java/pkg/com/sun/imageio/plugins/common/BogusColorSpace.class +0 −0
  268. java/pkg/com/sun/imageio/plugins/common/BogusColorSpace.java +136 −0
  269. java/pkg/com/sun/imageio/plugins/common/I18N.class +0 −0
  270. java/pkg/com/sun/imageio/plugins/common/I18N.java +33 −0
  271. java/pkg/com/sun/imageio/plugins/common/I18NImpl.class +0 −0
  272. java/pkg/com/sun/imageio/plugins/common/I18NImpl.java +62 −0
  273. java/pkg/com/sun/imageio/plugins/common/ImageUtil.class +0 −0
  274. java/pkg/com/sun/imageio/plugins/common/ImageUtil.java +1167 −0
  275. java/pkg/com/sun/imageio/plugins/common/InputStreamAdapter.class +0 −0
  276. java/pkg/com/sun/imageio/plugins/common/InputStreamAdapter.java +49 −0
  277. java/pkg/com/sun/imageio/plugins/common/LZWCompressor.class +0 −0
  278. java/pkg/com/sun/imageio/plugins/common/LZWCompressor.java +146 −0
  279. java/pkg/com/sun/imageio/plugins/common/LZWStringTable.class +0 −0
  280. java/pkg/com/sun/imageio/plugins/common/LZWStringTable.java +218 −0
  281. java/pkg/com/sun/imageio/plugins/common/PaletteBuilder$ColorNode.class +0 −0
  282. java/pkg/com/sun/imageio/plugins/common/PaletteBuilder.class +0 −0
  283. java/pkg/com/sun/imageio/plugins/common/PaletteBuilder.java +486 −0
  284. java/pkg/com/sun/imageio/plugins/common/ReaderUtil.class +0 −0
  285. java/pkg/com/sun/imageio/plugins/common/ReaderUtil.java +216 −0
  286. java/pkg/com/sun/imageio/plugins/common/StandardMetadataFormat.class +0 −0
  287. java/pkg/com/sun/imageio/plugins/common/StandardMetadataFormat.java +499 −0
  288. java/pkg/com/sun/imageio/plugins/common/StandardMetadataFormatResources.java +210 −0
  289. java/pkg/com/sun/imageio/plugins/common/SubImageInputStream.class +0 −0
  290. java/pkg/com/sun/imageio/plugins/common/SubImageInputStream.java +79 −0
  291. java/pkg/com/sun/imageio/plugins/common/iio-plugin.properties +47 −0
  292. java/pkg/com/sun/imageio/plugins/common/mkfile +20 −0
  293. java/pkg/com/sun/imageio/plugins/gif/GIFImageMetadata.class +0 −0
  294. java/pkg/com/sun/imageio/plugins/gif/GIFImageMetadata.java +446 −0
  295. java/pkg/com/sun/imageio/plugins/gif/GIFImageMetadataFormat.java +171 −0
  296. java/pkg/com/sun/imageio/plugins/gif/GIFImageMetadataFormatResources.java +104 −0
  297. java/pkg/com/sun/imageio/plugins/gif/GIFImageReader.class +0 −0
  298. java/pkg/com/sun/imageio/plugins/gif/GIFImageReader.java +1028 −0
  299. java/pkg/com/sun/imageio/plugins/gif/GIFImageReaderSpi.class +0 −0
  300. java/pkg/com/sun/imageio/plugins/gif/GIFImageReaderSpi.java +99 −0
  301. java/pkg/com/sun/imageio/plugins/gif/GIFImageWriteParam.class +0 −0
  302. java/pkg/com/sun/imageio/plugins/gif/GIFImageWriter.class +0 −0
  303. java/pkg/com/sun/imageio/plugins/gif/GIFImageWriter.java +1317 −0
  304. java/pkg/com/sun/imageio/plugins/gif/GIFImageWriterSpi.class +0 −0
  305. java/pkg/com/sun/imageio/plugins/gif/GIFImageWriterSpi.java +104 −0
  306. java/pkg/com/sun/imageio/plugins/gif/GIFMetadata.class +0 −0
  307. java/pkg/com/sun/imageio/plugins/gif/GIFMetadata.java +317 −0
  308. java/pkg/com/sun/imageio/plugins/gif/GIFStreamMetadata.class +0 −0
  309. java/pkg/com/sun/imageio/plugins/gif/GIFStreamMetadata.java +320 −0
  310. java/pkg/com/sun/imageio/plugins/gif/GIFStreamMetadataFormat.java +106 −0
  311. java/pkg/com/sun/imageio/plugins/gif/GIFStreamMetadataFormatResources.java +71 −0
  312. java/pkg/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.class +0 −0
  313. java/pkg/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.java +402 −0
  314. java/pkg/com/sun/imageio/plugins/gif/GIFWritableStreamMetadata.class +0 −0
  315. java/pkg/com/sun/imageio/plugins/gif/GIFWritableStreamMetadata.java +267 −0
  316. java/pkg/com/sun/imageio/plugins/gif/mkfile +20 −0
  317. java/pkg/com/sun/imageio/plugins/jpeg/AdobeMarkerSegment.class +0 −0
  318. java/pkg/com/sun/imageio/plugins/jpeg/AdobeMarkerSegment.java +136 −0
  319. java/pkg/com/sun/imageio/plugins/jpeg/COMMarkerSegment.class +0 −0
  320. java/pkg/com/sun/imageio/plugins/jpeg/COMMarkerSegment.java +133 −0
  321. java/pkg/com/sun/imageio/plugins/jpeg/DHTMarkerSegment$Htable.class +0 −0
  322. java/pkg/com/sun/imageio/plugins/jpeg/DHTMarkerSegment.class +0 −0
  323. java/pkg/com/sun/imageio/plugins/jpeg/DHTMarkerSegment.java +260 −0
  324. java/pkg/com/sun/imageio/plugins/jpeg/DQTMarkerSegment$Qtable.class +0 −0
  325. java/pkg/com/sun/imageio/plugins/jpeg/DQTMarkerSegment.class +0 −0
  326. java/pkg/com/sun/imageio/plugins/jpeg/DQTMarkerSegment.java +309 −0
  327. java/pkg/com/sun/imageio/plugins/jpeg/DRIMarkerSegment.class +0 −0
  328. java/pkg/com/sun/imageio/plugins/jpeg/DRIMarkerSegment.java +83 −0
  329. java/pkg/com/sun/imageio/plugins/jpeg/ImageTypeIterator.class +0 −0
  330. java/pkg/com/sun/imageio/plugins/jpeg/ImageTypeProducer.class +0 −0
  331. java/pkg/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment$1.class +0 −0
  332. java/pkg/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment$ICCMarkerSegment.class +0 −0
  333. java/pkg/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment$IllegalThumbException.class +0 −0
  334. java/pkg/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment$JFIFExtensionMarkerSegment.class +0 −0
  335. java/pkg/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment$JFIFThumb.class +0 −0
  336. java/pkg/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment$JFIFThumbJPEG$ThumbnailReadListener.class +0 −0
  337. java/pkg/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment$JFIFThumbJPEG.class +0 −0
  338. java/pkg/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment$JFIFThumbPalette.class +0 −0
  339. java/pkg/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment$JFIFThumbRGB.class +0 −0
  340. java/pkg/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment$JFIFThumbUncompressed.class +0 −0
  341. java/pkg/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.class +0 −0
  342. java/pkg/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java +1564 −0
  343. java/pkg/com/sun/imageio/plugins/jpeg/JPEG$JCS.class +0 −0
  344. java/pkg/com/sun/imageio/plugins/jpeg/JPEG.class +0 −0
  345. java/pkg/com/sun/imageio/plugins/jpeg/JPEG.java +371 −0
  346. java/pkg/com/sun/imageio/plugins/jpeg/JPEGBuffer.class +0 −0
  347. java/pkg/com/sun/imageio/plugins/jpeg/JPEGBuffer.java +254 −0
  348. java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageMetadataFormat.java +366 −0
  349. java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageMetadataFormatResources.java +143 −0
  350. java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageReader$1.class +0 −0
  351. java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageReader$JPEGReaderDisposerRecord.class +0 −0
  352. java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageReader.class +0 −0
  353. java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageReader.java +1675 −0
  354. java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageReaderResources.java +46 −0
  355. java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageReaderSpi.class +0 −0
  356. java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageReaderSpi.java +88 −0
  357. java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageWriter$JPEGWriterDisposerRecord.class +0 −0
  358. java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageWriter.class +0 −0
  359. java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java +1809 −0
  360. java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageWriterResources.java +82 −0
  361. java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageWriterSpi.class +0 −0
  362. java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageWriterSpi.java +98 −0
  363. java/pkg/com/sun/imageio/plugins/jpeg/JPEGMetadata.class +0 −0
  364. java/pkg/com/sun/imageio/plugins/jpeg/JPEGMetadata.java +2416 −0
  365. java/pkg/com/sun/imageio/plugins/jpeg/JPEGMetadataFormat.java +157 −0
  366. java/pkg/com/sun/imageio/plugins/jpeg/JPEGMetadataFormatResources.java +61 −0
  367. java/pkg/com/sun/imageio/plugins/jpeg/JPEGStreamMetadataFormat.java +47 −0
  368. java/pkg/com/sun/imageio/plugins/jpeg/JPEGStreamMetadataFormatResources.java +46 −0
  369. java/pkg/com/sun/imageio/plugins/jpeg/MarkerSegment.class +0 −0
  370. java/pkg/com/sun/imageio/plugins/jpeg/MarkerSegment.java +224 −0
  371. java/pkg/com/sun/imageio/plugins/jpeg/SOFMarkerSegment$ComponentSpec.class +0 −0
  372. java/pkg/com/sun/imageio/plugins/jpeg/SOFMarkerSegment.class +0 −0
  373. java/pkg/com/sun/imageio/plugins/jpeg/SOFMarkerSegment.java +284 −0
  374. java/pkg/com/sun/imageio/plugins/jpeg/SOSMarkerSegment$ScanComponentSpec.class +0 −0
  375. java/pkg/com/sun/imageio/plugins/jpeg/SOSMarkerSegment.class +0 −0
  376. java/pkg/com/sun/imageio/plugins/jpeg/SOSMarkerSegment.java +241 −0
  377. java/pkg/com/sun/imageio/plugins/jpeg/mkfile +31 −0
  378. java/pkg/com/sun/imageio/plugins/mkfile +11 −0
  379. java/pkg/com/sun/imageio/plugins/png/CRC.class +0 −0
  380. java/pkg/com/sun/imageio/plugins/png/ChunkStream.class +0 −0
  381. java/pkg/com/sun/imageio/plugins/png/IDATOutputStream.class +0 −0
  382. java/pkg/com/sun/imageio/plugins/png/PNGImageDataEnumeration.class +0 −0
  383. java/pkg/com/sun/imageio/plugins/png/PNGImageReader.class +0 −0
  384. java/pkg/com/sun/imageio/plugins/png/PNGImageReader.java +1592 −0
  385. java/pkg/com/sun/imageio/plugins/png/PNGImageReaderSpi.class +0 −0
  386. java/pkg/com/sun/imageio/plugins/png/PNGImageReaderSpi.java +103 −0
  387. java/pkg/com/sun/imageio/plugins/png/PNGImageWriteParam.class +0 −0
  388. java/pkg/com/sun/imageio/plugins/png/PNGImageWriter.class +0 −0
  389. java/pkg/com/sun/imageio/plugins/png/PNGImageWriter.java +1171 −0
  390. java/pkg/com/sun/imageio/plugins/png/PNGImageWriterSpi.class +0 −0
  391. java/pkg/com/sun/imageio/plugins/png/PNGImageWriterSpi.java +126 −0
  392. java/pkg/com/sun/imageio/plugins/png/PNGMetadata.class +0 −0
  393. java/pkg/com/sun/imageio/plugins/png/PNGMetadata.java +2046 −0
  394. java/pkg/com/sun/imageio/plugins/png/PNGMetadataFormat.java +500 −0
  395. java/pkg/com/sun/imageio/plugins/png/PNGMetadataFormatResources.java +219 −0
  396. java/pkg/com/sun/imageio/plugins/png/RowFilter.class +0 −0
  397. java/pkg/com/sun/imageio/plugins/png/RowFilter.java +192 −0
  398. java/pkg/com/sun/imageio/plugins/png/mkfile +15 −0
  399. java/pkg/com/sun/imageio/plugins/wbmp/WBMPImageReader.class +0 −0
  400. java/pkg/com/sun/imageio/plugins/wbmp/WBMPImageReader.java +322 −0
  401. java/pkg/com/sun/imageio/plugins/wbmp/WBMPImageReaderSpi.class +0 −0
  402. java/pkg/com/sun/imageio/plugins/wbmp/WBMPImageReaderSpi.java +130 −0
  403. java/pkg/com/sun/imageio/plugins/wbmp/WBMPImageWriter.class +0 −0
  404. java/pkg/com/sun/imageio/plugins/wbmp/WBMPImageWriter.java +315 −0
  405. java/pkg/com/sun/imageio/plugins/wbmp/WBMPImageWriterSpi.class +0 −0
  406. java/pkg/com/sun/imageio/plugins/wbmp/WBMPImageWriterSpi.java +93 −0
  407. java/pkg/com/sun/imageio/plugins/wbmp/WBMPMetadata.class +0 −0
  408. java/pkg/com/sun/imageio/plugins/wbmp/WBMPMetadata.java +134 −0
  409. java/pkg/com/sun/imageio/plugins/wbmp/WBMPMetadataFormat.java +70 −0
  410. java/pkg/com/sun/imageio/plugins/wbmp/mkfile +13 −0
  411. java/pkg/com/sun/imageio/spi/FileImageInputStreamSpi.class +0 −0
  412. java/pkg/com/sun/imageio/spi/FileImageInputStreamSpi.java +63 −0
  413. java/pkg/com/sun/imageio/spi/FileImageOutputStreamSpi.class +0 −0
  414. java/pkg/com/sun/imageio/spi/FileImageOutputStreamSpi.java +64 −0
  415. java/pkg/com/sun/imageio/spi/InputStreamImageInputStreamSpi.class +0 −0
  416. java/pkg/com/sun/imageio/spi/InputStreamImageInputStreamSpi.java +77 −0
  417. java/pkg/com/sun/imageio/spi/OutputStreamImageOutputStreamSpi.class +0 −0
  418. java/pkg/com/sun/imageio/spi/OutputStreamImageOutputStreamSpi.java +76 −0
  419. java/pkg/com/sun/imageio/spi/RAFImageInputStreamSpi.class +0 −0
  420. java/pkg/com/sun/imageio/spi/RAFImageInputStreamSpi.java +65 −0
  421. java/pkg/com/sun/imageio/spi/RAFImageOutputStreamSpi.class +0 −0
  422. java/pkg/com/sun/imageio/spi/RAFImageOutputStreamSpi.java +66 −0
  423. java/pkg/com/sun/imageio/spi/mkfile +13 −0
  424. java/pkg/com/sun/imageio/stream/CloseableDisposerRecord.class +0 −0
  425. java/pkg/com/sun/imageio/stream/CloseableDisposerRecord.java +54 −0
  426. java/pkg/com/sun/imageio/stream/StreamCloser$1.class +0 −0
  427. java/pkg/com/sun/imageio/stream/StreamCloser$2.class +0 −0
  428. java/pkg/com/sun/imageio/stream/StreamCloser$CloseAction.class +0 −0
  429. java/pkg/com/sun/imageio/stream/StreamCloser.class +0 −0
  430. java/pkg/com/sun/imageio/stream/StreamCloser.java +134 −0
  431. java/pkg/com/sun/imageio/stream/StreamFinalizer.class +0 −0
  432. java/pkg/com/sun/imageio/stream/StreamFinalizer.java +72 −0
  433. java/pkg/com/sun/imageio/stream/mkfile +10 −0
  434. java/pkg/com/sun/jarsigner/ContentSigner.java +70 −0
  435. java/pkg/com/sun/jarsigner/ContentSignerParameters.java +97 −0
  436. java/pkg/com/sun/jarsigner/mkfile +9 −0
  437. java/pkg/com/sun/jarsigner/package.html +38 −0
  438. java/pkg/com/sun/java/browser/dom/DOMAccessException.java +89 −0
  439. java/pkg/com/sun/java/browser/dom/DOMAccessor.java +40 −0
  440. java/pkg/com/sun/java/browser/dom/DOMAction.java +42 −0
  441. java/pkg/com/sun/java/browser/dom/DOMService.java +103 −0
  442. java/pkg/com/sun/java/browser/dom/DOMServiceProvider.java +60 −0
  443. java/pkg/com/sun/java/browser/dom/DOMUnsupportedException.java +89 −0
  444. java/pkg/com/sun/java/browser/dom/mkfile +13 −0
  445. java/pkg/com/sun/java/browser/mkfile +7 −0
  446. java/pkg/com/sun/java/browser/net/ProxyInfo.java +36 −0
  447. java/pkg/com/sun/java/browser/net/ProxyService.java +61 −0
  448. java/pkg/com/sun/java/browser/net/ProxyServiceProvider.java +36 −0
  449. java/pkg/com/sun/java/browser/net/mkfile +10 −0
  450. java/pkg/com/sun/java/mkfile +8 −0
  451. java/pkg/com/sun/java/swing/Painter.java +33 −0
  452. java/pkg/com/sun/java/swing/SwingUtilities3$EventQueueDelegateFromMap.class +0 −0
  453. java/pkg/com/sun/java/swing/SwingUtilities3.class +0 −0
  454. java/pkg/com/sun/java/swing/SwingUtilities3.java +220 −0
  455. java/pkg/com/sun/java/swing/mkfile +13 −0
  456. java/pkg/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java +1303 −0
  457. java/pkg/com/sun/java/swing/plaf/gtk/GTKColorType.java +167 −0
  458. java/pkg/com/sun/java/swing/plaf/gtk/GTKConstants.java +118 −0
  459. java/pkg/com/sun/java/swing/plaf/gtk/GTKEngine.java +635 −0
  460. java/pkg/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java +1398 −0
  461. java/pkg/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java +144 −0
  462. java/pkg/com/sun/java/swing/plaf/gtk/GTKIconFactory.java +351 −0
  463. java/pkg/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java +1739 −0
  464. java/pkg/com/sun/java/swing/plaf/gtk/GTKPainter.java +1497 −0
  465. java/pkg/com/sun/java/swing/plaf/gtk/GTKRegion.java +42 −0
  466. java/pkg/com/sun/java/swing/plaf/gtk/GTKStyle.java +1141 −0
  467. java/pkg/com/sun/java/swing/plaf/gtk/GTKStyleFactory.java +182 −0
  468. java/pkg/com/sun/java/swing/plaf/gtk/Metacity.java +2155 −0
  469. java/pkg/com/sun/java/swing/plaf/gtk/PangoFonts.java +233 −0
  470. java/pkg/com/sun/java/swing/plaf/gtk/XColors.java +831 −0
  471. java/pkg/com/sun/java/swing/plaf/gtk/icons/Directory.gif +0 −0
  472. java/pkg/com/sun/java/swing/plaf/gtk/icons/File.gif +0 −0
  473. java/pkg/com/sun/java/swing/plaf/gtk/icons/image-delayed.png +0 −0
  474. java/pkg/com/sun/java/swing/plaf/gtk/icons/image-failed.png +0 −0
  475. java/pkg/com/sun/java/swing/plaf/gtk/icons/mkfile +2 −0
  476. java/pkg/com/sun/java/swing/plaf/gtk/mkfile +27 −0
  477. java/pkg/com/sun/java/swing/plaf/gtk/resources/gtk.properties +83 −0
  478. java/pkg/com/sun/java/swing/plaf/gtk/resources/gtk_de.properties +88 −0
  479. java/pkg/com/sun/java/swing/plaf/gtk/resources/gtk_es.properties +88 −0
  480. java/pkg/com/sun/java/swing/plaf/gtk/resources/gtk_fr.properties +88 −0
  481. java/pkg/com/sun/java/swing/plaf/gtk/resources/gtk_it.properties +88 −0
  482. java/pkg/com/sun/java/swing/plaf/gtk/resources/gtk_ja.properties +84 −0
  483. java/pkg/com/sun/java/swing/plaf/gtk/resources/gtk_ko.properties +84 −0
  484. java/pkg/com/sun/java/swing/plaf/gtk/resources/gtk_pt_BR.properties +88 −0
  485. java/pkg/com/sun/java/swing/plaf/gtk/resources/gtk_sv.properties +88 −0
  486. java/pkg/com/sun/java/swing/plaf/gtk/resources/gtk_zh_CN.properties +84 −0
  487. java/pkg/com/sun/java/swing/plaf/gtk/resources/gtk_zh_TW.properties +84 −0
  488. java/pkg/com/sun/java/swing/plaf/gtk/resources/metacity/SwingFallbackTheme/metacity-1/metacity-theme-1.xml +178 −0
  489. java/pkg/com/sun/java/swing/plaf/gtk/resources/metacity/SwingFallbackTheme/metacity-1/mkfile +2 −0
  490. java/pkg/com/sun/java/swing/plaf/gtk/resources/metacity/SwingFallbackTheme/mkfile +6 −0
  491. java/pkg/com/sun/java/swing/plaf/gtk/resources/metacity/mkfile +6 −0
  492. java/pkg/com/sun/java/swing/plaf/gtk/resources/mkfile +6 −0
  493. java/pkg/com/sun/java/swing/plaf/mkfile +9 −0
  494. java/pkg/com/sun/java/swing/plaf/motif/MotifBorders.java +734 −0
  495. java/pkg/com/sun/java/swing/plaf/motif/MotifButtonListener.java +49 −0
  496. java/pkg/com/sun/java/swing/plaf/motif/MotifButtonUI.java +150 −0
  497. java/pkg/com/sun/java/swing/plaf/motif/MotifCheckBoxMenuItemUI.java +107 −0
  498. java/pkg/com/sun/java/swing/plaf/motif/MotifCheckBoxUI.java +90 −0
  499. java/pkg/com/sun/java/swing/plaf/motif/MotifComboBoxUI.java +361 −0
  500. java/pkg/com/sun/java/swing/plaf/motif/MotifDesktopIconUI.java +365 −0
  501. java/pkg/com/sun/java/swing/plaf/motif/MotifDesktopPaneUI.java +267 −0
  502. java/pkg/com/sun/java/swing/plaf/motif/MotifEditorPaneUI.java +68 −0
  503. java/pkg/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java +846 −0
  504. java/pkg/com/sun/java/swing/plaf/motif/MotifGraphicsUtils.java +476 −0
  505. java/pkg/com/sun/java/swing/plaf/motif/MotifIconFactory.java +460 −0
  506. java/pkg/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java +374 −0
  507. java/pkg/com/sun/java/swing/plaf/motif/MotifInternalFrameUI.java +223 −0
  508. java/pkg/com/sun/java/swing/plaf/motif/MotifLabelUI.java +61 −0
  509. java/pkg/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java +1283 −0
  510. java/pkg/com/sun/java/swing/plaf/motif/MotifMenuBarUI.java +69 −0
  511. java/pkg/com/sun/java/swing/plaf/motif/MotifMenuItemUI.java +109 −0
  512. java/pkg/com/sun/java/swing/plaf/motif/MotifMenuMouseListener.java +48 −0
  513. java/pkg/com/sun/java/swing/plaf/motif/MotifMenuMouseMotionListener.java +43 −0
  514. java/pkg/com/sun/java/swing/plaf/motif/MotifMenuUI.java +151 −0
  515. java/pkg/com/sun/java/swing/plaf/motif/MotifOptionPaneUI.java +114 −0
  516. java/pkg/com/sun/java/swing/plaf/motif/MotifPasswordFieldUI.java +68 −0
  517. java/pkg/com/sun/java/swing/plaf/motif/MotifPopupMenuSeparatorUI.java +66 −0
  518. java/pkg/com/sun/java/swing/plaf/motif/MotifPopupMenuUI.java +114 −0
  519. java/pkg/com/sun/java/swing/plaf/motif/MotifProgressBarUI.java +58 −0
  520. java/pkg/com/sun/java/swing/plaf/motif/MotifRadioButtonMenuItemUI.java +113 −0
  521. java/pkg/com/sun/java/swing/plaf/motif/MotifRadioButtonUI.java +104 −0
  522. java/pkg/com/sun/java/swing/plaf/motif/MotifScrollBarButton.java +211 −0
  523. java/pkg/com/sun/java/swing/plaf/motif/MotifScrollBarUI.java +108 −0
  524. java/pkg/com/sun/java/swing/plaf/motif/MotifScrollPaneUI.java +143 −0
  525. java/pkg/com/sun/java/swing/plaf/motif/MotifSeparatorUI.java +59 −0
  526. java/pkg/com/sun/java/swing/plaf/motif/MotifSliderUI.java +159 −0
  527. java/pkg/com/sun/java/swing/plaf/motif/MotifSplitPaneDivider.java +295 −0
  528. java/pkg/com/sun/java/swing/plaf/motif/MotifSplitPaneUI.java +66 −0
  529. java/pkg/com/sun/java/swing/plaf/motif/MotifTabbedPaneUI.java +306 −0
  530. java/pkg/com/sun/java/swing/plaf/motif/MotifTextAreaUI.java +70 −0
  531. java/pkg/com/sun/java/swing/plaf/motif/MotifTextFieldUI.java +68 −0
  532. java/pkg/com/sun/java/swing/plaf/motif/MotifTextPaneUI.java +68 −0
  533. java/pkg/com/sun/java/swing/plaf/motif/MotifTextUI.java +175 −0
  534. java/pkg/com/sun/java/swing/plaf/motif/MotifToggleButtonUI.java +125 −0
  535. java/pkg/com/sun/java/swing/plaf/motif/MotifTreeCellRenderer.java +113 −0
  536. java/pkg/com/sun/java/swing/plaf/motif/MotifTreeUI.java +166 −0
  537. java/pkg/com/sun/java/swing/plaf/motif/icons/DesktopIcon.gif +0 −0
  538. java/pkg/com/sun/java/swing/plaf/motif/icons/Error.gif +0 −0
  539. java/pkg/com/sun/java/swing/plaf/motif/icons/Inform.gif +0 −0
  540. java/pkg/com/sun/java/swing/plaf/motif/icons/Question.gif +0 −0
  541. java/pkg/com/sun/java/swing/plaf/motif/icons/TreeClosed.gif +0 −0
  542. java/pkg/com/sun/java/swing/plaf/motif/icons/TreeOpen.gif +0 −0
  543. java/pkg/com/sun/java/swing/plaf/motif/icons/Warn.gif +0 −0
  544. java/pkg/com/sun/java/swing/plaf/motif/icons/image-delayed.png +0 −0
  545. java/pkg/com/sun/java/swing/plaf/motif/icons/image-failed.png +0 −0
  546. java/pkg/com/sun/java/swing/plaf/motif/icons/mkfile +2 −0
  547. java/pkg/com/sun/java/swing/plaf/motif/mkfile +55 −0
  548. java/pkg/com/sun/java/swing/plaf/motif/resources/mkfile +2 −0
  549. java/pkg/com/sun/java/swing/plaf/motif/resources/motif.properties +40 −0
  550. java/pkg/com/sun/java/swing/plaf/motif/resources/motif_de.properties +40 −0
  551. java/pkg/com/sun/java/swing/plaf/motif/resources/motif_es.properties +40 −0
  552. java/pkg/com/sun/java/swing/plaf/motif/resources/motif_fr.properties +40 −0
  553. java/pkg/com/sun/java/swing/plaf/motif/resources/motif_it.properties +40 −0
  554. java/pkg/com/sun/java/swing/plaf/motif/resources/motif_ja.properties +40 −0
  555. java/pkg/com/sun/java/swing/plaf/motif/resources/motif_ko.properties +40 −0
  556. java/pkg/com/sun/java/swing/plaf/motif/resources/motif_pt_BR.properties +40 −0
  557. java/pkg/com/sun/java/swing/plaf/motif/resources/motif_sv.properties +40 −0
  558. java/pkg/com/sun/java/swing/plaf/motif/resources/motif_zh_CN.properties +40 −0
  559. java/pkg/com/sun/java/swing/plaf/motif/resources/motif_zh_TW.properties +40 −0
  560. java/pkg/com/sun/java/swing/plaf/nimbus/AbstractRegionPainter.java +33 −0
  561. java/pkg/com/sun/java/swing/plaf/nimbus/NimbusLookAndFeel.java +33 −0
  562. java/pkg/com/sun/java/swing/plaf/nimbus/mkfile +9 −0
  563. java/pkg/com/sun/java/swing/plaf/windows/AnimationController$1.class +0 −0
  564. java/pkg/com/sun/java/swing/plaf/windows/AnimationController$AnimationState.class +0 −0
  565. java/pkg/com/sun/java/swing/plaf/windows/AnimationController$PartUIClientPropertyKey.class +0 −0
  566. java/pkg/com/sun/java/swing/plaf/windows/AnimationController.class +0 −0
  567. java/pkg/com/sun/java/swing/plaf/windows/AnimationController.java +428 −0
  568. java/pkg/com/sun/java/swing/plaf/windows/DesktopProperty$1.class +0 −0
  569. java/pkg/com/sun/java/swing/plaf/windows/DesktopProperty$WeakPCL.class +0 −0
  570. java/pkg/com/sun/java/swing/plaf/windows/DesktopProperty.class +0 −0
  571. java/pkg/com/sun/java/swing/plaf/windows/DesktopProperty.java +285 −0
  572. java/pkg/com/sun/java/swing/plaf/windows/TMSchema$Control.class +0 −0
  573. java/pkg/com/sun/java/swing/plaf/windows/TMSchema$Part.class +0 −0
  574. java/pkg/com/sun/java/swing/plaf/windows/TMSchema$Prop.class +0 −0
  575. java/pkg/com/sun/java/swing/plaf/windows/TMSchema$State.class +0 −0
  576. java/pkg/com/sun/java/swing/plaf/windows/TMSchema$TypeEnum.class +0 −0
  577. java/pkg/com/sun/java/swing/plaf/windows/TMSchema.class +0 −0
  578. java/pkg/com/sun/java/swing/plaf/windows/TMSchema.java +565 −0
  579. java/pkg/com/sun/java/swing/plaf/windows/WindowsBorders$ComplementDashedBorder.class +0 −0
  580. java/pkg/com/sun/java/swing/plaf/windows/WindowsBorders$DashedBorder.class +0 −0
  581. java/pkg/com/sun/java/swing/plaf/windows/WindowsBorders$InternalFrameLineBorder.class +0 −0
  582. java/pkg/com/sun/java/swing/plaf/windows/WindowsBorders$ProgressBarBorder.class +0 −0
  583. java/pkg/com/sun/java/swing/plaf/windows/WindowsBorders$ToolBarBorder.class +0 −0
  584. java/pkg/com/sun/java/swing/plaf/windows/WindowsBorders.class +0 −0
  585. java/pkg/com/sun/java/swing/plaf/windows/WindowsBorders.java +336 −0
  586. java/pkg/com/sun/java/swing/plaf/windows/WindowsButtonListener.java +54 −0
  587. java/pkg/com/sun/java/swing/plaf/windows/WindowsButtonUI$1.class +0 −0
  588. java/pkg/com/sun/java/swing/plaf/windows/WindowsButtonUI.class +0 −0
  589. java/pkg/com/sun/java/swing/plaf/windows/WindowsButtonUI.java +320 −0
  590. java/pkg/com/sun/java/swing/plaf/windows/WindowsCheckBoxMenuItemUI$1.class +0 −0
  591. java/pkg/com/sun/java/swing/plaf/windows/WindowsCheckBoxMenuItemUI.class +0 −0
  592. java/pkg/com/sun/java/swing/plaf/windows/WindowsCheckBoxMenuItemUI.java +104 −0
  593. java/pkg/com/sun/java/swing/plaf/windows/WindowsCheckBoxUI.java +95 −0
  594. java/pkg/com/sun/java/swing/plaf/windows/WindowsClassicLookAndFeel.class +0 −0
  595. java/pkg/com/sun/java/swing/plaf/windows/WindowsClassicLookAndFeel.java +44 −0
  596. java/pkg/com/sun/java/swing/plaf/windows/WindowsComboBoxUI$1.class +0 −0
  597. java/pkg/com/sun/java/swing/plaf/windows/WindowsComboBoxUI$2.class +0 −0
  598. java/pkg/com/sun/java/swing/plaf/windows/WindowsComboBoxUI$3.class +0 −0
  599. java/pkg/com/sun/java/swing/plaf/windows/WindowsComboBoxUI$WindowsComboBoxEditor.class +0 −0
  600. java/pkg/com/sun/java/swing/plaf/windows/WindowsComboBoxUI$WindowsComboBoxRenderer.class +0 −0
  601. java/pkg/com/sun/java/swing/plaf/windows/WindowsComboBoxUI$WindowsComboPopup$InvocationKeyHandler.class +0 −0
  602. java/pkg/com/sun/java/swing/plaf/windows/WindowsComboBoxUI$WindowsComboPopup.class +0 −0
  603. java/pkg/com/sun/java/swing/plaf/windows/WindowsComboBoxUI$XPComboBoxButton.class +0 −0
  604. java/pkg/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.class +0 −0
  605. java/pkg/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java +565 −0
  606. java/pkg/com/sun/java/swing/plaf/windows/WindowsDesktopIconUI.java +98 −0
  607. java/pkg/com/sun/java/swing/plaf/windows/WindowsDesktopManager.java +103 −0
  608. java/pkg/com/sun/java/swing/plaf/windows/WindowsDesktopPaneUI.java +71 −0
  609. java/pkg/com/sun/java/swing/plaf/windows/WindowsEditorPaneUI.java +68 −0
  610. java/pkg/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java +1309 −0
  611. java/pkg/com/sun/java/swing/plaf/windows/WindowsGraphicsUtils.class +0 −0
  612. java/pkg/com/sun/java/swing/plaf/windows/WindowsGraphicsUtils.java +211 −0
  613. java/pkg/com/sun/java/swing/plaf/windows/WindowsIconFactory$1.class +0 −0
  614. java/pkg/com/sun/java/swing/plaf/windows/WindowsIconFactory$CheckBoxIcon.class +0 −0
  615. java/pkg/com/sun/java/swing/plaf/windows/WindowsIconFactory$CheckBoxMenuItemIcon.class +0 −0
  616. java/pkg/com/sun/java/swing/plaf/windows/WindowsIconFactory$FrameButtonIcon.class +0 −0
  617. java/pkg/com/sun/java/swing/plaf/windows/WindowsIconFactory$MenuArrowIcon.class +0 −0
  618. java/pkg/com/sun/java/swing/plaf/windows/WindowsIconFactory$MenuItemArrowIcon.class +0 −0
  619. java/pkg/com/sun/java/swing/plaf/windows/WindowsIconFactory$MenuItemCheckIcon.class +0 −0
  620. java/pkg/com/sun/java/swing/plaf/windows/WindowsIconFactory$RadioButtonIcon.class +0 −0
  621. java/pkg/com/sun/java/swing/plaf/windows/WindowsIconFactory$RadioButtonMenuItemIcon.class +0 −0
  622. java/pkg/com/sun/java/swing/plaf/windows/WindowsIconFactory$ResizeIcon.class +0 −0
  623. java/pkg/com/sun/java/swing/plaf/windows/WindowsIconFactory$VistaMenuItemCheckIconFactory$VistaMenuItemCheckIcon.class +0 −0
  624. java/pkg/com/sun/java/swing/plaf/windows/WindowsIconFactory$VistaMenuItemCheckIconFactory.class +0 −0
  625. java/pkg/com/sun/java/swing/plaf/windows/WindowsIconFactory.class +0 −0
  626. java/pkg/com/sun/java/swing/plaf/windows/WindowsIconFactory.java +903 −0
  627. java/pkg/com/sun/java/swing/plaf/windows/WindowsInternalFrameTitlePane.java +559 −0
  628. java/pkg/com/sun/java/swing/plaf/windows/WindowsInternalFrameUI.java +134 −0
  629. java/pkg/com/sun/java/swing/plaf/windows/WindowsLabelUI.java +112 −0
  630. java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$1.class +0 −0
  631. java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$2.class +0 −0
  632. java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$ActiveWindowsIcon$1.class +0 −0
  633. java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$ActiveWindowsIcon.class +0 −0
  634. java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$AudioAction.class +0 −0
  635. java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$FontDesktopProperty.class +0 −0
  636. java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$LazyWindowsIcon.class +0 −0
  637. java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$RGBGrayFilter.class +0 −0
  638. java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$SkinIcon.class +0 −0
  639. java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$TriggerDesktopProperty.class +0 −0
  640. java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$WindowsFontProperty.class +0 −0
  641. java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$WindowsFontSizeProperty.class +0 −0
  642. java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$WindowsLayoutStyle.class +0 −0
  643. java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$XPBorderValue.class +0 −0
  644. java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$XPColorValue$XPColorValueKey.class +0 −0
  645. java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$XPColorValue.class +0 −0
  646. java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$XPDLUValue.class +0 −0
  647. java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$XPValue.class +0 −0
  648. java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.class +0 −0
  649. java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java +2620 −0
  650. java/pkg/com/sun/java/swing/plaf/windows/WindowsMenuBarUI$1.class +0 −0
  651. java/pkg/com/sun/java/swing/plaf/windows/WindowsMenuBarUI$2.class +0 −0
  652. java/pkg/com/sun/java/swing/plaf/windows/WindowsMenuBarUI$TakeFocus.class +0 −0
  653. java/pkg/com/sun/java/swing/plaf/windows/WindowsMenuBarUI.class +0 −0
  654. java/pkg/com/sun/java/swing/plaf/windows/WindowsMenuBarUI.java +186 −0
  655. java/pkg/com/sun/java/swing/plaf/windows/WindowsMenuItemUI$1.class +0 −0
  656. java/pkg/com/sun/java/swing/plaf/windows/WindowsMenuItemUI.class +0 −0
  657. java/pkg/com/sun/java/swing/plaf/windows/WindowsMenuItemUI.java +177 −0
  658. java/pkg/com/sun/java/swing/plaf/windows/WindowsMenuItemUIAccessor.class +0 −0
  659. java/pkg/com/sun/java/swing/plaf/windows/WindowsMenuItemUIAccessor.java +46 −0
  660. java/pkg/com/sun/java/swing/plaf/windows/WindowsMenuUI$1.class +0 −0
  661. java/pkg/com/sun/java/swing/plaf/windows/WindowsMenuUI$WindowsMouseInputHandler.class +0 −0
  662. java/pkg/com/sun/java/swing/plaf/windows/WindowsMenuUI.class +0 −0
  663. java/pkg/com/sun/java/swing/plaf/windows/WindowsMenuUI.java +295 −0
  664. java/pkg/com/sun/java/swing/plaf/windows/WindowsOptionPaneUI.java +47 −0
  665. java/pkg/com/sun/java/swing/plaf/windows/WindowsPasswordFieldUI.java +69 −0
  666. java/pkg/com/sun/java/swing/plaf/windows/WindowsPopupMenuSeparatorUI.java +94 −0
  667. java/pkg/com/sun/java/swing/plaf/windows/WindowsPopupMenuUI$MnemonicListener.class +0 −0
  668. java/pkg/com/sun/java/swing/plaf/windows/WindowsPopupMenuUI.class +0 −0
  669. java/pkg/com/sun/java/swing/plaf/windows/WindowsPopupMenuUI.java +224 −0
  670. java/pkg/com/sun/java/swing/plaf/windows/WindowsPopupWindow.java +95 −0
  671. java/pkg/com/sun/java/swing/plaf/windows/WindowsProgressBarUI.java +400 −0
  672. java/pkg/com/sun/java/swing/plaf/windows/WindowsRadioButtonMenuItemUI$1.class +0 −0
  673. java/pkg/com/sun/java/swing/plaf/windows/WindowsRadioButtonMenuItemUI.class +0 −0
  674. java/pkg/com/sun/java/swing/plaf/windows/WindowsRadioButtonMenuItemUI.java +103 −0
  675. java/pkg/com/sun/java/swing/plaf/windows/WindowsRadioButtonUI.java +130 −0
  676. java/pkg/com/sun/java/swing/plaf/windows/WindowsRootPaneUI$AltProcessor.class +0 −0
  677. java/pkg/com/sun/java/swing/plaf/windows/WindowsRootPaneUI.class +0 −0
  678. java/pkg/com/sun/java/swing/plaf/windows/WindowsRootPaneUI.java +184 −0
  679. java/pkg/com/sun/java/swing/plaf/windows/WindowsScrollBarUI.java +479 −0
  680. java/pkg/com/sun/java/swing/plaf/windows/WindowsScrollPaneUI.java +44 −0
  681. java/pkg/com/sun/java/swing/plaf/windows/WindowsSeparatorUI.java +35 −0
  682. java/pkg/com/sun/java/swing/plaf/windows/WindowsSliderUI.java +234 −0
  683. java/pkg/com/sun/java/swing/plaf/windows/WindowsSpinnerUI.java +103 −0
  684. java/pkg/com/sun/java/swing/plaf/windows/WindowsSplitPaneDivider.java +72 −0
  685. java/pkg/com/sun/java/swing/plaf/windows/WindowsSplitPaneUI.java +67 −0
  686. java/pkg/com/sun/java/swing/plaf/windows/WindowsTabbedPaneUI.java +227 −0
  687. java/pkg/com/sun/java/swing/plaf/windows/WindowsTableHeaderUI.java +245 −0
  688. java/pkg/com/sun/java/swing/plaf/windows/WindowsTextAreaUI.java +68 −0
  689. java/pkg/com/sun/java/swing/plaf/windows/WindowsTextFieldUI.java +175 −0
  690. java/pkg/com/sun/java/swing/plaf/windows/WindowsTextPaneUI.java +67 −0
  691. java/pkg/com/sun/java/swing/plaf/windows/WindowsTextUI.java +236 −0
  692. java/pkg/com/sun/java/swing/plaf/windows/WindowsToggleButtonUI.java +181 −0
  693. java/pkg/com/sun/java/swing/plaf/windows/WindowsToolBarSeparatorUI.java +124 −0
  694. java/pkg/com/sun/java/swing/plaf/windows/WindowsToolBarUI.java +99 −0
  695. java/pkg/com/sun/java/swing/plaf/windows/WindowsTreeUI$CollapsedIcon.class +0 −0
  696. java/pkg/com/sun/java/swing/plaf/windows/WindowsTreeUI$ExpandedIcon.class +0 −0
  697. java/pkg/com/sun/java/swing/plaf/windows/WindowsTreeUI$WindowsTreeCellRenderer.class +0 −0
  698. java/pkg/com/sun/java/swing/plaf/windows/WindowsTreeUI.class +0 −0
  699. java/pkg/com/sun/java/swing/plaf/windows/WindowsTreeUI.java +234 −0
  700. java/pkg/com/sun/java/swing/plaf/windows/XPStyle$GlyphButton.class +0 −0
  701. java/pkg/com/sun/java/swing/plaf/windows/XPStyle$Skin.class +0 −0
  702. java/pkg/com/sun/java/swing/plaf/windows/XPStyle$SkinPainter.class +0 −0
  703. java/pkg/com/sun/java/swing/plaf/windows/XPStyle$XPEmptyBorder.class +0 −0
  704. java/pkg/com/sun/java/swing/plaf/windows/XPStyle$XPFillBorder.class +0 −0
  705. java/pkg/com/sun/java/swing/plaf/windows/XPStyle$XPImageBorder.class +0 −0
  706. java/pkg/com/sun/java/swing/plaf/windows/XPStyle$XPStatefulFillBorder.class +0 −0
  707. java/pkg/com/sun/java/swing/plaf/windows/XPStyle.class +0 −0
  708. java/pkg/com/sun/java/swing/plaf/windows/XPStyle.java +751 −0
  709. java/pkg/com/sun/java/swing/plaf/windows/icons/Computer.gif +0 −0
  710. java/pkg/com/sun/java/swing/plaf/windows/icons/DetailsView.gif +0 −0
  711. java/pkg/com/sun/java/swing/plaf/windows/icons/Directory.gif +0 −0
  712. java/pkg/com/sun/java/swing/plaf/windows/icons/Error.gif +0 −0
  713. java/pkg/com/sun/java/swing/plaf/windows/icons/File.gif +0 −0
  714. java/pkg/com/sun/java/swing/plaf/windows/icons/FloppyDrive.gif +0 −0
  715. java/pkg/com/sun/java/swing/plaf/windows/icons/HardDrive.gif +0 −0
  716. java/pkg/com/sun/java/swing/plaf/windows/icons/HomeFolder.gif +0 −0
  717. java/pkg/com/sun/java/swing/plaf/windows/icons/Inform.gif +0 −0
  718. java/pkg/com/sun/java/swing/plaf/windows/icons/JavaCup32.png +0 −0
  719. java/pkg/com/sun/java/swing/plaf/windows/icons/ListView.gif +0 −0
  720. java/pkg/com/sun/java/swing/plaf/windows/icons/NewFolder.gif +0 −0
  721. java/pkg/com/sun/java/swing/plaf/windows/icons/Question.gif +0 −0
  722. java/pkg/com/sun/java/swing/plaf/windows/icons/TreeClosed.gif +0 −0
  723. java/pkg/com/sun/java/swing/plaf/windows/icons/TreeLeaf.gif +0 −0
  724. java/pkg/com/sun/java/swing/plaf/windows/icons/TreeOpen.gif +0 −0
  725. java/pkg/com/sun/java/swing/plaf/windows/icons/UpFolder.gif +0 −0
  726. java/pkg/com/sun/java/swing/plaf/windows/icons/Warn.gif +0 −0
  727. java/pkg/com/sun/java/swing/plaf/windows/icons/image-delayed.png +0 −0
  728. java/pkg/com/sun/java/swing/plaf/windows/icons/image-failed.png +0 −0
  729. java/pkg/com/sun/java/swing/plaf/windows/icons/mkfile +2 −0
  730. java/pkg/com/sun/java/swing/plaf/windows/mkfile +64 −0
  731. java/pkg/com/sun/java/swing/plaf/windows/resources/mkfile +2 −0
  732. java/pkg/com/sun/java/swing/plaf/windows/resources/windows.properties +47 −0
  733. java/pkg/com/sun/java/swing/plaf/windows/resources/windows_de.properties +47 −0
  734. java/pkg/com/sun/java/swing/plaf/windows/resources/windows_es.properties +47 −0
  735. java/pkg/com/sun/java/swing/plaf/windows/resources/windows_fr.properties +47 −0
  736. java/pkg/com/sun/java/swing/plaf/windows/resources/windows_it.properties +47 −0
  737. java/pkg/com/sun/java/swing/plaf/windows/resources/windows_ja.properties +47 −0
  738. java/pkg/com/sun/java/swing/plaf/windows/resources/windows_ko.properties +47 −0
  739. java/pkg/com/sun/java/swing/plaf/windows/resources/windows_pt_BR.properties +47 −0
  740. java/pkg/com/sun/java/swing/plaf/windows/resources/windows_sv.properties +47 −0
  741. java/pkg/com/sun/java/swing/plaf/windows/resources/windows_zh_CN.properties +47 −0
  742. java/pkg/com/sun/java/swing/plaf/windows/resources/windows_zh_TW.properties +47 −0
  743. java/pkg/com/sun/java/util/jar/mkfile +6 −0
  744. java/pkg/com/sun/java/util/jar/pack/AdaptiveCoding.class +0 −0
  745. java/pkg/com/sun/java/util/jar/pack/AdaptiveCoding.java +298 −0
  746. java/pkg/com/sun/java/util/jar/pack/Attribute$1.class +0 −0
  747. java/pkg/com/sun/java/util/jar/pack/Attribute$FormatException.class +0 −0
  748. java/pkg/com/sun/java/util/jar/pack/Attribute$Holder.class +0 −0
  749. java/pkg/com/sun/java/util/jar/pack/Attribute$Layout$Element.class +0 −0
  750. java/pkg/com/sun/java/util/jar/pack/Attribute$Layout.class +0 −0
  751. java/pkg/com/sun/java/util/jar/pack/Attribute$ValueStream.class +0 −0
  752. java/pkg/com/sun/java/util/jar/pack/Attribute.class +0 −0
  753. java/pkg/com/sun/java/util/jar/pack/Attribute.java +1622 −0
  754. java/pkg/com/sun/java/util/jar/pack/BandStructure$Band.class +0 −0
  755. java/pkg/com/sun/java/util/jar/pack/BandStructure$ByteBand$1.class +0 −0
  756. java/pkg/com/sun/java/util/jar/pack/BandStructure$ByteBand.class +0 −0
  757. java/pkg/com/sun/java/util/jar/pack/BandStructure$ByteCounter.class +0 −0
  758. java/pkg/com/sun/java/util/jar/pack/BandStructure$CPRefBand.class +0 −0
  759. java/pkg/com/sun/java/util/jar/pack/BandStructure$IntBand.class +0 −0
  760. java/pkg/com/sun/java/util/jar/pack/BandStructure$MultiBand.class +0 −0
  761. java/pkg/com/sun/java/util/jar/pack/BandStructure$ValueBand.class +0 −0
  762. java/pkg/com/sun/java/util/jar/pack/BandStructure.class +0 −0
  763. java/pkg/com/sun/java/util/jar/pack/BandStructure.java +2682 −0
  764. java/pkg/com/sun/java/util/jar/pack/ClassReader$1.class +0 −0
  765. java/pkg/com/sun/java/util/jar/pack/ClassReader$ClassFormatException.class +0 −0
  766. java/pkg/com/sun/java/util/jar/pack/ClassReader.class +0 −0
  767. java/pkg/com/sun/java/util/jar/pack/ClassReader.java +494 −0
  768. java/pkg/com/sun/java/util/jar/pack/ClassWriter.class +0 −0
  769. java/pkg/com/sun/java/util/jar/pack/ClassWriter.java +257 −0
  770. java/pkg/com/sun/java/util/jar/pack/Code.class +0 −0
  771. java/pkg/com/sun/java/util/jar/pack/Code.java +399 −0
  772. java/pkg/com/sun/java/util/jar/pack/Coding.class +0 −0
  773. java/pkg/com/sun/java/util/jar/pack/Coding.java +907 −0
  774. java/pkg/com/sun/java/util/jar/pack/CodingChooser$Choice.class +0 −0
  775. java/pkg/com/sun/java/util/jar/pack/CodingChooser$Sizer.class +0 −0
  776. java/pkg/com/sun/java/util/jar/pack/CodingChooser.class +0 −0
  777. java/pkg/com/sun/java/util/jar/pack/CodingChooser.java +1489 −0
  778. java/pkg/com/sun/java/util/jar/pack/CodingMethod.class +0 −0
  779. java/pkg/com/sun/java/util/jar/pack/CodingMethod.java +43 −0
  780. java/pkg/com/sun/java/util/jar/pack/ConstantPool$ClassEntry.class +0 −0
  781. java/pkg/com/sun/java/util/jar/pack/ConstantPool$DescriptorEntry.class +0 −0
  782. java/pkg/com/sun/java/util/jar/pack/ConstantPool$Entry.class +0 −0
  783. java/pkg/com/sun/java/util/jar/pack/ConstantPool$Index.class +0 −0
  784. java/pkg/com/sun/java/util/jar/pack/ConstantPool$IndexGroup.class +0 −0
  785. java/pkg/com/sun/java/util/jar/pack/ConstantPool$LiteralEntry.class +0 −0
  786. java/pkg/com/sun/java/util/jar/pack/ConstantPool$MemberEntry.class +0 −0
  787. java/pkg/com/sun/java/util/jar/pack/ConstantPool$NumberEntry.class +0 −0
  788. java/pkg/com/sun/java/util/jar/pack/ConstantPool$SignatureEntry.class +0 −0
  789. java/pkg/com/sun/java/util/jar/pack/ConstantPool$StringEntry.class +0 −0
  790. java/pkg/com/sun/java/util/jar/pack/ConstantPool$Utf8Entry.class +0 −0
  791. java/pkg/com/sun/java/util/jar/pack/ConstantPool.class +0 −0
  792. java/pkg/com/sun/java/util/jar/pack/ConstantPool.java +1218 −0
  793. java/pkg/com/sun/java/util/jar/pack/Constants.class +0 −0
  794. java/pkg/com/sun/java/util/jar/pack/Constants.java +436 −0
  795. java/pkg/com/sun/java/util/jar/pack/Driver.java +725 −0
  796. java/pkg/com/sun/java/util/jar/pack/DriverResource.java +131 −0
  797. java/pkg/com/sun/java/util/jar/pack/FixedList.class +0 −0
  798. java/pkg/com/sun/java/util/jar/pack/FixedList.java +174 −0
  799. java/pkg/com/sun/java/util/jar/pack/Fixups$1.class +0 −0
  800. java/pkg/com/sun/java/util/jar/pack/Fixups$Fixup.class +0 −0
  801. java/pkg/com/sun/java/util/jar/pack/Fixups$Itr.class +0 −0
  802. java/pkg/com/sun/java/util/jar/pack/Fixups.class +0 −0
  803. java/pkg/com/sun/java/util/jar/pack/Fixups.java +546 −0
  804. java/pkg/com/sun/java/util/jar/pack/Histogram$1.class +0 −0
  805. java/pkg/com/sun/java/util/jar/pack/Histogram$BitMetric.class +0 −0
  806. java/pkg/com/sun/java/util/jar/pack/Histogram.class +0 −0
  807. java/pkg/com/sun/java/util/jar/pack/Histogram.java +818 −0
  808. java/pkg/com/sun/java/util/jar/pack/Instruction$FormatException.class +0 −0
  809. java/pkg/com/sun/java/util/jar/pack/Instruction$LookupSwitch.class +0 −0
  810. java/pkg/com/sun/java/util/jar/pack/Instruction$Switch.class +0 −0
  811. java/pkg/com/sun/java/util/jar/pack/Instruction$TableSwitch.class +0 −0
  812. java/pkg/com/sun/java/util/jar/pack/Instruction.class +0 −0
  813. java/pkg/com/sun/java/util/jar/pack/Instruction.java +664 −0
  814. java/pkg/com/sun/java/util/jar/pack/NativeUnpack.class +0 −0
  815. java/pkg/com/sun/java/util/jar/pack/NativeUnpack.java +322 −0
  816. java/pkg/com/sun/java/util/jar/pack/Package$1.class +0 −0
  817. java/pkg/com/sun/java/util/jar/pack/Package$Class$Field.class +0 −0
  818. java/pkg/com/sun/java/util/jar/pack/Package$Class$Member.class +0 −0
  819. java/pkg/com/sun/java/util/jar/pack/Package$Class$Method.class +0 −0
  820. java/pkg/com/sun/java/util/jar/pack/Package$Class.class +0 −0
  821. java/pkg/com/sun/java/util/jar/pack/Package$File.class +0 −0
  822. java/pkg/com/sun/java/util/jar/pack/Package$InnerClass.class +0 −0
  823. java/pkg/com/sun/java/util/jar/pack/Package.class +0 −0
  824. java/pkg/com/sun/java/util/jar/pack/Package.java +1322 −0
  825. java/pkg/com/sun/java/util/jar/pack/PackageReader$1.class +0 −0
  826. java/pkg/com/sun/java/util/jar/pack/PackageReader$2.class +0 −0
  827. java/pkg/com/sun/java/util/jar/pack/PackageReader$LimitedBuffer$1.class +0 −0
  828. java/pkg/com/sun/java/util/jar/pack/PackageReader$LimitedBuffer.class +0 −0
  829. java/pkg/com/sun/java/util/jar/pack/PackageReader.class +0 −0
  830. java/pkg/com/sun/java/util/jar/pack/PackageReader.java +2204 −0
  831. java/pkg/com/sun/java/util/jar/pack/PackageWriter$1.class +0 −0
  832. java/pkg/com/sun/java/util/jar/pack/PackageWriter$2.class +0 −0
  833. java/pkg/com/sun/java/util/jar/pack/PackageWriter$3.class +0 −0
  834. java/pkg/com/sun/java/util/jar/pack/PackageWriter.class +0 −0
  835. java/pkg/com/sun/java/util/jar/pack/PackageWriter.java +1619 −0
  836. java/pkg/com/sun/java/util/jar/pack/PackerImpl$1.class +0 −0
  837. java/pkg/com/sun/java/util/jar/pack/PackerImpl$DoPack$InFile.class +0 −0
  838. java/pkg/com/sun/java/util/jar/pack/PackerImpl$DoPack.class +0 −0
  839. java/pkg/com/sun/java/util/jar/pack/PackerImpl.class +0 −0
  840. java/pkg/com/sun/java/util/jar/pack/PackerImpl.java +642 −0
  841. java/pkg/com/sun/java/util/jar/pack/PopulationCoding.class +0 −0
  842. java/pkg/com/sun/java/util/jar/pack/PopulationCoding.java +500 −0
  843. java/pkg/com/sun/java/util/jar/pack/PropMap.class +0 −0
  844. java/pkg/com/sun/java/util/jar/pack/PropMap.java +338 −0
  845. java/pkg/com/sun/java/util/jar/pack/TLGlobals.class +0 −0
  846. java/pkg/com/sun/java/util/jar/pack/TLGlobals.java +97 −0
  847. java/pkg/com/sun/java/util/jar/pack/UnpackerImpl$1.class +0 −0
  848. java/pkg/com/sun/java/util/jar/pack/UnpackerImpl$DoUnpack.class +0 −0
  849. java/pkg/com/sun/java/util/jar/pack/UnpackerImpl.class +0 −0
  850. java/pkg/com/sun/java/util/jar/pack/UnpackerImpl.java +281 −0
  851. java/pkg/com/sun/java/util/jar/pack/Utils$NonCloser.class +0 −0
  852. java/pkg/com/sun/java/util/jar/pack/Utils$Pack200Logger.class +0 −0
  853. java/pkg/com/sun/java/util/jar/pack/Utils.class +0 −0
  854. java/pkg/com/sun/java/util/jar/pack/Utils.java +344 −0
  855. java/pkg/com/sun/java/util/jar/pack/intrinsic.properties +46 −0
  856. java/pkg/com/sun/java/util/jar/pack/mkfile +34 −0
  857. java/pkg/com/sun/java/util/jar/pack/package.html +104 −0
  858. java/pkg/com/sun/java/util/mkfile +6 −0
  859. java/pkg/com/sun/jdi/AbsentInformationException.java +45 −0
  860. java/pkg/com/sun/jdi/Accessible.java +107 −0
  861. java/pkg/com/sun/jdi/ArrayReference.java +209 −0
  862. java/pkg/com/sun/jdi/ArrayType.java +96 −0
  863. java/pkg/com/sun/jdi/BooleanType.java +39 −0
  864. java/pkg/com/sun/jdi/BooleanValue.java +61 −0
  865. java/pkg/com/sun/jdi/Bootstrap.java +56 −0
  866. java/pkg/com/sun/jdi/ByteType.java +40 −0
  867. java/pkg/com/sun/jdi/ByteValue.java +60 −0
  868. java/pkg/com/sun/jdi/CharType.java +40 −0
  869. java/pkg/com/sun/jdi/CharValue.java +61 −0
  870. java/pkg/com/sun/jdi/ClassLoaderReference.java +93 −0
  871. java/pkg/com/sun/jdi/ClassNotLoadedException.java +87 −0
  872. java/pkg/com/sun/jdi/ClassNotPreparedException.java +45 −0
  873. java/pkg/com/sun/jdi/ClassObjectReference.java +48 −0
  874. java/pkg/com/sun/jdi/ClassType.java +372 −0
  875. java/pkg/com/sun/jdi/DoubleType.java +40 −0
  876. java/pkg/com/sun/jdi/DoubleValue.java +61 −0
  877. java/pkg/com/sun/jdi/Field.java +135 −0
  878. java/pkg/com/sun/jdi/FloatType.java +40 −0
  879. java/pkg/com/sun/jdi/FloatValue.java +61 −0
  880. java/pkg/com/sun/jdi/IncompatibleThreadStateException.java +46 −0
  881. java/pkg/com/sun/jdi/InconsistentDebugInfoException.java +45 −0
  882. java/pkg/com/sun/jdi/IntegerType.java +40 −0
  883. java/pkg/com/sun/jdi/IntegerValue.java +61 −0
  884. java/pkg/com/sun/jdi/InterfaceType.java +81 −0
  885. java/pkg/com/sun/jdi/InternalException.java +61 −0
  886. java/pkg/com/sun/jdi/InvalidCodeIndexException.java +46 −0
  887. java/pkg/com/sun/jdi/InvalidLineNumberException.java +46 −0
  888. java/pkg/com/sun/jdi/InvalidStackFrameException.java +43 −0
  889. java/pkg/com/sun/jdi/InvalidTypeException.java +46 −0
  890. java/pkg/com/sun/jdi/InvocationException.java +49 −0
  891. java/pkg/com/sun/jdi/JDIPermission.java +113 −0
  892. java/pkg/com/sun/jdi/LocalVariable.java +153 −0
  893. java/pkg/com/sun/jdi/Locatable.java +49 −0
  894. java/pkg/com/sun/jdi/Location.java +261 −0
  895. java/pkg/com/sun/jdi/LongType.java +40 −0
  896. java/pkg/com/sun/jdi/LongValue.java +61 −0
  897. java/pkg/com/sun/jdi/Method.java +429 −0
  898. java/pkg/com/sun/jdi/Mirror.java +76 −0
  899. java/pkg/com/sun/jdi/MonitorInfo.java +73 −0
  900. java/pkg/com/sun/jdi/NativeMethodException.java +44 −0
  901. java/pkg/com/sun/jdi/ObjectCollectedException.java +43 −0
  902. java/pkg/com/sun/jdi/ObjectReference.java +444 −0
  903. java/pkg/com/sun/jdi/PathSearchingVirtualMachine.java +61 −0
  904. java/pkg/com/sun/jdi/PrimitiveType.java +41 −0
  905. java/pkg/com/sun/jdi/PrimitiveValue.java +123 −0
  906. java/pkg/com/sun/jdi/ReferenceType.java +830 −0
  907. java/pkg/com/sun/jdi/ShortType.java +39 −0
  908. java/pkg/com/sun/jdi/ShortValue.java +61 −0
  909. java/pkg/com/sun/jdi/StackFrame.java +239 −0
  910. java/pkg/com/sun/jdi/StringReference.java +48 −0
  911. java/pkg/com/sun/jdi/ThreadGroupReference.java +101 −0
  912. java/pkg/com/sun/jdi/ThreadReference.java +473 −0
  913. java/pkg/com/sun/jdi/Type.java +149 −0
  914. java/pkg/com/sun/jdi/TypeComponent.java +129 −0
  915. java/pkg/com/sun/jdi/VMCannotBeModifiedException.java +43 −0
  916. java/pkg/com/sun/jdi/VMDisconnectedException.java +44 −0
  917. java/pkg/com/sun/jdi/VMMismatchException.java +44 −0
  918. java/pkg/com/sun/jdi/VMOutOfMemoryException.java +43 −0
  919. java/pkg/com/sun/jdi/Value.java +181 −0
  920. java/pkg/com/sun/jdi/VirtualMachine.java +863 −0
  921. java/pkg/com/sun/jdi/VirtualMachineManager.java +430 −0
  922. java/pkg/com/sun/jdi/VoidType.java +39 −0
  923. java/pkg/com/sun/jdi/VoidValue.java +51 −0
  924. java/pkg/com/sun/jdi/connect/AttachingConnector.java +69 −0
  925. java/pkg/com/sun/jdi/connect/Connector.java +285 −0
  926. java/pkg/com/sun/jdi/connect/IllegalConnectorArgumentsException.java +79 −0
  927. java/pkg/com/sun/jdi/connect/LaunchingConnector.java +74 −0
  928. java/pkg/com/sun/jdi/connect/ListeningConnector.java +117 −0
  929. java/pkg/com/sun/jdi/connect/Transport.java +52 −0
  930. java/pkg/com/sun/jdi/connect/TransportTimeoutException.java +77 −0
  931. java/pkg/com/sun/jdi/connect/VMStartException.java +55 −0
  932. java/pkg/com/sun/jdi/connect/mkfile +19 −0
  933. java/pkg/com/sun/jdi/connect/package.html +43 −0
  934. java/pkg/com/sun/jdi/connect/spi/ClosedConnectionException.java +67 −0
  935. java/pkg/com/sun/jdi/connect/spi/Connection.java +200 −0
  936. java/pkg/com/sun/jdi/connect/spi/TransportService.java +377 −0
  937. java/pkg/com/sun/jdi/connect/spi/mkfile +10 −0
  938. java/pkg/com/sun/jdi/connect/spi/package.html +35 −0
  939. java/pkg/com/sun/jdi/doc-files/mkfile +2 −0
  940. java/pkg/com/sun/jdi/doc-files/signature.html +39 −0
  941. java/pkg/com/sun/jdi/event/AccessWatchpointEvent.java +41 −0
  942. java/pkg/com/sun/jdi/event/BreakpointEvent.java +52 −0
  943. java/pkg/com/sun/jdi/event/ClassPrepareEvent.java +73 −0
  944. java/pkg/com/sun/jdi/event/ClassUnloadEvent.java +52 −0
  945. java/pkg/com/sun/jdi/event/Event.java +54 −0
  946. java/pkg/com/sun/jdi/event/EventIterator.java +49 −0
  947. java/pkg/com/sun/jdi/event/EventQueue.java +88 −0
  948. java/pkg/com/sun/jdi/event/EventSet.java +171 −0
  949. java/pkg/com/sun/jdi/event/ExceptionEvent.java +94 −0
  950. java/pkg/com/sun/jdi/event/LocatableEvent.java +48 −0
  951. java/pkg/com/sun/jdi/event/MethodEntryEvent.java +54 −0
  952. java/pkg/com/sun/jdi/event/MethodExitEvent.java +73 −0
  953. java/pkg/com/sun/jdi/event/ModificationWatchpointEvent.java +48 −0
  954. java/pkg/com/sun/jdi/event/MonitorContendedEnterEvent.java +60 −0
  955. java/pkg/com/sun/jdi/event/MonitorContendedEnteredEvent.java +60 −0
  956. java/pkg/com/sun/jdi/event/MonitorWaitEvent.java +65 −0
  957. java/pkg/com/sun/jdi/event/MonitorWaitedEvent.java +67 −0
  958. java/pkg/com/sun/jdi/event/StepEvent.java +51 −0
  959. java/pkg/com/sun/jdi/event/ThreadDeathEvent.java +56 −0
  960. java/pkg/com/sun/jdi/event/ThreadStartEvent.java +63 −0
  961. java/pkg/com/sun/jdi/event/VMDeathEvent.java +72 −0
  962. java/pkg/com/sun/jdi/event/VMDisconnectEvent.java +56 −0
  963. java/pkg/com/sun/jdi/event/VMStartEvent.java +54 −0
  964. java/pkg/com/sun/jdi/event/WatchpointEvent.java +67 −0
  965. java/pkg/com/sun/jdi/event/mkfile +31 −0
  966. java/pkg/com/sun/jdi/event/package.html +49 −0
  967. java/pkg/com/sun/jdi/mkfile +79 −0
  968. java/pkg/com/sun/jdi/package.html +50 −0
  969. java/pkg/com/sun/jdi/request/AccessWatchpointRequest.java +60 −0
  970. java/pkg/com/sun/jdi/request/BreakpointRequest.java +87 −0
  971. java/pkg/com/sun/jdi/request/ClassPrepareRequest.java +124 −0
  972. java/pkg/com/sun/jdi/request/ClassUnloadRequest.java +76 −0
  973. java/pkg/com/sun/jdi/request/DuplicateRequestException.java +45 −0
  974. java/pkg/com/sun/jdi/request/EventRequest.java +210 −0
  975. java/pkg/com/sun/jdi/request/EventRequestManager.java +544 −0
  976. java/pkg/com/sun/jdi/request/ExceptionRequest.java +155 −0
  977. java/pkg/com/sun/jdi/request/InvalidRequestStateException.java +48 −0
  978. java/pkg/com/sun/jdi/request/MethodEntryRequest.java +116 −0
  979. java/pkg/com/sun/jdi/request/MethodExitRequest.java +119 −0
  980. java/pkg/com/sun/jdi/request/ModificationWatchpointRequest.java +59 −0
  981. java/pkg/com/sun/jdi/request/MonitorContendedEnterRequest.java +116 −0
  982. java/pkg/com/sun/jdi/request/MonitorContendedEnteredRequest.java +116 −0
  983. java/pkg/com/sun/jdi/request/MonitorWaitRequest.java +115 −0
  984. java/pkg/com/sun/jdi/request/MonitorWaitedRequest.java +115 −0
  985. java/pkg/com/sun/jdi/request/StepRequest.java +135 −0
  986. java/pkg/com/sun/jdi/request/ThreadDeathRequest.java +58 −0
  987. java/pkg/com/sun/jdi/request/ThreadStartRequest.java +58 −0
  988. java/pkg/com/sun/jdi/request/VMDeathRequest.java +61 −0
  989. java/pkg/com/sun/jdi/request/WatchpointRequest.java +120 −0
  990. java/pkg/com/sun/jdi/request/mkfile +28 −0
  991. java/pkg/com/sun/jdi/request/package.html +48 −0
  992. java/pkg/com/sun/jmx/defaults/JmxProperties.class +0 −0
  993. java/pkg/com/sun/jmx/defaults/JmxProperties.java +232 −0
  994. java/pkg/com/sun/jmx/defaults/ServiceName.class +0 −0
  995. java/pkg/com/sun/jmx/defaults/ServiceName.java +97 −0
  996. java/pkg/com/sun/jmx/defaults/mkfile +9 −0
  997. java/pkg/com/sun/jmx/defaults/package.html +33 −0
  998. java/pkg/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor$1.class +0 −0
  999. java/pkg/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor$2.class +0 −0
  1000. java/pkg/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor$ListenerWrapper.class +0 −0
  1001. java/pkg/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor$ResourceContext$1.class +0 −0
  1002. java/pkg/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor$ResourceContext.class +0 −0
  1003. java/pkg/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.class +0 −0
  1004. java/pkg/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java +2064 −0
  1005. java/pkg/com/sun/jmx/interceptor/MBeanServerInterceptor.class +0 −0
  1006. java/pkg/com/sun/jmx/interceptor/MBeanServerInterceptor.java +130 −0
  1007. java/pkg/com/sun/jmx/interceptor/mkfile +9 −0
  1008. java/pkg/com/sun/jmx/interceptor/package.html +36 −0
  1009. java/pkg/com/sun/jmx/mbeanserver/ClassLoaderRepositorySupport$LoaderEntry.class +0 −0
  1010. java/pkg/com/sun/jmx/mbeanserver/ClassLoaderRepositorySupport.class +0 −0
  1011. java/pkg/com/sun/jmx/mbeanserver/ClassLoaderRepositorySupport.java +304 −0
  1012. java/pkg/com/sun/jmx/mbeanserver/ConvertingMethod.class +0 −0
  1013. java/pkg/com/sun/jmx/mbeanserver/ConvertingMethod.java +228 −0
  1014. java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$1.class +0 −0
  1015. java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$ArrayMapping.class +0 −0
  1016. java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$CollectionMapping.class +0 −0
  1017. java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$CompositeBuilder.class +0 −0
  1018. java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$CompositeBuilderCheckGetters.class +0 −0
  1019. java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$CompositeBuilderViaConstructor$Constr.class +0 −0
  1020. java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$CompositeBuilderViaConstructor.class +0 −0
  1021. java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$CompositeBuilderViaFrom.class +0 −0
  1022. java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$CompositeBuilderViaProxy.class +0 −0
  1023. java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$CompositeBuilderViaSetters.class +0 −0
  1024. java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$CompositeMapping.class +0 −0
  1025. java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$EnumMapping.class +0 −0
  1026. java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$IdentityMapping.class +0 −0
  1027. java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$MXBeanRefMapping.class +0 −0
  1028. java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$Mappings.class +0 −0
  1029. java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$NonNullMXBeanMapping.class +0 −0
  1030. java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$TabularMapping.class +0 −0
  1031. java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.class +0 −0
  1032. java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java +1492 −0
  1033. java/pkg/com/sun/jmx/mbeanserver/DescriptorCache.class +0 −0
  1034. java/pkg/com/sun/jmx/mbeanserver/DescriptorCache.java +67 −0
  1035. java/pkg/com/sun/jmx/mbeanserver/DynamicMBean2.class +0 −0
  1036. java/pkg/com/sun/jmx/mbeanserver/DynamicMBean2.java +77 −0
  1037. java/pkg/com/sun/jmx/mbeanserver/GetPropertyAction.class +0 −0
  1038. java/pkg/com/sun/jmx/mbeanserver/GetPropertyAction.java +46 −0
  1039. java/pkg/com/sun/jmx/mbeanserver/Introspector$BeansHelper.class +0 −0
  1040. java/pkg/com/sun/jmx/mbeanserver/Introspector$SimpleIntrospector.class +0 −0
  1041. java/pkg/com/sun/jmx/mbeanserver/Introspector.class +0 −0
  1042. java/pkg/com/sun/jmx/mbeanserver/Introspector.java +778 −0
  1043. java/pkg/com/sun/jmx/mbeanserver/JmxMBeanServer$1.class +0 −0
  1044. java/pkg/com/sun/jmx/mbeanserver/JmxMBeanServer.class +0 −0
  1045. java/pkg/com/sun/jmx/mbeanserver/JmxMBeanServer.java +1497 −0
  1046. java/pkg/com/sun/jmx/mbeanserver/JmxMBeanServerBuilder.java +114 −0
  1047. java/pkg/com/sun/jmx/mbeanserver/MBeanAnalyzer$1.class +0 −0
  1048. java/pkg/com/sun/jmx/mbeanserver/MBeanAnalyzer$AttrMethods.class +0 −0
  1049. java/pkg/com/sun/jmx/mbeanserver/MBeanAnalyzer$MBeanVisitor.class +0 −0
  1050. java/pkg/com/sun/jmx/mbeanserver/MBeanAnalyzer$MethodOrder.class +0 −0
  1051. java/pkg/com/sun/jmx/mbeanserver/MBeanAnalyzer.class +0 −0
  1052. java/pkg/com/sun/jmx/mbeanserver/MBeanAnalyzer.java +270 −0
  1053. java/pkg/com/sun/jmx/mbeanserver/MBeanInstantiator.class +0 −0
  1054. java/pkg/com/sun/jmx/mbeanserver/MBeanInstantiator.java +718 −0
  1055. java/pkg/com/sun/jmx/mbeanserver/MBeanIntrospector$1.class +0 −0
  1056. java/pkg/com/sun/jmx/mbeanserver/MBeanIntrospector$MBeanInfoMaker.class +0 −0
  1057. java/pkg/com/sun/jmx/mbeanserver/MBeanIntrospector$MBeanInfoMap.class +0 −0
  1058. java/pkg/com/sun/jmx/mbeanserver/MBeanIntrospector$PerInterfaceMap.class +0 −0
  1059. java/pkg/com/sun/jmx/mbeanserver/MBeanIntrospector.class +0 −0
  1060. java/pkg/com/sun/jmx/mbeanserver/MBeanIntrospector.java +469 −0
  1061. java/pkg/com/sun/jmx/mbeanserver/MBeanServerDelegateImpl.class +0 −0
  1062. java/pkg/com/sun/jmx/mbeanserver/MBeanServerDelegateImpl.java +321 −0
  1063. java/pkg/com/sun/jmx/mbeanserver/MBeanSupport.class +0 −0
  1064. java/pkg/com/sun/jmx/mbeanserver/MBeanSupport.java +274 −0
  1065. java/pkg/com/sun/jmx/mbeanserver/MXBeanIntrospector.class +0 −0
  1066. java/pkg/com/sun/jmx/mbeanserver/MXBeanIntrospector.java +365 −0
  1067. java/pkg/com/sun/jmx/mbeanserver/MXBeanLookup.class +0 −0
  1068. java/pkg/com/sun/jmx/mbeanserver/MXBeanLookup.java +188 −0
  1069. java/pkg/com/sun/jmx/mbeanserver/MXBeanMapping.class +0 −0
  1070. java/pkg/com/sun/jmx/mbeanserver/MXBeanMapping.java +210 −0
  1071. java/pkg/com/sun/jmx/mbeanserver/MXBeanMappingFactory.class +0 −0
  1072. java/pkg/com/sun/jmx/mbeanserver/MXBeanMappingFactory.java +124 −0
  1073. java/pkg/com/sun/jmx/mbeanserver/MXBeanProxy$1.class +0 −0
  1074. java/pkg/com/sun/jmx/mbeanserver/MXBeanProxy$GetHandler.class +0 −0
  1075. java/pkg/com/sun/jmx/mbeanserver/MXBeanProxy$Handler.class +0 −0
  1076. java/pkg/com/sun/jmx/mbeanserver/MXBeanProxy$InvokeHandler.class +0 −0
  1077. java/pkg/com/sun/jmx/mbeanserver/MXBeanProxy$SetHandler.class +0 −0
  1078. java/pkg/com/sun/jmx/mbeanserver/MXBeanProxy$Visitor.class +0 −0
  1079. java/pkg/com/sun/jmx/mbeanserver/MXBeanProxy.class +0 −0
  1080. java/pkg/com/sun/jmx/mbeanserver/MXBeanProxy.java +175 −0
  1081. java/pkg/com/sun/jmx/mbeanserver/MXBeanSupport.class +0 −0
  1082. java/pkg/com/sun/jmx/mbeanserver/MXBeanSupport.java +178 −0
  1083. java/pkg/com/sun/jmx/mbeanserver/ModifiableClassLoaderRepository.class +0 −0
  1084. java/pkg/com/sun/jmx/mbeanserver/ModifiableClassLoaderRepository.java +70 −0
  1085. java/pkg/com/sun/jmx/mbeanserver/NamedObject.class +0 −0
  1086. java/pkg/com/sun/jmx/mbeanserver/NamedObject.java +122 −0
  1087. java/pkg/com/sun/jmx/mbeanserver/ObjectInputStreamWithLoader.class +0 −0
  1088. java/pkg/com/sun/jmx/mbeanserver/ObjectInputStreamWithLoader.java +68 −0
  1089. java/pkg/com/sun/jmx/mbeanserver/PerInterface$1.class +0 −0
  1090. java/pkg/com/sun/jmx/mbeanserver/PerInterface$InitMaps.class +0 −0
  1091. java/pkg/com/sun/jmx/mbeanserver/PerInterface$MethodAndSig.class +0 −0
  1092. java/pkg/com/sun/jmx/mbeanserver/PerInterface.class +0 −0
  1093. java/pkg/com/sun/jmx/mbeanserver/PerInterface.java +280 −0
  1094. java/pkg/com/sun/jmx/mbeanserver/Repository$ObjectNamePattern.class +0 −0
  1095. java/pkg/com/sun/jmx/mbeanserver/Repository$RegistrationContext.class +0 −0
  1096. java/pkg/com/sun/jmx/mbeanserver/Repository.class +0 −0
  1097. java/pkg/com/sun/jmx/mbeanserver/Repository.java +678 −0
  1098. java/pkg/com/sun/jmx/mbeanserver/SecureClassLoaderRepository.class +0 −0
  1099. java/pkg/com/sun/jmx/mbeanserver/SecureClassLoaderRepository.java +64 −0
  1100. java/pkg/com/sun/jmx/mbeanserver/StandardMBeanIntrospector.class +0 −0
  1101. java/pkg/com/sun/jmx/mbeanserver/StandardMBeanIntrospector.java +192 −0
  1102. java/pkg/com/sun/jmx/mbeanserver/StandardMBeanSupport.class +0 −0
  1103. java/pkg/com/sun/jmx/mbeanserver/StandardMBeanSupport.java +95 −0
  1104. java/pkg/com/sun/jmx/mbeanserver/SunJmxMBeanServer.class +0 −0
  1105. java/pkg/com/sun/jmx/mbeanserver/SunJmxMBeanServer.java +90 −0
  1106. java/pkg/com/sun/jmx/mbeanserver/Util.class +0 −0
  1107. java/pkg/com/sun/jmx/mbeanserver/Util.java +241 −0
  1108. java/pkg/com/sun/jmx/mbeanserver/WeakIdentityHashMap$IdentityWeakReference.class +0 −0
  1109. java/pkg/com/sun/jmx/mbeanserver/WeakIdentityHashMap.class +0 −0
  1110. java/pkg/com/sun/jmx/mbeanserver/WeakIdentityHashMap.java +137 −0
  1111. java/pkg/com/sun/jmx/mbeanserver/mkfile +38 −0
  1112. java/pkg/com/sun/jmx/mbeanserver/package.html +33 −0
  1113. java/pkg/com/sun/jmx/mkfile +10 −0
  1114. java/pkg/com/sun/jmx/remote/internal/ArrayNotificationBuffer$1.class +0 −0
  1115. java/pkg/com/sun/jmx/remote/internal/ArrayNotificationBuffer$2.class +0 −0
  1116. java/pkg/com/sun/jmx/remote/internal/ArrayNotificationBuffer$3.class +0 −0
  1117. java/pkg/com/sun/jmx/remote/internal/ArrayNotificationBuffer$4.class +0 −0
  1118. java/pkg/com/sun/jmx/remote/internal/ArrayNotificationBuffer$5.class +0 −0
  1119. java/pkg/com/sun/jmx/remote/internal/ArrayNotificationBuffer$BroadcasterQuery.class +0 −0
  1120. java/pkg/com/sun/jmx/remote/internal/ArrayNotificationBuffer$BufferListener.class +0 −0
  1121. java/pkg/com/sun/jmx/remote/internal/ArrayNotificationBuffer$NamedNotification.class +0 −0
  1122. java/pkg/com/sun/jmx/remote/internal/ArrayNotificationBuffer$ShareBuffer.class +0 −0
  1123. java/pkg/com/sun/jmx/remote/internal/ArrayNotificationBuffer.class +0 −0
  1124. java/pkg/com/sun/jmx/remote/internal/ArrayNotificationBuffer.java +838 −0
  1125. java/pkg/com/sun/jmx/remote/internal/ArrayQueue.class +0 −0
  1126. java/pkg/com/sun/jmx/remote/internal/ArrayQueue.java +102 −0
  1127. java/pkg/com/sun/jmx/remote/internal/ClientCommunicatorAdmin$1.class +0 −0
  1128. java/pkg/com/sun/jmx/remote/internal/ClientCommunicatorAdmin$Checker.class +0 −0
  1129. java/pkg/com/sun/jmx/remote/internal/ClientCommunicatorAdmin.class +0 −0
  1130. java/pkg/com/sun/jmx/remote/internal/ClientCommunicatorAdmin.java +252 −0
  1131. java/pkg/com/sun/jmx/remote/internal/ClientListenerInfo.class +0 −0
  1132. java/pkg/com/sun/jmx/remote/internal/ClientListenerInfo.java +106 −0
  1133. java/pkg/com/sun/jmx/remote/internal/ClientNotifForwarder$1.class +0 −0
  1134. java/pkg/com/sun/jmx/remote/internal/ClientNotifForwarder$LinearExecutor$1.class +0 −0
  1135. java/pkg/com/sun/jmx/remote/internal/ClientNotifForwarder$LinearExecutor.class +0 −0
  1136. java/pkg/com/sun/jmx/remote/internal/ClientNotifForwarder$NotifFetcher$1.class +0 −0
  1137. java/pkg/com/sun/jmx/remote/internal/ClientNotifForwarder$NotifFetcher.class +0 −0
  1138. java/pkg/com/sun/jmx/remote/internal/ClientNotifForwarder.class +0 −0
  1139. java/pkg/com/sun/jmx/remote/internal/ClientNotifForwarder.java +910 −0
  1140. java/pkg/com/sun/jmx/remote/internal/IIOPHelper$1.class +0 −0
  1141. java/pkg/com/sun/jmx/remote/internal/IIOPHelper.class +0 −0
  1142. java/pkg/com/sun/jmx/remote/internal/IIOPHelper.java +188 −0
  1143. java/pkg/com/sun/jmx/remote/internal/IIOPProxy.class +0 −0
  1144. java/pkg/com/sun/jmx/remote/internal/IIOPProxy.java +110 −0
  1145. java/pkg/com/sun/jmx/remote/internal/NotificationBuffer.class +0 −0
  1146. java/pkg/com/sun/jmx/remote/internal/NotificationBuffer.java +72 −0
  1147. java/pkg/com/sun/jmx/remote/internal/NotificationBufferFilter.class +0 −0
  1148. java/pkg/com/sun/jmx/remote/internal/NotificationBufferFilter.java +40 −0
  1149. java/pkg/com/sun/jmx/remote/internal/ProxyRef.class +0 −0
  1150. java/pkg/com/sun/jmx/remote/internal/ProxyRef.java +103 −0
  1151. java/pkg/com/sun/jmx/remote/internal/RMIExporter.class +0 −0
  1152. java/pkg/com/sun/jmx/remote/internal/RMIExporter.java +59 −0
  1153. java/pkg/com/sun/jmx/remote/internal/ServerCommunicatorAdmin$1.class +0 −0
  1154. java/pkg/com/sun/jmx/remote/internal/ServerCommunicatorAdmin$Timeout.class +0 −0
  1155. java/pkg/com/sun/jmx/remote/internal/ServerCommunicatorAdmin.class +0 −0
  1156. java/pkg/com/sun/jmx/remote/internal/ServerCommunicatorAdmin.java +232 −0
  1157. java/pkg/com/sun/jmx/remote/internal/ServerNotifForwarder$1.class +0 −0
  1158. java/pkg/com/sun/jmx/remote/internal/ServerNotifForwarder$2.class +0 −0
  1159. java/pkg/com/sun/jmx/remote/internal/ServerNotifForwarder$3.class +0 −0
  1160. java/pkg/com/sun/jmx/remote/internal/ServerNotifForwarder$IdAndFilter.class +0 −0
  1161. java/pkg/com/sun/jmx/remote/internal/ServerNotifForwarder.class +0 −0
  1162. java/pkg/com/sun/jmx/remote/internal/ServerNotifForwarder.java +494 −0
  1163. java/pkg/com/sun/jmx/remote/internal/Unmarshal.java +34 −0
  1164. java/pkg/com/sun/jmx/remote/internal/mkfile +21 −0
  1165. java/pkg/com/sun/jmx/remote/internal/package.html +37 −0
  1166. java/pkg/com/sun/jmx/remote/mkfile +9 −0
  1167. java/pkg/com/sun/jmx/remote/protocol/iiop/ClientProvider.java +48 −0
  1168. java/pkg/com/sun/jmx/remote/protocol/iiop/IIOPProxyImpl.java +119 −0
  1169. java/pkg/com/sun/jmx/remote/protocol/iiop/ProxyInputStream.java +241 −0
  1170. java/pkg/com/sun/jmx/remote/protocol/iiop/ServerProvider.java +51 −0
  1171. java/pkg/com/sun/jmx/remote/protocol/iiop/mkfile +11 −0
  1172. java/pkg/com/sun/jmx/remote/protocol/mkfile +7 −0
  1173. java/pkg/com/sun/jmx/remote/protocol/rmi/ClientProvider.java +48 −0
  1174. java/pkg/com/sun/jmx/remote/protocol/rmi/ServerProvider.java +51 −0
  1175. java/pkg/com/sun/jmx/remote/protocol/rmi/mkfile +9 −0
  1176. java/pkg/com/sun/jmx/remote/security/FileLoginModule.class +0 −0
  1177. java/pkg/com/sun/jmx/remote/security/FileLoginModule.java +570 −0
  1178. java/pkg/com/sun/jmx/remote/security/JMXPluggableAuthenticator$1.class +0 −0
  1179. java/pkg/com/sun/jmx/remote/security/JMXPluggableAuthenticator$2.class +0 −0
  1180. java/pkg/com/sun/jmx/remote/security/JMXPluggableAuthenticator$FileLoginConfig.class +0 −0
  1181. java/pkg/com/sun/jmx/remote/security/JMXPluggableAuthenticator$JMXCallbackHandler.class +0 −0
  1182. java/pkg/com/sun/jmx/remote/security/JMXPluggableAuthenticator.class +0 −0
  1183. java/pkg/com/sun/jmx/remote/security/JMXPluggableAuthenticator.java +346 −0
  1184. java/pkg/com/sun/jmx/remote/security/JMXSubjectDomainCombiner.class +0 −0
  1185. java/pkg/com/sun/jmx/remote/security/JMXSubjectDomainCombiner.java +106 −0
  1186. java/pkg/com/sun/jmx/remote/security/MBeanServerAccessController.class +0 −0
  1187. java/pkg/com/sun/jmx/remote/security/MBeanServerAccessController.java +665 −0
  1188. java/pkg/com/sun/jmx/remote/security/MBeanServerFileAccessController$1.class +0 −0
  1189. java/pkg/com/sun/jmx/remote/security/MBeanServerFileAccessController$2.class +0 −0
  1190. java/pkg/com/sun/jmx/remote/security/MBeanServerFileAccessController$Access.class +0 −0
  1191. java/pkg/com/sun/jmx/remote/security/MBeanServerFileAccessController$AccessType.class +0 −0
  1192. java/pkg/com/sun/jmx/remote/security/MBeanServerFileAccessController$Parser.class +0 −0
  1193. java/pkg/com/sun/jmx/remote/security/MBeanServerFileAccessController.class +0 −0
  1194. java/pkg/com/sun/jmx/remote/security/MBeanServerFileAccessController.java +544 −0
  1195. java/pkg/com/sun/jmx/remote/security/NotificationAccessController.class +0 −0
  1196. java/pkg/com/sun/jmx/remote/security/NotificationAccessController.java +110 −0
  1197. java/pkg/com/sun/jmx/remote/security/SubjectDelegator$1.class +0 −0
  1198. java/pkg/com/sun/jmx/remote/security/SubjectDelegator.class +0 −0
  1199. java/pkg/com/sun/jmx/remote/security/SubjectDelegator.java +148 −0
  1200. java/pkg/com/sun/jmx/remote/security/mkfile +14 −0
  1201. java/pkg/com/sun/jmx/remote/util/CacheMap.class +0 −0
  1202. java/pkg/com/sun/jmx/remote/util/CacheMap.java +121 −0
  1203. java/pkg/com/sun/jmx/remote/util/ClassLoaderWithRepository.class +0 −0
  1204. java/pkg/com/sun/jmx/remote/util/ClassLoaderWithRepository.java +55 −0
  1205. java/pkg/com/sun/jmx/remote/util/ClassLogger.class +0 −0
  1206. java/pkg/com/sun/jmx/remote/util/ClassLogger.java +246 −0
  1207. java/pkg/com/sun/jmx/remote/util/EnvHelp$1.class +0 −0
  1208. java/pkg/com/sun/jmx/remote/util/EnvHelp$SinkOutputStream.class +0 −0
  1209. java/pkg/com/sun/jmx/remote/util/EnvHelp.class +0 −0
  1210. java/pkg/com/sun/jmx/remote/util/EnvHelp.java +808 −0
  1211. java/pkg/com/sun/jmx/remote/util/OrderClassLoaders.class +0 −0
  1212. java/pkg/com/sun/jmx/remote/util/OrderClassLoaders.java +48 −0
  1213. java/pkg/com/sun/jmx/remote/util/mkfile +12 −0
  1214. java/pkg/com/sun/jmx/snmp/BerDecoder.java +757 −0
  1215. java/pkg/com/sun/jmx/snmp/BerEncoder.java +477 −0
  1216. java/pkg/com/sun/jmx/snmp/BerException.java +63 −0
  1217. java/pkg/com/sun/jmx/snmp/EnumRowStatus.java +308 −0
  1218. java/pkg/com/sun/jmx/snmp/Enumerated.java +219 −0
  1219. java/pkg/com/sun/jmx/snmp/IPAcl/ASCII_CharStream.README +23 −0
  1220. java/pkg/com/sun/jmx/snmp/IPAcl/ASCII_CharStream.java +402 −0
  1221. java/pkg/com/sun/jmx/snmp/IPAcl/AclEntryImpl.java +263 −0
  1222. java/pkg/com/sun/jmx/snmp/IPAcl/AclImpl.java +287 −0
  1223. java/pkg/com/sun/jmx/snmp/IPAcl/GroupImpl.java +142 −0
  1224. java/pkg/com/sun/jmx/snmp/IPAcl/Host.java +181 −0
  1225. java/pkg/com/sun/jmx/snmp/IPAcl/JDMAccess.java +64 −0
  1226. java/pkg/com/sun/jmx/snmp/IPAcl/JDMAclBlock.java +61 −0
  1227. java/pkg/com/sun/jmx/snmp/IPAcl/JDMAclItem.java +58 −0
  1228. java/pkg/com/sun/jmx/snmp/IPAcl/JDMCommunities.java +53 −0
  1229. java/pkg/com/sun/jmx/snmp/IPAcl/JDMCommunity.java +53 −0
  1230. java/pkg/com/sun/jmx/snmp/IPAcl/JDMEnterprise.java +49 −0
  1231. java/pkg/com/sun/jmx/snmp/IPAcl/JDMHost.java +51 −0
  1232. java/pkg/com/sun/jmx/snmp/IPAcl/JDMHostInform.java +48 −0
  1233. java/pkg/com/sun/jmx/snmp/IPAcl/JDMHostName.java +62 −0
  1234. java/pkg/com/sun/jmx/snmp/IPAcl/JDMHostTrap.java +49 −0
  1235. java/pkg/com/sun/jmx/snmp/IPAcl/JDMInformBlock.java +60 −0
  1236. java/pkg/com/sun/jmx/snmp/IPAcl/JDMInformCommunity.java +51 −0
  1237. java/pkg/com/sun/jmx/snmp/IPAcl/JDMInformInterestedHost.java +46 −0
  1238. java/pkg/com/sun/jmx/snmp/IPAcl/JDMInformItem.java +51 −0
  1239. java/pkg/com/sun/jmx/snmp/IPAcl/JDMIpAddress.java +63 −0
  1240. java/pkg/com/sun/jmx/snmp/IPAcl/JDMIpMask.java +63 −0
  1241. java/pkg/com/sun/jmx/snmp/IPAcl/JDMIpV6Address.java +41 −0
  1242. java/pkg/com/sun/jmx/snmp/IPAcl/JDMManagers.java +47 −0
  1243. java/pkg/com/sun/jmx/snmp/IPAcl/JDMNetMask.java +58 −0
  1244. java/pkg/com/sun/jmx/snmp/IPAcl/JDMNetMaskV6.java +46 −0
  1245. java/pkg/com/sun/jmx/snmp/IPAcl/JDMSecurityDefs.java +47 −0
  1246. java/pkg/com/sun/jmx/snmp/IPAcl/JDMTrapBlock.java +61 −0
  1247. java/pkg/com/sun/jmx/snmp/IPAcl/JDMTrapCommunity.java +52 −0
  1248. java/pkg/com/sun/jmx/snmp/IPAcl/JDMTrapInterestedHost.java +47 −0
  1249. java/pkg/com/sun/jmx/snmp/IPAcl/JDMTrapItem.java +53 −0
  1250. java/pkg/com/sun/jmx/snmp/IPAcl/JDMTrapNum.java +50 −0
  1251. java/pkg/com/sun/jmx/snmp/IPAcl/JJTParserState.java +149 −0
  1252. java/pkg/com/sun/jmx/snmp/IPAcl/NetMaskImpl.java +266 −0
  1253. java/pkg/com/sun/jmx/snmp/IPAcl/Node.java +60 −0
  1254. java/pkg/com/sun/jmx/snmp/IPAcl/OwnerImpl.java +137 −0
  1255. java/pkg/com/sun/jmx/snmp/IPAcl/ParseError.java +38 −0
  1256. java/pkg/com/sun/jmx/snmp/IPAcl/ParseException.java +217 −0
  1257. java/pkg/com/sun/jmx/snmp/IPAcl/Parser.java +1285 −0
  1258. java/pkg/com/sun/jmx/snmp/IPAcl/Parser.jj +948 −0
  1259. java/pkg/com/sun/jmx/snmp/IPAcl/Parser.jjt +380 −0
  1260. java/pkg/com/sun/jmx/snmp/IPAcl/ParserConstants.java +111 −0
  1261. java/pkg/com/sun/jmx/snmp/IPAcl/ParserTokenManager.java +1514 −0
  1262. java/pkg/com/sun/jmx/snmp/IPAcl/ParserTreeConstants.java +88 −0
  1263. java/pkg/com/sun/jmx/snmp/IPAcl/PermissionImpl.java +89 −0
  1264. java/pkg/com/sun/jmx/snmp/IPAcl/PrincipalImpl.java +148 −0
  1265. java/pkg/com/sun/jmx/snmp/IPAcl/README.update +29 −0
  1266. java/pkg/com/sun/jmx/snmp/IPAcl/SimpleNode.java +155 −0
  1267. java/pkg/com/sun/jmx/snmp/IPAcl/SnmpAcl.java +486 −0
  1268. java/pkg/com/sun/jmx/snmp/IPAcl/Token.java +107 −0
  1269. java/pkg/com/sun/jmx/snmp/IPAcl/TokenMgrError.java +160 −0
  1270. java/pkg/com/sun/jmx/snmp/IPAcl/mkfile +54 −0
  1271. java/pkg/com/sun/jmx/snmp/IPAcl/package.html +34 −0
  1272. java/pkg/com/sun/jmx/snmp/InetAddressAcl.java +128 −0
  1273. java/pkg/com/sun/jmx/snmp/ServiceName.java +170 −0
  1274. java/pkg/com/sun/jmx/snmp/SnmpAckPdu.java +39 −0
  1275. java/pkg/com/sun/jmx/snmp/SnmpBadSecurityLevelException.java +38 −0
  1276. java/pkg/com/sun/jmx/snmp/SnmpCounter.java +99 −0
  1277. java/pkg/com/sun/jmx/snmp/SnmpCounter64.java +214 −0
  1278. java/pkg/com/sun/jmx/snmp/SnmpEngine.java +70 −0
  1279. java/pkg/com/sun/jmx/snmp/SnmpEngineFactory.java +58 −0
  1280. java/pkg/com/sun/jmx/snmp/SnmpEngineId.java +489 −0
  1281. java/pkg/com/sun/jmx/snmp/SnmpEngineParameters.java +117 −0
  1282. java/pkg/com/sun/jmx/snmp/SnmpGauge.java +99 −0
  1283. java/pkg/com/sun/jmx/snmp/SnmpInt.java +282 −0
  1284. java/pkg/com/sun/jmx/snmp/SnmpIpAddress.java +217 −0
  1285. java/pkg/com/sun/jmx/snmp/SnmpMessage.java +362 −0
  1286. java/pkg/com/sun/jmx/snmp/SnmpMsg.java +476 −0
  1287. java/pkg/com/sun/jmx/snmp/SnmpNull.java +183 −0
  1288. java/pkg/com/sun/jmx/snmp/SnmpOpaque.java +100 −0
  1289. java/pkg/com/sun/jmx/snmp/SnmpParams.java +76 −0
  1290. java/pkg/com/sun/jmx/snmp/SnmpPdu.java +124 −0
  1291. java/pkg/com/sun/jmx/snmp/SnmpPduBulk.java +119 −0
  1292. java/pkg/com/sun/jmx/snmp/SnmpPduBulkType.java +58 −0
  1293. java/pkg/com/sun/jmx/snmp/SnmpPduFactory.java +94 −0
  1294. java/pkg/com/sun/jmx/snmp/SnmpPduFactoryBER.java +131 −0
  1295. java/pkg/com/sun/jmx/snmp/SnmpPduRequest.java +109 −0
  1296. java/pkg/com/sun/jmx/snmp/SnmpPduRequestType.java +60 −0
  1297. java/pkg/com/sun/jmx/snmp/SnmpPduTrap.java +93 −0
  1298. java/pkg/com/sun/jmx/snmp/SnmpScopedPduBulk.java +110 −0
  1299. java/pkg/com/sun/jmx/snmp/SnmpScopedPduPacket.java +104 −0
  1300. java/pkg/com/sun/jmx/snmp/SnmpScopedPduRequest.java +95 −0
  1301. java/pkg/com/sun/jmx/snmp/SnmpSecurityException.java +67 −0
  1302. java/pkg/com/sun/jmx/snmp/SnmpSecurityParameters.java +54 −0
  1303. java/pkg/com/sun/jmx/snmp/SnmpStatusException.java +146 −0
  1304. java/pkg/com/sun/jmx/snmp/SnmpString.java +278 −0
  1305. java/pkg/com/sun/jmx/snmp/SnmpStringFixed.java +193 −0
  1306. java/pkg/com/sun/jmx/snmp/SnmpTooBigException.java +82 −0
  1307. java/pkg/com/sun/jmx/snmp/SnmpUnknownAccContrModelException.java +47 −0
  1308. java/pkg/com/sun/jmx/snmp/SnmpUnknownModelException.java +42 −0
  1309. java/pkg/com/sun/jmx/snmp/SnmpUnknownModelLcdException.java +42 −0
  1310. java/pkg/com/sun/jmx/snmp/SnmpUnknownMsgProcModelException.java +45 −0
  1311. java/pkg/com/sun/jmx/snmp/SnmpUnknownSecModelException.java +45 −0
  1312. java/pkg/com/sun/jmx/snmp/SnmpUnknownSubSystemException.java +42 −0
  1313. java/pkg/com/sun/jmx/snmp/SnmpUnsignedInt.java +125 −0
  1314. java/pkg/com/sun/jmx/snmp/SnmpUsmKeyHandler.java +98 −0
  1315. java/pkg/com/sun/jmx/snmp/SnmpV3Message.java +511 −0
  1316. java/pkg/com/sun/jmx/snmp/SnmpValue.java +96 −0
  1317. java/pkg/com/sun/jmx/snmp/ThreadContext.java +326 −0
  1318. java/pkg/com/sun/jmx/snmp/UserAcl.java +97 −0
  1319. java/pkg/com/sun/jmx/snmp/agent/SnmpEntryOid.java +51 −0
  1320. java/pkg/com/sun/jmx/snmp/agent/SnmpErrorHandlerAgent.java +206 −0
  1321. java/pkg/com/sun/jmx/snmp/agent/SnmpGenericMetaServer.java +132 −0
  1322. java/pkg/com/sun/jmx/snmp/agent/SnmpGenericObjectServer.java +573 −0
  1323. java/pkg/com/sun/jmx/snmp/agent/SnmpIndex.java +190 −0
  1324. java/pkg/com/sun/jmx/snmp/agent/SnmpMib.java +1026 −0
  1325. java/pkg/com/sun/jmx/snmp/agent/SnmpMibAgent.java +757 −0
  1326. java/pkg/com/sun/jmx/snmp/agent/SnmpMibAgentMBean.java +316 −0
  1327. java/pkg/com/sun/jmx/snmp/agent/SnmpMibEntry.java +194 −0
  1328. java/pkg/com/sun/jmx/snmp/agent/SnmpMibGroup.java +519 −0
  1329. java/pkg/com/sun/jmx/snmp/agent/SnmpMibHandler.java +155 −0
  1330. java/pkg/com/sun/jmx/snmp/agent/SnmpMibNode.java +414 −0
  1331. java/pkg/com/sun/jmx/snmp/agent/SnmpMibOid.java +561 −0
  1332. java/pkg/com/sun/jmx/snmp/agent/SnmpMibRequest.java +175 −0
  1333. java/pkg/com/sun/jmx/snmp/agent/SnmpMibRequestImpl.java +242 −0
  1334. java/pkg/com/sun/jmx/snmp/agent/SnmpMibSubRequest.java +209 −0
  1335. java/pkg/com/sun/jmx/snmp/agent/SnmpMibTable.java +2570 −0
  1336. java/pkg/com/sun/jmx/snmp/agent/SnmpRequestTree.java +1071 −0
  1337. java/pkg/com/sun/jmx/snmp/agent/SnmpStandardMetaServer.java +119 −0
  1338. java/pkg/com/sun/jmx/snmp/agent/SnmpStandardObjectServer.java +264 −0
  1339. java/pkg/com/sun/jmx/snmp/agent/SnmpTableCallbackHandler.java +76 −0
  1340. java/pkg/com/sun/jmx/snmp/agent/SnmpTableEntryFactory.java +91 −0
  1341. java/pkg/com/sun/jmx/snmp/agent/SnmpTableEntryNotification.java +141 −0
  1342. java/pkg/com/sun/jmx/snmp/agent/SnmpTableSupport.java +571 −0
  1343. java/pkg/com/sun/jmx/snmp/agent/SnmpUserDataFactory.java +124 −0
  1344. java/pkg/com/sun/jmx/snmp/agent/mkfile +32 −0
  1345. java/pkg/com/sun/jmx/snmp/agent/package.html +34 −0
  1346. java/pkg/com/sun/jmx/snmp/daemon/ClientHandler.java +133 −0
  1347. java/pkg/com/sun/jmx/snmp/daemon/CommunicationException.java +77 −0
  1348. java/pkg/com/sun/jmx/snmp/daemon/CommunicatorServer.java +1375 −0
  1349. java/pkg/com/sun/jmx/snmp/daemon/CommunicatorServerMBean.java +171 −0
  1350. java/pkg/com/sun/jmx/snmp/daemon/SnmpAdaptorServer.java +2659 −0
  1351. java/pkg/com/sun/jmx/snmp/daemon/SnmpAdaptorServerMBean.java +700 −0
  1352. java/pkg/com/sun/jmx/snmp/daemon/SnmpInformHandler.java +80 −0
  1353. java/pkg/com/sun/jmx/snmp/daemon/SnmpMibTree.java +269 −0
  1354. java/pkg/com/sun/jmx/snmp/daemon/SnmpRequestHandler.java +1152 −0
  1355. java/pkg/com/sun/jmx/snmp/daemon/SnmpSubBulkRequestHandler.java +345 −0
  1356. java/pkg/com/sun/jmx/snmp/daemon/SnmpSubNextRequestHandler.java +272 −0
  1357. java/pkg/com/sun/jmx/snmp/daemon/SnmpSubRequestHandler.java +630 −0
  1358. java/pkg/com/sun/jmx/snmp/daemon/mkfile +19 −0
  1359. java/pkg/com/sun/jmx/snmp/daemon/package.html +34 −0
  1360. java/pkg/com/sun/jmx/snmp/defaults/DefaultPaths.java +245 −0
  1361. java/pkg/com/sun/jmx/snmp/defaults/SnmpProperties.java +178 −0
  1362. java/pkg/com/sun/jmx/snmp/defaults/mkfile +9 −0
  1363. java/pkg/com/sun/jmx/snmp/defaults/package.html +34 −0
  1364. java/pkg/com/sun/jmx/snmp/internal/SnmpAccessControlModel.java +92 −0
  1365. java/pkg/com/sun/jmx/snmp/internal/SnmpAccessControlSubSystem.java +76 −0
  1366. java/pkg/com/sun/jmx/snmp/internal/SnmpDecryptedPdu.java +50 −0
  1367. java/pkg/com/sun/jmx/snmp/internal/SnmpEngineImpl.java +424 −0
  1368. java/pkg/com/sun/jmx/snmp/internal/SnmpIncomingRequest.java +164 −0
  1369. java/pkg/com/sun/jmx/snmp/internal/SnmpIncomingResponse.java +122 −0
  1370. java/pkg/com/sun/jmx/snmp/internal/SnmpLcd.java +136 −0
  1371. java/pkg/com/sun/jmx/snmp/internal/SnmpModel.java +44 −0
  1372. java/pkg/com/sun/jmx/snmp/internal/SnmpModelLcd.java +35 −0
  1373. java/pkg/com/sun/jmx/snmp/internal/SnmpMsgProcessingModel.java +147 −0
  1374. java/pkg/com/sun/jmx/snmp/internal/SnmpMsgProcessingSubSystem.java +162 −0
  1375. java/pkg/com/sun/jmx/snmp/internal/SnmpOutgoingRequest.java +88 −0
  1376. java/pkg/com/sun/jmx/snmp/internal/SnmpSecurityCache.java +34 −0
  1377. java/pkg/com/sun/jmx/snmp/internal/SnmpSecurityModel.java +176 −0
  1378. java/pkg/com/sun/jmx/snmp/internal/SnmpSecuritySubSystem.java +178 −0
  1379. java/pkg/com/sun/jmx/snmp/internal/SnmpSubSystem.java +73 −0
  1380. java/pkg/com/sun/jmx/snmp/internal/SnmpTools.java +125 −0
  1381. java/pkg/com/sun/jmx/snmp/internal/mkfile +24 −0
  1382. java/pkg/com/sun/jmx/snmp/internal/package.html +34 −0
  1383. java/pkg/com/sun/jmx/snmp/mkfile +69 −0
  1384. java/pkg/com/sun/jmx/snmp/mpm/SnmpMsgTranslator.java +92 −0
  1385. java/pkg/com/sun/jmx/snmp/mpm/mkfile +8 −0
  1386. java/pkg/com/sun/jmx/snmp/mpm/package.html +34 −0
  1387. java/pkg/com/sun/jmx/snmp/package.html +34 −0
  1388. java/pkg/com/sun/jmx/snmp/tasks/Task.java +67 −0
  1389. java/pkg/com/sun/jmx/snmp/tasks/TaskServer.java +57 −0
  1390. java/pkg/com/sun/jmx/snmp/tasks/ThreadService.java +246 −0
  1391. java/pkg/com/sun/jmx/snmp/tasks/mkfile +10 −0
  1392. java/pkg/com/sun/jmx/snmp/tasks/package.html +34 −0
  1393. java/pkg/com/sun/jndi/cosnaming/CNBindingEnumeration.java +236 −0
  1394. java/pkg/com/sun/jndi/cosnaming/CNCtx.java +1160 −0
  1395. java/pkg/com/sun/jndi/cosnaming/CNCtxFactory.java +51 −0
  1396. java/pkg/com/sun/jndi/cosnaming/CNNameParser.java +500 −0
  1397. java/pkg/com/sun/jndi/cosnaming/CorbanameUrl.java +128 −0
  1398. java/pkg/com/sun/jndi/cosnaming/ExceptionMapper.java +242 −0
  1399. java/pkg/com/sun/jndi/cosnaming/IiopUrl.java +223 −0
  1400. java/pkg/com/sun/jndi/cosnaming/OrbReuseTracker.java +70 −0
  1401. java/pkg/com/sun/jndi/cosnaming/RemoteToCorba.java +88 −0
  1402. java/pkg/com/sun/jndi/cosnaming/jndiprovider.properties +4 −0
  1403. java/pkg/com/sun/jndi/cosnaming/mkfile +16 −0
  1404. java/pkg/com/sun/jndi/dns/DnsClient.java +699 −0
  1405. java/pkg/com/sun/jndi/dns/DnsContext.java +1068 −0
  1406. java/pkg/com/sun/jndi/dns/DnsContextFactory.java +259 −0
  1407. java/pkg/com/sun/jndi/dns/DnsName.java +608 −0
  1408. java/pkg/com/sun/jndi/dns/DnsNameParser.java +55 −0
  1409. java/pkg/com/sun/jndi/dns/DnsUrl.java +119 −0
  1410. java/pkg/com/sun/jndi/dns/Header.java +126 −0
  1411. java/pkg/com/sun/jndi/dns/NameNode.java +156 −0
  1412. java/pkg/com/sun/jndi/dns/Resolver.java +192 −0
  1413. java/pkg/com/sun/jndi/dns/ResourceRecord.java +589 −0
  1414. java/pkg/com/sun/jndi/dns/ResourceRecords.java +140 −0
  1415. java/pkg/com/sun/jndi/dns/ZoneNode.java +205 −0
  1416. java/pkg/com/sun/jndi/dns/mkfile +19 −0
  1417. java/pkg/com/sun/jndi/ldap/BasicControl.class +0 −0
  1418. java/pkg/com/sun/jndi/ldap/BasicControl.java +118 −0
  1419. java/pkg/com/sun/jndi/ldap/Ber$DecodeException.class +0 −0
  1420. java/pkg/com/sun/jndi/ldap/Ber$EncodeException.class +0 −0
  1421. java/pkg/com/sun/jndi/ldap/Ber.class +0 −0
  1422. java/pkg/com/sun/jndi/ldap/Ber.java +107 −0
  1423. java/pkg/com/sun/jndi/ldap/BerDecoder.class +0 −0
java/pkg/NOTICE+1−0
@@ -0,0 +1 @@
1All the *.java files here belong to OpenJDK version 1.7, see http://openjdk.java.net/
java/pkg/awt/awt_Color.b+338−0
@@ -0,0 +1,338 @@
1#
2# %W% - %E%
3#
4
5implement AwtColor;
6
7include "jni.m";
8 jni : JNI;
9 ClassModule,
10 JString,
11 JArray,
12 JArrayI,
13 JArrayC,
14 JArrayB,
15 JArrayS,
16 JArrayJ,
17 JArrayF,
18 JArrayD,
19 JArrayZ,
20 JArrayJObject,
21 JArrayJClass,
22 JArrayJString,
23 JClass,
24 JThread,
25 Value,
26 sys,
27 FALSE,
28 JObject : import jni;
29
30 draw: Draw;
31 Context, Display, Image: import draw;
32
33include "java/lang/ClassLoader_L.m";
34include "awt_Color.m";
35
36ctxt : ref Context;
37systemcolors_file := "/java/lib/systemcolor.properties";
38
39rgbvmap := array[3*256] of {
40 byte 255,byte 255,byte 255, byte 255,byte 255,byte 170,
41 byte 255,byte 255,byte 85, byte 255,byte 255,byte 0,
42 byte 255,byte 170,byte 255, byte 255,byte 170,byte 170,
43 byte 255,byte 170,byte 85, byte 255,byte 170,byte 0,
44 byte 255,byte 85,byte 255, byte 255,byte 85,byte 170,
45 byte 255,byte 85,byte 85, byte 255,byte 85,byte 0,
46 byte 255,byte 0,byte 255, byte 255,byte 0,byte 170,
47 byte 255,byte 0,byte 85, byte 255,byte 0,byte 0,
48 byte 238,byte 0,byte 0, byte 238,byte 238,byte 238,
49 byte 238,byte 238,byte 158, byte 238,byte 238,byte 79,
50 byte 238,byte 238,byte 0, byte 238,byte 158,byte 238,
51 byte 238,byte 158,byte 158, byte 238,byte 158,byte 79,
52 byte 238,byte 158,byte 0, byte 238,byte 79,byte 238,
53 byte 238,byte 79,byte 158, byte 238,byte 79,byte 79,
54 byte 238,byte 79,byte 0, byte 238,byte 0,byte 238,
55 byte 238,byte 0,byte 158, byte 238,byte 0,byte 79,
56 byte 221,byte 0,byte 73, byte 221,byte 0,byte 0,
57 byte 221,byte 221,byte 221, byte 221,byte 221,byte 147,
58 byte 221,byte 221,byte 73, byte 221,byte 221,byte 0,
59 byte 221,byte 147,byte 221, byte 221,byte 147,byte 147,
60 byte 221,byte 147,byte 73, byte 221,byte 147,byte 0,
61 byte 221,byte 73,byte 221, byte 221,byte 73,byte 147,
62 byte 221,byte 73,byte 73, byte 221,byte 73,byte 0,
63 byte 221,byte 0,byte 221, byte 221,byte 0,byte 147,
64 byte 204,byte 0,byte 136, byte 204,byte 0,byte 68,
65 byte 204,byte 0,byte 0, byte 204,byte 204,byte 204,
66 byte 204,byte 204,byte 136, byte 204,byte 204,byte 68,
67 byte 204,byte 204,byte 0, byte 204,byte 136,byte 204,
68 byte 204,byte 136,byte 136, byte 204,byte 136,byte 68,
69 byte 204,byte 136,byte 0, byte 204,byte 68,byte 204,
70 byte 204,byte 68,byte 136, byte 204,byte 68,byte 68,
71 byte 204,byte 68,byte 0, byte 204,byte 0,byte 204,
72 byte 170,byte 255,byte 170, byte 170,byte 255,byte 85,
73 byte 170,byte 255,byte 0, byte 170,byte 170,byte 255,
74 byte 187,byte 187,byte 187, byte 187,byte 187,byte 93,
75 byte 187,byte 187,byte 0, byte 170,byte 85,byte 255,
76 byte 187,byte 93,byte 187, byte 187,byte 93,byte 93,
77 byte 187,byte 93,byte 0, byte 170,byte 0,byte 255,
78 byte 187,byte 0,byte 187, byte 187,byte 0,byte 93,
79 byte 187,byte 0,byte 0, byte 170,byte 255,byte 255,
80 byte 158,byte 238,byte 238, byte 158,byte 238,byte 158,
81 byte 158,byte 238,byte 79, byte 158,byte 238,byte 0,
82 byte 158,byte 158,byte 238, byte 170,byte 170,byte 170,
83 byte 170,byte 170,byte 85, byte 170,byte 170,byte 0,
84 byte 158,byte 79,byte 238, byte 170,byte 85,byte 170,
85 byte 170,byte 85,byte 85, byte 170,byte 85,byte 0,
86 byte 158,byte 0,byte 238, byte 170,byte 0,byte 170,
87 byte 170,byte 0,byte 85, byte 170,byte 0,byte 0,
88 byte 153,byte 0,byte 0, byte 147,byte 221,byte 221,
89 byte 147,byte 221,byte 147, byte 147,byte 221,byte 73,
90 byte 147,byte 221,byte 0, byte 147,byte 147,byte 221,
91 byte 153,byte 153,byte 153, byte 153,byte 153,byte 76,
92 byte 153,byte 153,byte 0, byte 147,byte 73,byte 221,
93 byte 153,byte 76,byte 153, byte 153,byte 76,byte 76,
94 byte 153,byte 76,byte 0, byte 147,byte 0,byte 221,
95 byte 153,byte 0,byte 153, byte 153,byte 0,byte 76,
96 byte 136,byte 0,byte 68, byte 136,byte 0,byte 0,
97 byte 136,byte 204,byte 204, byte 136,byte 204,byte 136,
98 byte 136,byte 204,byte 68, byte 136,byte 204,byte 0,
99 byte 136,byte 136,byte 204, byte 136,byte 136,byte 136,
100 byte 136,byte 136,byte 68, byte 136,byte 136,byte 0,
101 byte 136,byte 68,byte 204, byte 136,byte 68,byte 136,
102 byte 136,byte 68,byte 68, byte 136,byte 68,byte 0,
103 byte 136,byte 0,byte 204, byte 136,byte 0,byte 136,
104 byte 85,byte 255,byte 85, byte 85,byte 255,byte 0,
105 byte 85,byte 170,byte 255, byte 93,byte 187,byte 187,
106 byte 93,byte 187,byte 93, byte 93,byte 187,byte 0,
107 byte 85,byte 85,byte 255, byte 93,byte 93,byte 187,
108 byte 119,byte 119,byte 119, byte 119,byte 119,byte 0,
109 byte 85,byte 0,byte 255, byte 93,byte 0,byte 187,
110 byte 119,byte 0,byte 119, byte 119,byte 0,byte 0,
111 byte 85,byte 255,byte 255, byte 85,byte 255,byte 170,
112 byte 79,byte 238,byte 158, byte 79,byte 238,byte 79,
113 byte 79,byte 238,byte 0, byte 79,byte 158,byte 238,
114 byte 85,byte 170,byte 170, byte 85,byte 170,byte 85,
115 byte 85,byte 170,byte 0, byte 79,byte 79,byte 238,
116 byte 85,byte 85,byte 170, byte 102,byte 102,byte 102,
117 byte 102,byte 102,byte 0, byte 79,byte 0,byte 238,
118 byte 85,byte 0,byte 170, byte 102,byte 0,byte 102,
119 byte 102,byte 0,byte 0, byte 79,byte 238,byte 238,
120 byte 73,byte 221,byte 221, byte 73,byte 221,byte 147,
121 byte 73,byte 221,byte 73, byte 73,byte 221,byte 0,
122 byte 73,byte 147,byte 221, byte 76,byte 153,byte 153,
123 byte 76,byte 153,byte 76, byte 76,byte 153,byte 0,
124 byte 73,byte 73,byte 221, byte 76,byte 76,byte 153,
125 byte 85,byte 85,byte 85, byte 85,byte 85,byte 0,
126 byte 73,byte 0,byte 221, byte 76,byte 0,byte 153,
127 byte 85,byte 0,byte 85, byte 85,byte 0,byte 0,
128 byte 68,byte 0,byte 0, byte 68,byte 204,byte 204,
129 byte 68,byte 204,byte 136, byte 68,byte 204,byte 68,
130 byte 68,byte 204,byte 0, byte 68,byte 136,byte 204,
131 byte 68,byte 136,byte 136, byte 68,byte 136,byte 68,
132 byte 68,byte 136,byte 0, byte 68,byte 68,byte 204,
133 byte 68,byte 68,byte 136, byte 68,byte 68,byte 68,
134 byte 68,byte 68,byte 0, byte 68,byte 0,byte 204,
135 byte 68,byte 0,byte 136, byte 68,byte 0,byte 68,
136 byte 0,byte 255,byte 0, byte 0,byte 170,byte 255,
137 byte 0,byte 187,byte 187, byte 0,byte 187,byte 93,
138 byte 0,byte 187,byte 0, byte 0,byte 85,byte 255,
139 byte 0,byte 93,byte 187, byte 0,byte 119,byte 119,
140 byte 0,byte 119,byte 0, byte 0,byte 0,byte 255,
141 byte 0,byte 0,byte 187, byte 0,byte 0,byte 119,
142 byte 51,byte 51,byte 51, byte 0,byte 255,byte 255,
143 byte 0,byte 255,byte 170, byte 0,byte 255,byte 85,
144 byte 0,byte 238,byte 79, byte 0,byte 238,byte 0,
145 byte 0,byte 158,byte 238, byte 0,byte 170,byte 170,
146 byte 0,byte 170,byte 85, byte 0,byte 170,byte 0,
147 byte 0,byte 79,byte 238, byte 0,byte 85,byte 170,
148 byte 0,byte 102,byte 102, byte 0,byte 102,byte 0,
149 byte 0,byte 0,byte 238, byte 0,byte 0,byte 170,
150 byte 0,byte 0,byte 102, byte 34,byte 34,byte 34,
151 byte 0,byte 238,byte 238, byte 0,byte 238,byte 158,
152 byte 0,byte 221,byte 147, byte 0,byte 221,byte 73,
153 byte 0,byte 221,byte 0, byte 0,byte 147,byte 221,
154 byte 0,byte 153,byte 153, byte 0,byte 153,byte 76,
155 byte 0,byte 153,byte 0, byte 0,byte 73,byte 221,
156 byte 0,byte 76,byte 153, byte 0,byte 85,byte 85,
157 byte 0,byte 85,byte 0, byte 0,byte 0,byte 221,
158 byte 0,byte 0,byte 153, byte 0,byte 0,byte 85,
159 byte 17,byte 17,byte 17, byte 0,byte 221,byte 221,
160 byte 0,byte 204,byte 204, byte 0,byte 204,byte 136,
161 byte 0,byte 204,byte 68, byte 0,byte 204,byte 0,
162 byte 0,byte 136,byte 204, byte 0,byte 136,byte 136,
163 byte 0,byte 136,byte 68, byte 0,byte 136,byte 0,
164 byte 0,byte 68,byte 204, byte 0,byte 68,byte 136,
165 byte 0,byte 68,byte 68, byte 0,byte 68,byte 0,
166 byte 0,byte 0,byte 204, byte 0,byte 0,byte 136,
167 byte 0,byte 0,byte 68, byte 0,byte 0,byte 0,
168};
169
170modinit(jni_p : JNI)
171{
172 if (ctxt != nil)
173 return;
174
175 jni = jni_p;
176 sys = jni->sys;
177 ctxt = jni->getContext();
178 if (ctxt == nil)
179 jni->ThrowException("java.awt.AWTError", "can't get Draw Context");
180 draw = load Draw Draw->PATH;
181
182}
183
184getColor(jni_p: JNI, c: JObject) : ref Image
185{
186 modinit(jni_p);
187
188 cm_index := getColorIndex(jni_p, c);
189 # (red, green, blue) := ctxt.display.cmap2rgb(cm_index);
190 # sys->print("Inferno color: red=%d, green=%d, blue=%d\n", red, green, blue);
191 col := ctxt.display.color(cm_index);
192 return col;
193}
194
195getColorIndex(jni_p: JNI, c: JObject) : int
196{
197 modinit(jni_p);
198
199 if (c == nil) {
200 sys->print("getColorIndex: null Color object\n");
201 return 0;
202 }
203
204 val := jni->GetObjField( c, "pData", "I" );
205 if ( val == nil )
206 sys->print( "getColorIndex: Couldn't get pData field from color object.\n" );
207 else {
208 pdata := val.Int();
209 if (pdata != 0) {
210 # sys->print("Using pData. pData = %d\n", pdata);
211 return pdata - 1;
212 }
213 }
214
215 (ret, err) := jni->CallMethod(c, "getRGB", "()I", nil);
216 if (err != jni->OK)
217 jni->FatalError("awt_Color couldn't get RGB values of color");
218
219 rgb := ret.Int();
220 r := (rgb >> 16) & 255;
221 g := (rgb >> 8) & 255;
222 b := (rgb >> 0) & 255;
223 cm_index := ctxt.display.rgb2cmap(r,g,b);
224 # sys->print( "rgb: %d\n", rgb);
225 # sys->print( "red: %d; green: %d; blue %d\n", r, g, b);
226 # sys->print("Color map index is %d.\n", cm_index);
227
228 # sys->print("Setting pData to %d\n", cm_index+1);
229 val = ref Value.TInt(cm_index+1);
230 err = jni->SetObjField( c, "pData", val );
231 if (err != jni->OK)
232 sys->print("getColorIndex: Couldn't set Color pData field\n");
233
234 return cm_index;
235}
236
237makeColorModel(jni_p: JNI, bits: int) : JObject
238{
239 modinit(jni_p);
240
241 cast := jni->CastMod();
242 jbary := jni->MkAByte(rgbvmap);
243 arraylen := len jbary.ary;
244 # sys->print("makeColorModel: Array length is %d.\n", arraylen);
245
246 args := array[5] of ref Value;
247 args[0] = ref Value.TInt(bits);
248 args[1] = ref Value.TInt(256);
249 args[2] = ref Value.TObject(cast->FromJArray(cast->ByteToJArray(jbary)));
250 args[3] = ref Value.TInt(0);
251 args[4] = ref Value.TBoolean(jni->FALSE);
252
253 cl_data := jni->FindClass("java/awt/image/IndexColorModel");
254 if (cl_data == nil)
255 jni->FatalError("awt_Color couldn't load java/awt/image/IndexColorModel");
256 jobj := jni->AllocObject(cl_data);
257 (ret, err) := jni->CallMethod(jobj, "<init>", "(II[BIZ)V", args);
258
259 if (err != jni->OK)
260 jni->FatalError("awt_Color couldn't create IndexColorModel");
261
262 system_flag := ref Value.TInt(1);
263 err = jni->SetObjField( jobj, "pData", system_flag );
264 if (err != jni->OK)
265 sys->print("makeColorModel: Couldn't set ColorModel pData field to 1\n");
266
267 return jobj;
268}
269
270
271loadSystemColors(jni_p: JNI, systemColors: JArrayI)
272{
273 val : ref Value;
274
275 modinit(jni_p);
276
277 cl := jni->GetClassObject(jni->FindClass("java/awt/SystemColor"));
278 if (cl == nil)
279 jni->FatalError("iToolkit_L couldn't load java/awt/SystemColor");
280 val = jni->GetStaticField( cl.class, "NUM_COLORS", "I" );
281 if ( val == nil ) {
282 sys->print( "loadSystemColors: Couldn't get NUM_COLORS field from SystemColor class.\n" );
283 return;
284 }
285
286 num_colors := val.Int();
287 # sys->print("Using GetStaticField: NUM_COLORS = %d\n", num_colors);
288
289 lines := readfile(systemcolors_file);
290 if (lines == nil) {
291 sys->print( "loadSystemColors: Couldn't read %s\n", systemcolors_file);
292 return;
293 }
294 for(; lines != nil; lines = tl lines) {
295 line := hd lines;
296 (n, l) := sys->tokenize(line, " \t=");
297 if (n < 2 || line[0] == '#')
298 continue;
299 key := hd l;
300 line = hd tl l;
301 (n, l) = sys->tokenize(line, ";");
302 if (n != 3)
303 continue;
304 r := int hd l;
305 g := int hd tl l;
306 b := int hd tl tl l;
307 # sys->print(" key = %s: r = %d; g = %d; b = %d\n", key, r, g, b);
308 val = jni->GetStaticField( cl.class, key, "I" );
309 if ( val == nil )
310 continue;
311 index := val.Int();
312 color := (255 << 24) | ((r & 255) << 16) | ((g & 255) << 8) | ((b & 255) << 0);
313 systemColors.ary[index] = color;
314 }
315
316 return;
317}
318
319
320# read a file and return its lines as a list of strings
321readfile(filename: string) : list of string
322{
323 fd := sys->open(filename, sys->OREAD);
324 if(fd != nil) {
325 (n, dir) := sys->fstat(fd);
326 if(n < 0)
327 return nil; # shouldn't happen
328 buf := array[dir.length] of byte;
329 n = sys->read(fd, buf, dir.length);
330 if(n == dir.length) {
331 (nil, linelist) := sys->tokenize(string buf[0:n], "\r\n");
332 return linelist;
333 }
334 }
335 return nil;
336}
337
338
java/pkg/awt/awt_Color.m+13−0
@@ -0,0 +1,13 @@
1#
2# %W% - %E%
3#
4
5AwtColor : module
6{
7 PATH : con "/dis/java/inferno/awt/awt_Color.dis";
8
9 getColor : fn(jni: JNI, c: JObject) : ref Image;
10 getColorIndex : fn(jni: JNI, c: JObject) : int;
11 makeColorModel : fn(jni: JNI, bits: int) : JObject;
12 loadSystemColors : fn(jni: JNI, systemColors: JArrayI);
13};
java/pkg/awt/awt_Frame.b+250−0
@@ -0,0 +1,250 @@
1#
2# %W% - %E%
3#
4
5implement FrameManager;
6
7include "sys.m";
8 sys: Sys;
9
10include "string.m";
11 str: String;
12
13include "draw.m";
14 draw: Draw;
15 Context, Display, Point, Rect, Image, Screen: import draw;
16
17include "tk.m";
18 tk: Tk;
19 Toplevel: import tk;
20
21include "wmlib.m";
22 wmlib: Wmlib;
23
24include "awt_Frame.m";
25
26screen: ref Screen;
27display: ref Display;
28ones: ref Image;
29white: ref Image;
30nochan: chan of string;
31tHeight : int;
32bWidth: int;
33
34win_cfg := array[] of {
35 "canvas .c -height 306 -width 406",
36 "pack .c -side bottom -fill both -expand 1",
37# ".c configure -side bottom -fill both -expand 1",
38 "pack propagate . 0",
39};
40
41win_bind := array[] of {
42 "bind # <Motion> {send butt m %b %X %Y}",
43 "bind # <Leave> {send butt Leave}",
44# "bind # <ButtonPress> {focus #; send foc focus; send butt p %b %X %Y}",
45 "bind # <ButtonPress> {focus #; send butt p %b %X %Y}",
46 "bind # <ButtonRelease> {send butt r %b %X %Y}",
47 "bind # <Double-Button> {send butt d %b %X %Y}",
48 "bind # <Enter> {send butt Enter}",
49 "bind # <KeyPress> {send key %K}",
50# "bind . <FocusIn> {send foc focus}",
51# "bind .Wm_t <Button-1> +{focus #; send foc focus}",
52 "bind .Wm_t <Button-1> +{focus #}",
53# "bind .Wm_t.title <Button-1> +{focus #; send foc focus}",
54 "bind .Wm_t.title <Button-1> +{focus #}",
55};
56
57modinit(ctxt: ref Context)
58{
59 if (sys != nil)
60 return;
61
62 sys = load Sys Sys->PATH;
63 str = load String String->PATH;
64 draw = load Draw Draw->PATH;
65 tk = load Tk Tk->PATH;
66 wmlib = load Wmlib Wmlib->PATH;
67 nochan = chan of string;
68
69 display = ctxt.display;
70 screen = ctxt.screen;
71 ones = display.ones;
72 white = display.color(Draw->White);
73
74 wmlib->init();
75}
76showwin(cv : ref Canvas)
77{
78 tk->cmd(cv.top, "pack " + cv.canvas);
79}
80makewin(ctxt: ref Context, title: string, x, y, width, height: int): ref Canvas
81{
82 modinit(ctxt);
83 where := "-x " + string x + " -y " + string y;
84 (t, menu) := wmlib->titlebar(screen, where, title, Wmlib->Appl);
85
86# calculate topInset and boardwidth
87 bWidth = int tk->cmd(t, ". cget -bd");
88 tHeight = int tk->cmd(t, ". cget -height");
89
90
91
92 if (width > 0 && height > 0)
93 win_cfg[0] = "canvas .c -height " + string (height - tHeight - bWidth) +
94 " -width " + string (width - 2*bWidth);
95
96# win_cfg[0] = "canvas .c -height " + string height + " -width " + string width;
97
98 wmlib->tkcmds(t, win_cfg);
99 return alloccanvas(t, ctxt, ".c", menu);
100}
101
102resizewin(cv: ref Canvas, x, y, width, height : int)
103{
104}
105
106alloccanvas(t: ref Toplevel, ctxt: ref Draw->Context, canvas: string, menu: chan of string): ref Canvas
107{
108 cmd := chan of string;
109 tk->namechan(t, cmd, "cmd");
110 butt := chan of string;
111 tk->namechan(t, butt, "butt");
112# mouse := chan of string;
113# tk->namechan(t, mouse, "mouse");
114
115 key := chan of string;
116 tk->namechan(t, key, "key");
117
118 foc := chan of string;
119 tk->namechan(t, foc, "foc");
120
121 tk->cmd(t, "bind . <Configure> {send cmd resize}");
122 tk->cmd(t, "bind . <Map> {send cmd map}");
123
124 for (i := 0; i < len win_bind; i++)
125 tk->cmd(t, expand(win_bind[i], canvas));
126
127 tk->cmd(t, "update");
128
129 c := ref Canvas;
130 display = ctxt.display;
131 c.image = display.image;
132 c.rect = canvposn(t, canvas);
133 c.buf = display.newimage(c.image.r, c.image.ldepth , 0, Draw->White);
134 c.events = chan of ref Event;
135 c.top = t;
136 c.ctxt = ctxt;
137 c.canvas = canvas;
138 c.pid = sys->pctl(0, nil);
139
140# calculate topInset and boardwidth
141 y1 := int tk->cmd(t, ". cget -acty") + int tk->cmd(t, ".dy get");
142 y2 := int tk->cmd(t, ".c cget -acty") + int tk->cmd(t, ".dy get");
143
144# tHeight = int tk->cmd(t, ".Wm_t cget -actheight");
145 tHeight = y2 - y1;
146 bWidth = int tk->cmd(t, ". cget -bd");
147
148 paint(c, c_canvposn(t, canvas));
149 spawn handler(c, menu, cmd, butt, key, foc);
150 return c;
151}
152
153hidewin(c: ref Canvas)
154{
155 tk->cmd(c.top, "pack forget " + c.canvas);
156}
157
158handler(c: ref Canvas, menu, cmd, butt, key, foc: chan of string)
159{
160 detail: string;
161 t := c.top;
162 if (menu == nil)
163 menu = nochan;
164 for (;;) alt {
165 detail = <- menu =>
166 case detail {
167 "exit" =>
168 c.events <- = ref Event(Event.Shutdown, nil);
169 "task" =>
170 c.events <- = ref Event(Event.Icon, nil);
171# "move" =>
172# sys->print("===== moving \n");
173 * =>
174 ;
175 }
176 wmlib->titlectl(c.top, detail);
177
178 detail = <- cmd =>
179 (n, word) := sys->tokenize(detail, " ");
180 case hd word {
181 "resize" or "map" =>
182 c.rect = canvposn(t, c.canvas);
183 paint(c, c_canvposn(t, c.canvas));
184 e := Event.Resize;
185 if (hd word == "map") {
186 e = Event.DeIcon;
187 tk->cmd(t, "focus " + c.canvas);
188 }
189 c.events <- = ref Event(e, nil);
190 * =>
191 ;
192 }
193 detail = <- butt =>
194
195 c.events <- = ref Event(Event.Button, detail);
196 detail = <- key =>
197 c.events <- = ref Event(Event.Key, detail);
198# detail = <- foc =>
199# c.events <- = ref Event(Event.Focus, detail);
200
201 }
202}
203
204expand(cmd, canvas: string): string
205{
206 s: string;
207 for (;;) {
208 (l, r) := str->splitl(cmd, "#");
209 s = s + l;
210 if (r == nil)
211 return s;
212 s = s + canvas;
213 cmd = r[1:];
214 }
215}
216
217paint(c: ref Canvas, r: Rect)
218{
219 c.image.draw(r, white, ones, (0, 0));
220}
221
222c_canvposn(t: ref Toplevel, c: string): Rect
223{
224 r: Rect;
225
226 r.min.x = int tk->cmd(t, c + " cget -actx") + int tk->cmd(t, ".dx get");
227 r.min.y = int tk->cmd(t, c + " cget -acty") + int tk->cmd(t, ".dy get");
228 r.max.x = r.min.x + int tk->cmd(t, c + " cget -actwidth") + int tk->cmd(t, ".dw get");
229 r.max.y = r.min.y + int tk->cmd(t, c + " cget -actheight") + int tk->cmd(t, ".dh get");
230 return r;
231}
232canvposn(t: ref Toplevel, c: string): Rect
233{
234 r: Rect;
235
236 r.min.x = int tk->cmd(t, ". cget -actx") + int tk->cmd(t, ".dx get");
237 r.min.y = int tk->cmd(t, ". cget -acty") + int tk->cmd(t, ".dy get");
238 r.max.x = r.min.x + int tk->cmd(t, ". cget -actwidth") + int tk->cmd(t, ".dw get");
239 r.max.y = r.min.y + int tk->cmd(t, ". cget -actheight") + int tk->cmd(t, ".dh get");
240 return r;
241}
242getInsets(): (int, int)
243{
244 return (bWidth, tHeight);
245}
246
247mapCanvas(dimg : ref Image, wimg : ref Image)
248{
249 dimg.draw(dimg.r, wimg, ones, dimg.r.min);
250}
java/pkg/awt/awt_Frame.m+46−0
@@ -0,0 +1,46 @@
1#
2# %W% - %E%
3#
4
5FrameManager: module
6{
7 PATH: con "/dis/java/inferno/awt/awt_Frame.dis";
8
9 Event: adt
10 {
11 event: int;
12 detail: string;
13
14 Button, Key,
15 Icon, DeIcon,
16 Resize, Shutdown, Focus
17 : con iota;
18 };
19
20 Attr: adt
21 {
22 origin: Draw->Point;
23 dims: Draw->Point;
24 };
25
26 Canvas: adt
27 {
28 # interface
29 image: ref Draw->Image;
30 buf: ref Draw->Image;
31 rect: Draw->Rect;
32 events: chan of ref Event;
33 attr: ref Attr;
34 # implementation
35 ctxt : ref Draw->Context;
36 top: ref Tk->Toplevel;
37 canvas: string;
38 pid: int;
39 };
40
41 makewin: fn(ctxt: ref Draw->Context, title: string, x, y, width, height: int): ref Canvas;
42 resizewin: fn(cv: ref Canvas, x, y, width, height : int);
43 hidewin: fn(c: ref Canvas);
44 getInsets: fn(): (int, int);
45 mapCanvas : fn(dimg : ref Draw->Image, wimg : ref Draw->Image);
46};
java/pkg/awt/awt_Graphics.b+209−0
@@ -0,0 +1,209 @@
1#
2# %W% - %E%
3#
4implement AwtGraphics;
5
6include "sys.m";
7 sys : Sys;
8
9include "draw.m";
10 draw: Draw;
11 Screen, Display, Rect, Font, Point, Image: import draw;
12
13include "math.m";
14 math: Math;
15 Pi, atan, tan: import math;
16
17disp : ref Display;
18wimg, dimg, white, ones, icolor : ref Image;
19
20include "awt_Graphics.m";
21
22init(img : ref Image, bufimg : ref Image){
23 sys = load Sys Sys->PATH;
24 draw = load Draw Draw->PATH;
25 math = load Math Math->PATH;
26 dimg = img;
27 wimg = bufimg;
28 disp = wimg.display;
29 ones = disp.ones;
30 icolor = disp.color(Draw->White);
31 white = disp.color(Draw->White);
32}
33
34undoClip()
35{
36 wimg.clipr = wimg.r;
37}
38
39dispose()
40{
41 dimg = nil;
42 wimg = nil;
43}
44setForeground(p0, p1, p2 : int)
45{
46 icolor = disp.rgb(p0, p1, p2);
47}
48
49changeClip(p0, p1, p2, p3 : int)
50{
51# sys->print("=== Change Cliping Area\n");
52 wimg.clipr = ((p0, p1), (p0 + p2 - 1, p1 + p3 -1));
53}
54
55clearRect( p0 : int,p1 : int,p2 : int,p3 : int)
56{
57 r := ((p0, p1), (p0 + p2 - 1, p1 + p3 - 1));
58 wimg.draw(r, white, ones, (0, 0));
59}
60
61fillRect(ply: array of Point)
62{
63 wimg.fillpoly(ply, 1, icolor, ply[0]);
64}
65
66drawRect(ply: array of Point)
67{
68 wimg.poly(ply, 0, 0, 0, icolor, ply[0]);
69}
70
71drawStringWidth(txt : string, sp : Point, font : ref Font) : int
72{
73 ep := wimg.text(sp, icolor, sp, font, txt);
74 return(ep.x-sp.x);
75
76}
77
78drawLine(sp, ep : Point)
79{
80 wimg.line(sp, ep, 0, 0, 0, icolor, sp);
81}
82
83genDraw(r : Rect, data : array of byte)
84{
85 wimg.writepixels(r, data);
86}
87
88copyArea(rect0, rect1 : Draw->Rect, data : array of byte)
89{
90 wimg.readpixels(rect0, data);
91 wimg.writepixels(rect1, data);
92}
93
94drawRoundRect(p0 : int,p1 : int,p2 : int,p3 : int,p4 : int,p5 : int)
95{
96}
97
98fillRoundRect(p0 : int,p1 : int,p2 : int,p3 : int,p4 : int,p5 : int)
99{
100}
101
102drawPolygon(ply : array of Point)
103{
104 wimg.poly(ply, 0, 0, 0, icolor, icolor.r.min);
105}
106
107drawPolyline(ply : array of Point)
108{
109 wimg.poly(ply, 0, 0, 0, icolor, icolor.r.min);
110}
111
112fillPolygon(ply : array of Point)
113{
114 wimg.fillpoly(ply, 1, icolor, icolor.r.min);
115}
116
117drawOval(p : Point, p2 : int,p3 : int)
118{
119 p.x += p2 / 2;
120 p.y += p3 / 2;
121 wimg.ellipse(p, p2/2, p3/2, 0, icolor, p);
122}
123
124fillOval(p: Point, p2 : int,p3 : int)
125{
126 p.x += p2 / 2;
127 p.y += p3 / 2;
128 wimg.fillellipse(p, p2/2, p3/2, icolor, p);
129}
130
131drawArc(p : Point, p2 : int,p3 : int,p4 : int,p5 : int)
132{
133 p.x += p2 / 2;
134 p.y += p3 / 2;
135 (p4, p5) = adjustArcAngles(p2, p3, p4, p5);
136 wimg.arc(p, p2/2, p3/2, 0, icolor, p, p4, p5);
137}
138
139fillArc(p : Point, p2 : int,p3 : int,p4 : int,p5 : int)
140{
141 p.x += p2 / 2;
142 p.y += p3 / 2;
143 (p4, p5) = adjustArcAngles(p2, p3, p4, p5);
144 wimg.fillarc(p, p2/2, p3/2, icolor, p, p4, p5);
145}
146
147adjustArcAngles(w, h, start, arc: int): (int, int)
148{
149 laps, end: int;
150
151 if (arc >= 360 || arc <= -360) {
152 start = 0;
153 arc = 360;
154 } else
155 start = start % 360;
156
157 if (w != h && arc != 0 && arc != 360) {
158 laps = (start + arc) / 360;
159 end = (start + arc) % 360;
160 start = skewAngle(w, h, start);
161 end = skewAngle(w, h, end);
162 arc = end - start + (laps * 360);
163 }
164 return (start, arc);
165}
166
167skewAngle(width, height, angle: int): int
168{
169 if (width == 0 || height == 0)
170 return angle;
171
172 normAngle := real angle * (2.0 * Pi) / 360.0;
173
174 w := real width;
175 h := real height;
176 skewedAngle := h/w * tan(normAngle);
177 skewedAngle = atan(skewedAngle);
178
179 if (normAngle > 1.5 * Pi)
180 skewedAngle += 2.0 * Pi;
181 else if (normAngle > 0.5 * Pi)
182 skewedAngle += Pi;
183 else if (normAngle < -1.5 * Pi)
184 skewedAngle -= 2.0 * Pi;
185 else if (normAngle < -0.5 * Pi)
186 skewedAngle -= Pi;
187
188 skewedAngle = skewedAngle * 360.0 / (2.0 * Pi);
189 return int skewedAngle;
190}
191
192sendToDisplay(r : Draw->Rect)
193{
194# if (dimg == nil)
195# sys->print("on screen image is nil\n");
196# else
197 if (dimg != nil)
198 {
199 wimg.clipr=r;
200 dimg.draw(r, wimg, ones, r.min);
201# dimg.draw(dimg.r, wimg, ones, dimg.r.min);
202 }
203}
204
205getDC(img: ref Draw->Image, bufimg : ref Draw->Image)
206{
207 dimg = img;
208}
209
java/pkg/awt/awt_Graphics.m+43−0
@@ -0,0 +1,43 @@
1#
2# %W% - %E%
3#
4AwtGraphics : module
5{
6 PATH : con "/dis/java/inferno/awt/awt_Graphics.dis";
7
8 init : fn(img : ref Draw->Image, bufimg: ref Draw->Image);
9
10 dispose : fn();
11 setForeground : fn(r, g, b : int);
12 changeClip : fn(p0, p1, p2, p3 : int);
13
14# removeClip : fn();
15 clearRect : fn( p0 : int,p1 : int,p2 : int,p3 : int);
16
17 fillRect : fn(ply: array of Draw->Point);
18 drawRect : fn(ply: array of Draw->Point);
19
20 drawStringWidth: fn(txt : string, sp : Draw->Point, font : ref Draw->Font) : int;
21 drawLine : fn(sp, ep : Draw->Point);
22
23 genDraw : fn(r : Draw->Rect, img : array of byte);
24
25 copyArea : fn(rect0, rect1 : Draw->Rect, data : array of byte);
26
27 drawRoundRect: fn(p0 : int,p1 : int,p2 : int,p3 : int,p4 : int,p5 : int);
28
29 fillRoundRect: fn(p0 : int,p1 : int,p2 : int,p3 : int,p4 : int,p5 : int);
30
31 drawPolygon : fn(ply : array of Draw->Point);
32 drawPolyline: fn(ply : array of Draw->Point);
33 fillPolygon : fn(ply : array of Draw->Point);
34 drawOval : fn(p : Draw->Point, p2 : int,p3 : int);
35
36 fillOval : fn(p: Draw->Point, p2 : int,p3 : int);
37
38 drawArc : fn(p : Draw->Point, p2 : int,p3 : int,p4 : int,p5 : int);
39
40 fillArc : fn(p : Draw->Point, p2 : int,p3 : int,p4 : int,p5 : int);
41 sendToDisplay : fn(r : Draw->Rect);
42 getDC : fn(img: ref Draw->Image, bufimg : ref Draw->Image);
43};
java/pkg/awt/awt_Image.m+36−0
@@ -0,0 +1,36 @@
1AwtImage : module
2{
3 PATH : con "/dis/java/inferno/awt/awt_Image.dis";
4
5 #
6 # Inferno rep of manifest constants defined in
7 # java.awt.image.ImageObserver (hope they don't change
8 # in javaland).
9 ImO_WIDTH: con 1;
10 ImO_HEIGHT: con 2;
11 ImO_PROPERTIES: con 4;
12 ImO_SOMEBITS: con 8;
13 ImO_FRAMEBITS: con 16;
14 ImO_ALLBITS: con 32;
15 ImO_ERROR: con 64;
16 ImO_ABORT: con 128;
17
18 #
19 # Inferno rep of pixel delivery hints from
20 # java.awt.image.ImageConsumer.
21 #
22 ImC_RANDOMPIXELORDER: con 1;
23 ImC_TOPDOWNLEFTRIGHT: con 2;
24 ImC_COMPLETESCANLINES: con 4;
25 ImC_SINGLEPASS: con 8;
26 ImC_SINGLEFRAME: con 16;
27
28 #
29 # Inferno rep of imageComplete status bits
30 # java.awt.image.ImageConsumer.
31 #
32 ImC_IMAGEERROR: con 1;
33 ImC_SINGLFRAMEDONE: con 2;
34 ImC_STATICIMAGEDONE: con 3;
35 ImC_IMAGEABORTED: con 4;
36};
java/pkg/awt/iDrawingSurfaceInfo.java+117−0
@@ -0,0 +1,117 @@
1/*
2 *
3 * Adapted from MDrawingSurfaceInfo.java version - 1.3 96/12/20
4 *
5 */
6
7package inferno.awt;
8
9import sun.awt.DrawingSurfaceInfo;
10import sun.awt.PhysicalDrawingSurface;
11import sun.awt.image.ImageRepresentation;
12import java.awt.Rectangle;
13import java.awt.Shape;
14import java.awt.image.ColorModel;
15import java.awt.peer.ComponentPeer; // eventually inferno.awt.iComponentPeer ??
16
17/**
18 * The iDrawingSurfaceInfo object provides direct access for rendering
19 * on Components maintained by the Inferno iToolkit.
20 *
21 */
22
23public class iDrawingSurfaceInfo
24 implements DrawingSurfaceInfo, PhysicalDrawingSurface /* , iDrawingSurface */
25{
26 int state;
27 int w, h;
28 ComponentPeer peer = null; // eventually an iComponentPeer
29 ImageRepresentation imgrep;
30
31 /**
32 * Construct a new iDrawingSurfaceInfo for the specified peer.
33 */
34 /* To date Inferno doesn't need this constructor from
35 MDrawingSurfaceInfo if it does, we'll need an
36 inferno.awt.iComponentPeer
37 iDrawingSurfaceInfo(iComponentPeer peer) {
38 this.peer = peer;
39 }
40 */
41
42 /**
43 * Construct a new iDrawingSurfaceInfo for the specified offscreen image.
44 */
45 iDrawingSurfaceInfo(ImageRepresentation imgrep) {
46 this.imgrep = imgrep;
47 }
48
49 // implementation of lock from sun.awt.DrawingSurfaceInfo interface
50 public native int lock();
51
52 // implementation of unlock from sun.awt.DrawingSurfaceInfo interface
53 public native void unlock();
54
55 // implementation of getBounds from sun.awt.DrawingSurfaceInfo interface
56 public Rectangle getBounds() {
57 Rectangle r;
58 // comment out to keep compiler happy, eventually may
59 // need this code ? - jfs
60 /*
61 if (peer != null) {
62 r = peer.target.getBounds();
63 r.setLocation(0, 0);
64 } else {
65 r = new Rectangle(0, 0, imgrep.width, imgrep.height);
66 }
67 return r;
68 */
69 return (r = new Rectangle(0, 0, imgrep.width, imgrep.height));
70 }
71
72 // implementation of getSurface from sun.awt.DrawingSurfaceInfo interface
73 public PhysicalDrawingSurface getSurface() {
74 return this;
75 }
76
77 // implementation of getClip from sun.awt.DrawingSurfaceInfo interface
78 public Shape getClip() {
79 return getBounds();
80 }
81
82 public ColorModel getColorModel() {
83 return iToolkit.getStaticColorModel();
84 }
85
86 /**
87 * Returns a an Object pointer to the rendered $Draw->Image
88 * represented by this object.
89 */
90 final native Object getDrawable();
91
92 /**
93 * Return the depth (log2 of pixel width) of the
94 * $Draw->Image represented by this object.
95 */
96 final native int getDepth();
97
98 /*
99 for future reference:
100 X11DrawingSurfaceInfo implements X11DrawingSurface:
101 public native int getDisplay();
102 public native int getDrawable();
103 public native int getDepth();
104 public native int getVisualID();
105 public native int getColormapID();
106 public ColorModel getColorModel();
107
108 and WDrawingSurfaceInfo implements WDrawingSurface:
109 public native int getHWnd();
110 public native int getHBitmap();
111 public native int getPBits();
112 public native int getHDC();
113 public native int getDepth();
114 public native int getHPalette();
115
116 */
117}
java/pkg/awt/iDrawingSurfaceInfo_L.b+56−0
@@ -0,0 +1,56 @@
1implement iDrawingSurfaceInfo_L;
2
3# javal v1.5 generated file: edit with care
4
5include "jni.m";
6 jni : JNI;
7 ClassModule,
8 JString,
9 JArray,
10 JArrayI,
11 JArrayC,
12 JArrayB,
13 JArrayS,
14 JArrayJ,
15 JArrayF,
16 JArrayD,
17 JArrayZ,
18 JArrayJObject,
19 JArrayJClass,
20 JArrayJString,
21 JClass,
22 JThread,
23 JObject : import jni;
24
25#>> extra pre includes here
26
27include "iDrawingSurfaceInfo_L.m";
28
29#>> extra post includes here
30
31#<<
32
33init( jni_p : JNI )
34{
35 # save java native inteface mod instance
36 jni = jni_p;
37 #>>extra initialization here
38 #<<
39}
40
41lock_I( this : ref iDrawingSurfaceInfo_obj) : int
42{#>>
43}#<<
44
45unlock_V( this : ref iDrawingSurfaceInfo_obj)
46{#>>
47}#<<
48
49getDrawable_rObject( this : ref iDrawingSurfaceInfo_obj) : JObject
50{#>>
51}#<<
52
53getDepth_I( this : ref iDrawingSurfaceInfo_obj) : int
54{#>>
55}#<<
56
java/pkg/awt/iDrawingSurfaceInfo_L.m+21−0
@@ -0,0 +1,21 @@
1# javal v1.5 generated file: edit with care
2
3iDrawingSurfaceInfo_L : module
4{
5 iDrawingSurfaceInfo_obj : adt
6 {
7 cl_mod : ClassModule;
8 state : int;
9 w : int;
10 h : int;
11 peer : JObject;
12 imgrep : JObject;
13 };
14
15 init : fn( jni_p : JNI );
16 lock_I : fn( this : ref iDrawingSurfaceInfo_obj) : int;
17 unlock_V : fn( this : ref iDrawingSurfaceInfo_obj);
18 getDrawable_rObject : fn( this : ref iDrawingSurfaceInfo_obj) : JObject;
19 getDepth_I : fn( this : ref iDrawingSurfaceInfo_obj) : int;
20
21};
java/pkg/awt/iFontMetrics.java+266−0
@@ -0,0 +1,266 @@
1/*
2 * %W% - %E%
3 */
4
5 /*
6 The only font metrics that Inferno provides are height, the distance
7 in pixels between baselines of lines of text rendered in a particular
8 font, and ascent, the distance from the top of the bounding box to the
9 baseline. So there really isn't much vertical information to provide.
10 In particular there's no leading, and descent information.
11
12 To do better than this will require, putting max bounds, leading, and
13 descent information in the Inferno subfont files, and augmenting $Draw
14 built-in module to make this information visible to Limbo programs.
15 */
16
17/*
18 *
19 */
20
21package inferno.awt;
22
23import java.awt.*;
24import java.util.Hashtable;
25import java.lang.IllegalArgumentException;
26
27/**
28 * A font metrics object for a font.
29 *
30 */
31public class iFontMetrics extends FontMetrics {
32
33 private static final boolean debug = false;
34
35 int widths[];
36 int ascent;
37 int descent;
38 int leading;
39 int height;
40 int maxAscent;
41 int maxDescent;
42 int maxHeight;
43
44 /*
45 maxAdvance can't be readily determined without
46 parsing the Inferno font file and calling
47 Draw->(Draw->Font).width() for every char mapped by
48 that Inferno Font. An alternate fudging strategy is to
49 set it to the max width of any char in the first 256
50 (getWidths()) characters.
51 */
52 int maxAdvance = -1;
53
54 private boolean needWidths = true;
55
56 // rather than ask our Font for it's peer everytime we want it. We'll
57 // ask once at construction time, as a small optimization.
58
59 private iFontPeer ifontpeer;
60
61 public iFontMetrics(Font font) {
62 super(font);
63 // Some vertical font metrics (height, and ascent) are (conveniently)
64 // already available in the iFontPeer of a constructed Font.
65 if (font == null) {
66 throw new IllegalArgumentException("font");
67 }
68 ifontpeer = (iFontPeer)font.getPeer(); // our Inferno peer
69 height = ifontpeer.iHeight;
70 ascent = ifontpeer.iAscent;
71
72 // fudge a pixel for leading if the difference between height
73 // and ascent permits, done by iFontPeer() like so
74 // leading = ((height - ascent) > 2) ? 1 : 0;
75 leading = ifontpeer.fLeading;
76 descent = height - ascent - leading;
77
78 // There's no information regarding the following available to Limbo,
79 // or even in the Inferno subfont files, so fudge 'em.
80 maxHeight = height;
81 maxAscent = ascent;
82 maxDescent = descent;
83
84 // widths and maybe maxAdvance is evaluated lazily as needed.
85 }
86
87 /**
88 * Get leading
89 */
90 public int getLeading() {
91 return leading;
92 }
93
94 /**
95 * Get ascent.
96 */
97 public int getAscent() {
98 return ascent;
99 }
100
101 /**
102 * Get descent
103 */
104 public int getDescent() {
105 return descent;
106 }
107
108 /**
109 * Get height
110 */
111 public int getHeight() {
112 return height;
113 }
114
115 /**
116 * Get maxAscent
117 */
118 public int getMaxAscent() {
119 return maxAscent;
120 }
121
122 /**
123 * Get maxDescent
124 */
125 public int getMaxDescent() {
126 return maxDescent;
127 }
128
129 /**
130 * Get maxAdvance
131 */
132 public int getMaxAdvance() {
133 if (needWidths) {
134 initWidths();
135 }
136 return maxAdvance;
137 }
138
139 /**
140 * Returns the advance width of the sprcified character in this Font.
141 */
142 public int charWidth(char ch) {
143 if (ch < 256) { // chars are zero extended upon promotin to ints
144 if (needWidths) {
145 initWidths();
146 }
147 return widths[ch & 0xFF];
148 } else {
149 char data[] = { ch };
150 return charsWidth(data, 0, 1);
151 }
152 }
153
154
155 /**
156 * Return the advance widh of the specified chars in this Font
157 */
158 public int charsWidth(char data[], int off, int len) {
159 int w = 0;
160 int tlen = len;
161 int toff = off;
162 boolean tooBig = false;
163 if (data == null || off < 0) {
164 throw new IllegalArgumentException();
165 }
166 while(len-- > 0) {
167 if (data[off] >= 256) {
168 tooBig = true;
169 break;
170 }
171 if (needWidths) {
172 initWidths();
173 }
174 w += widths[data[off++]];
175 }
176 if (tooBig) {
177 if (debug) {
178 System.out.println("iFontMetrics.charsWidth - tooBig");
179 }
180 w = stringWidth(new String(data, off, len));
181 }
182 return w;
183 }
184
185
186 /**
187 * Return the width of the specified string in this Font.
188 *
189 * Why not bust up the string into a char[] and try for the optimization
190 * of charsWidth if all elemment values are less than 256? -jfs?
191 */
192 public int stringWidth(String str) {
193 if (str == null) {
194 throw new IllegalArgumentException();
195 }
196 return iStringWidth(str);
197 }
198
199 public int bytesWidth(byte[] data, int off, int len) {
200 // check args here?
201 if (data == null || off < 0 || len < 0) {
202 throw new IllegalArgumentException();
203 }
204 byte[] ndata = new byte[len];
205 System.arraycopy(data, off, ndata, 0, len);
206 return iBytesWidth(ndata);
207 }
208
209 // Compute width of string in this font.
210 private native int iStringWidth(String str);
211
212 // translate bytes from UTF-8 encoding into a Unicode Limbo string,
213 // compute the advance width of the string in this Font and return
214 // the advance in pixels.
215 private native int iBytesWidth(byte data[]);
216
217 // get advance widths of the first 256 characters of this font.
218 private synchronized void initWidths() {
219 widths = new int[256];
220 maxAdvance = iInitWidths(widths);
221 if (debug) {
222 System.out.println("iFontMetrics.initWidths(): maxAdvance=" + maxAdvance);
223 }
224 needWidths = false;
225 }
226
227 // populates widths with the advance width of the first 256 chars
228 // in this font, returns the width of the widest character.
229 private native int iInitWidths(int widths[]);
230
231 /**
232 * Get the widths of the first 256 characters in the font.
233 */
234 public int[] getWidths() {
235 if (needWidths) {
236 initWidths();
237 }
238 return widths;
239 }
240
241 static Hashtable table = new Hashtable();
242
243 static synchronized FontMetrics getFontMetrics(Font font) {
244 if (font == null) {
245 throw new NullPointerException("FontMetrics.getFontMetrics()");
246 }
247 FontMetrics fm = (FontMetrics)table.get(font);
248 if (fm == null) {
249 table.put(font, fm = new iFontMetrics(font));
250 }
251 return fm;
252 }
253
254 /**
255 Returns a representation of this <code>FontMetric</code>
256 object's values as a string.
257 @return a string representation of this font metric.
258 */
259 public String toString() {
260 return getClass().getName() + "[font=" + getFont() + "ascent=" +
261 getAscent() + ", descent=" + getDescent() + ", leading=" +
262 getLeading() + ", height=" + getHeight() + ", maxAdvance=" +
263 maxAdvance + ", font.getPeer()=" + font.getPeer().toString() +
264 " ]" ;
265 }
266}
java/pkg/awt/iFontMetrics_L.b+123−0
@@ -0,0 +1,123 @@
1implement iFontMetrics_L;
2
3# javal v1.5 generated file: edit with care
4
5include "jni.m";
6 jni : JNI;
7 ClassModule,
8 JString,
9 JArray,
10 JArrayI,
11 JArrayC,
12 JArrayB,
13 JArrayS,
14 JArrayJ,
15 JArrayF,
16 JArrayD,
17 JArrayZ,
18 JArrayJObject,
19 JArrayJClass,
20 JArrayJString,
21 JClass,
22 JThread,
23 JObject : import jni;
24
25#>> extra pre includes here
26#
27# %W% - %E%
28#
29
30Value: import jni;
31sys : import jni; # std inferno Sys modoule
32# str : import jni; # std inferno String module
33# jldr : import jni; # primary java class loader, JavaClassLoader
34
35# draw.m is included by something included by jni.m
36draw : Draw;
37Font : import Draw;
38
39include "iFontPeer_L.m";
40ifontpeerm : iFontPeer_L;
41iFontPeer_obj : import ifontpeerm;
42#<<
43
44include "iFontMetrics_L.m";
45
46#>> extra post includes here
47
48cast : Cast;
49ctxt : ref Draw->Context; # for ref to Display
50
51#<<
52
53init( jni_p : JNI )
54{
55 # save java native inteface mod instance
56 jni = jni_p;
57 #>>extra initialization here
58
59 sys = jni->sys;
60
61 # should not I share draw with at least the rest of the AWT
62 # graphics world ?
63 draw = load Draw Draw->PATH;
64
65 #ifontpeerm = load iFontPeer_L iFontPeer_L->PATH;
66
67 ctxt = jni->getContext();
68 if (ctxt == nil) {
69 # Eventually the print can be removed, throwing the
70 # Exception will suffice.
71 sys->print("iFontMetrics_L.init: ctxt == nil, can't get Draw Context!\n");
72 jni->ThrowException("java.awt.AWTError", "can't get Draw Context");
73 }
74#<<
75}
76
77iStringWidth_rString_I( this : ref iFontMetrics_obj, p0 : JString) : int
78{#>>
79
80 # sys->print("iFontMetrics_L: fontref=%#x\n", p0);
81 return (draw->(this.ifontpeer.iFontRef).width(p0.str));
82 #return (draw->(this.iFontRef).width(p0.str));
83}#<<
84
85iBytesWidth_aB_I( this : ref iFontMetrics_obj, p0 : JArrayB) : int
86{#>>
87 # convert to string performing UT8 to Unicode translation
88 cdata := string p0.ary;
89 return (draw->(this.ifontpeer.iFontRef).width(cdata));
90}#<<
91
92iInitWidths_aI_I( this : ref iFontMetrics_obj, p0 : JArrayI) : int
93{#>>
94 # p0 is widths[256] in java land
95 maxw := 0; # maximum width
96 cs : string;
97 n := len p0.ary;
98 cw : int; # width of current char
99 cb := array[1] of byte;
100
101 for (i := 0; i < n; i++) {
102 cb[0] = byte i; # cast i to string
103 cs = string cb;
104
105 cw = (draw->(this.ifontpeer.iFontRef).width(cs));
106
107 if (maxw < cw) {
108 maxw = cw;
109 }
110
111 p0.ary[i] = cw;
112 }
113 return maxw;
114}#<<
115
116
117
118
119
120
121
122
123
java/pkg/awt/iFontMetrics_L.m+27−0
@@ -0,0 +1,27 @@
1# javal v1.5 generated file: edit with care
2
3iFontMetrics_L : module
4{
5 iFontMetrics_obj : adt
6 {
7 cl_mod : ClassModule;
8 font : JObject;
9 widths : JArrayI;
10 ascent : int;
11 descent : int;
12 leading : int;
13 height : int;
14 maxAscent : int;
15 maxDescent : int;
16 maxHeight : int;
17 maxAdvance : int;
18 needWidths : byte;
19 ifontpeer : ref iFontPeer_obj; # javal generates JObject;
20 };
21
22 init : fn( jni_p : JNI );
23 iStringWidth_rString_I : fn( this : ref iFontMetrics_obj, p0 : JString) : int;
24 iBytesWidth_aB_I : fn( this : ref iFontMetrics_obj, p0 : JArrayB) : int;
25 iInitWidths_aI_I : fn( this : ref iFontMetrics_obj, p0 : JArrayI) : int;
26
27};
java/pkg/awt/iFontPeer.java+276−0
@@ -0,0 +1,276 @@
1/*
2 * %W% - %E%
3 */
4
5/**
6 * Inferno's Font peer
7 *
8 */
9
10 /*
11 * If you're not using xemacs to view this file, you may find it's indentation
12 * more ledgible if you set your tabstops to four spaces.
13 */
14package inferno.awt;
15
16import java.io.FileNotFoundException;
17import java.awt.Font;
18import java.util.Properties;
19import java.util.Hashtable;
20import java.util.Vector;
21import java.io.File;
22import java.io.InputStream;
23import java.io.FileInputStream;
24import java.io.BufferedInputStream;
25import java.util.StringTokenizer;
26
27public class iFontPeer implements java.awt.peer.FontPeer {
28
29 // a default Inferno pathname to a font
30 // "/fonts/lucidasans/latin1.7.font" is a popular default font
31 private final static String defifpathname = "*default*";
32
33 /*
34 An object to hold a Limbo reference of type ref Draw->Font
35 the handle to Inferno platform font capabilities.
36 Inferno JNI access as this.iFontRef.
37 Pertinent size metrics are kept here in the peer for quicker
38 text rendering.
39 */
40 Object iFontRef;
41 int iAscent = -1; // Inferno font's ascent value
42 int iHeight = -1; // Inferno font's height value
43 int fLeading = -1; // a fudged value for leading (none in Inferno fonts)
44 String iName = ""; // Inferno font's name (should match ifpathname)
45
46 private static Properties fprops;
47 static {
48 // Find property file
49 String jhome = System.getProperty("java.home");
50 if (jhome == null){
51 throw new Error("java.home property not set");
52 }
53 // trace("jhome=" + jhome);
54
55 String language = System.getProperty("user.language", "en");
56 String region = System.getProperty("user.region");
57
58 // trace("language=" + language);
59 // trace("region=" + region);
60 // trace("File.separator=" + File.separator);
61
62 try {
63 File f = null;
64 if (region != null) {
65 f = new File(jhome + File.separator +
66 "lib" + File.separator +
67 "font.properties." + language + "_" +
68 region);
69 }
70
71 if (f == null || !f.canRead()) {
72 f = new File(jhome + File.separator +
73 "lib" + File.separator + "font.properties." +
74 language);
75 if (!f.canRead()) {
76 f = new File(jhome + File.separator +
77 "lib" + File.separator + "font.properties");
78 if (!f.canRead()){
79 throw new Exception();
80 }
81 }
82 }
83
84 fprops = new Properties();
85
86 // Load property file
87 // trace("trying to load props at path " + f.getPath());
88 InputStream in =
89 new BufferedInputStream(new FileInputStream(f.getPath()));
90 fprops.load(in);
91 in.close();
92 } catch (Exception e){
93 System.out.println("iFontPeer: can't load font.properties");
94 System.out.println("exception: " + e.getMessage());
95 e.printStackTrace();
96 } // end try
97 } // end static
98
99
100 // The do-nothing constructor
101 public iFontPeer(String name, int style) {
102 // Don't do anything with name and style, they're implementation
103 // artifacts from a different (better?) world of scalable
104 // platform fonts where size is a final argument to platform
105 // dependant rendering libraries, but Inferno's are static bitmaps.
106 //
107 // a better (more general) signatures for this constructor would
108 // have been FontPeer(Font font) or
109 // FontPeer(String name,int style,int size)
110 // but alas, Sun's API hasn't been quite general enough in that regard.
111 }
112
113 // Native method to actually create font in Inferno Display and
114 // populate this object with reference to Draw->Font and some
115 // font metrics.
116 private native void initFontPeer(String ifpathname) throws FileNotFoundException;
117
118 //
119 // initializeFontPeer is called by java.awt.Font.java so this
120 // method must, regretably, have public scope.
121 //
122 public String initializeFontPeer(String name, int style, int size)
123 {
124 String ifpn = ""; // pathname to Inferno font
125 // trace("iFontPeer.initializeFontPeer(): name=" + name +" ,style="
126 // + style + ", size=" + size);
127
128 boolean triedDefault = false;
129 ifpn = mapifpath(name, style, size);
130 if (ifpn == null) {
131 ifpn = defifpathname;
132 }
133
134 retry:
135 try {
136 initFontPeer(ifpn); // sets iName, iAscent, iHeight, and fLeading
137 } catch (FileNotFoundException e) {
138 // case: properties maps to a file but font file doesn't
139 // exist
140 if (!triedDefault) {
141 triedDefault = true;
142 ifpn = defifpathname;
143 // trace("initializeFontPeer: trying default");
144 break retry;
145 }
146 }
147
148 if (debug) {
149 trace("iFontPeer.initializeFontPeer():");
150 trace(" iName=" + iName);
151 trace(" iAscent=" + iAscent + " iHeight=" + iHeight);
152 }
153 return ifpn;
154 }
155
156 //
157 // map a Java font triple into the full pathname of an Inferno
158 // font description file.
159 //
160 private static String mapifpath(String name, int style, int size) {
161
162 if (fprops == null) {
163 return defifpathname;
164 }
165
166 String aName = name.toLowerCase();
167 String aStyle = styleStr(style);
168 String aSize = String.valueOf(size);
169
170 //trace("mapifpath(" + aName + ", " + aStyle + ", " + aSize + ")");
171 String aStr = aName + "." + aStyle + "." + aSize;
172 int idx;
173
174 // perform face name substitution
175 String rStr = fprops.getProperty("alias." + aName);
176 if (rStr != null && rStr.indexOf('.') < 0) {
177 aName = rStr;
178 }
179 //trace("gp1 rStr=" +rStr+ " aName=" +aName+ " aStyle=" +aStyle+
180 // " aSize=" + aSize);
181
182 // perform style substitution on result of above
183 rStr = fprops.getProperty("alias." + aName + "." + aStyle);
184 if (rStr != null) {
185 idx = rStr.indexOf('.');
186 if (idx > 0 && rStr.lastIndexOf('.') == idx &&
187 (idx+1 < rStr.length()))
188 {
189 aName = rStr.substring(0,idx);
190 aStyle = rStr.substring(idx+1);
191 }
192 }
193 //trace("gp2 rStr=" +rStr+ " aName=" +aName+ " aStyle=" +aStyle+
194 // " aSize=" + aSize);
195
196
197 // Now see if there's a complete alias for this "font+style+size"
198 rStr = fprops.getProperty("alias." + aName + "." + aStyle +
199 "." + aSize);
200 if (rStr != null) {
201 StringTokenizer st = new StringTokenizer(rStr,".",false);
202 if (st.countTokens() == 3) {
203 aName = st.nextToken();
204 aStyle = st.nextToken();
205 aSize = st.nextToken();
206 }
207 }
208 //trace("gp3 rStr=" +rStr+ " aName=" +aName+ " aStyle=" +aStyle+
209 // " aSize=" + aSize);
210
211
212 // after these substitutions, see if the font string has
213 // a match, applying the followin heuristic.
214 // if stlye isn't "plain", adjust size +-2, if no match
215 // change style to "plain" and proceed per style is "plain"
216 // if style is "plain" adjust size +-4 if need be.
217 //
218
219 while(true) {
220 int nsize;
221 boolean up = true;
222 int range = (style != Font.PLAIN) ? 2 : 4;
223
224 for (int i = 0; i <= range;) {
225 nsize = Math.abs(size + ((up) ? i : -i));
226 // trace("nsize=" + nsize);
227 aSize = String.valueOf(nsize);
228 rStr = fprops.getProperty(aName +"."+ aStyle + "." + aSize);
229 if (rStr != null) {
230 //trace("***mapifpath: got it!");
231 break;
232 }
233 if (!up) {
234 i++;
235 }
236 up = (!up);
237 }
238 if (rStr == null) {
239 if (style != Font.PLAIN) { // retry with plain style
240 style = Font.PLAIN;
241 aStyle = styleStr(style);
242 //trace("***mapifpath: retry w/plain font!, nsize=" + nsize);
243 continue;
244 }
245 rStr = defifpathname; // no Match, returns default
246 }
247 break;
248 }
249 trace ("mapifpath: gp4 aName=" +aName+ " aStyle=" +aStyle+
250 " aSize=" + aSize + " rStr=" + rStr);
251 return(rStr);
252 }
253
254 /*
255 * return String representation of style
256 */
257 private static String styleStr(int num){
258 switch(num){
259 case Font.BOLD:
260 return "bold";
261 case Font.ITALIC:
262 return "italic";
263 case Font.ITALIC+Font.BOLD:
264 return "bolditalic";
265 default:
266 return "plain";
267 }
268 }
269
270 private static final boolean debug = false;
271 private static void trace(String arg) {
272 if (debug) {
273 System.out.println(arg);
274 }
275 }
276}
java/pkg/awt/iFontPeer_L.b+115−0
@@ -0,0 +1,115 @@
1implement iFontPeer_L;
2
3# javal v1.5 generated file: edit with care
4
5include "jni.m";
6 jni : JNI;
7 ClassModule,
8 JString,
9 JArray,
10 JArrayI,
11 JArrayC,
12 JArrayB,
13 JArrayS,
14 JArrayJ,
15 JArrayF,
16 JArrayD,
17 JArrayZ,
18 JArrayJObject,
19 JArrayJClass,
20 JArrayJString,
21 JClass,
22 JThread,
23 JObject : import jni;
24
25#>> extra pre includes here
26
27#
28# %W% - %E%
29#
30
31Value : import jni;
32sys : import jni; # std inferno Sys modoule
33str : import jni; # std inferno String module
34# jldr : import jni; # primary java class loader, JavaClassLoader
35
36# draw.m is included by something included by jni.m
37draw : Draw;
38Font : import Draw;
39
40#<<
41
42include "iFontPeer_L.m";
43
44#>> extra post includes here
45
46cast : Cast;
47ctxt : ref Draw->Context; # for ref to Display
48
49#<<
50
51init( jni_p : JNI )
52{
53 # save java native inteface mod instance
54 jni = jni_p;
55 #>>extra initialization here
56
57 sys = jni->sys;
58
59 # should not I share draw with at least the rest of the AWT
60 # graphics world ?
61 draw = load Draw Draw->PATH;
62 # sys->print("iFontPeer_L: draw=%x\n",draw);
63
64 # Why is getting Cast module handle from jni different
65 # than getting Sys, Math, and String modules handles from jni?
66 # cast = jni->CastMod();
67 ctxt = jni->getContext();
68 if (ctxt == nil) {
69 # Eventually the print can be removed, throwing the
70 # Exception will suffice.
71 sys->print("iFontPeer_L.init: ctxt == nil, can't get Draw Context!\n");
72 jni->ThrowException("java.awt.AWTError", "can't get Draw Context");
73 }
74 #<<
75}
76
77initFontPeer_rString_V( this : ref iFontPeer_obj, p0 : JString)
78{#>>
79
80 ifp := p0.str;
81 #sys->print("initFontPeer_V: this.ifpathname=%s\n",ifp);
82
83 this.iFontRef = draw->Font.open(ctxt.display, ifp);
84 fontref := this.iFontRef;
85
86 if (nil == fontref) {
87 sys->print("iFontPeer_L: can't open font %s - %r\n",ifp);
88 jni->ThrowException("java.io.FileNotFoundException", ifp);
89 }
90
91 # sys->print("iFontPeer_L: this=%#x\n",this);
92 # sys->print("iFontPeer_L: this.iFontRef=%#x, draw=%#x\n",this.iFontRef, draw);
93
94
95 # make native Font information visible in javaland
96
97 #this.iName.str = fontref.name;
98 this.iName = jni->NewString(fontref.name);
99
100 this.iAscent = fontref.ascent;
101 this.iHeight = fontref.height;
102
103
104 ## if there is some height to spare, fudge a pixel of leading
105 # if ((fontref.height - fontref.ascent) > 2) {
106 # this.fLeading = 1;
107 # }
108 this.fLeading = 0;
109
110 # sys->print("this.iFontRef=%x\n",this.iFontRef);
111 # sys->print("this.iAscent=%x\n",this.iAscent);
112 # sys->print("this.iHeight=%x\n",this.iHeight);
113 # sys->print("this.fLeading=%x\n",this.fLeading);
114}#<<
115
java/pkg/awt/iFontPeer_L.m+20−0
@@ -0,0 +1,20 @@
1# javal v1.5 generated file: edit with care
2
3iFontPeer_L : module
4{
5 PATH : con "/dis/java/inferno/awt/iFontPeer_L.dis";
6
7 iFontPeer_obj : adt
8 {
9 cl_mod : ClassModule;
10 iFontRef : ref Font; # javal generates JObject;
11 iAscent : int;
12 iHeight : int;
13 fLeading : int;
14 iName : JString;
15 };
16
17 init : fn( jni_p : JNI );
18 initFontPeer_rString_V : fn( this : ref iFontPeer_obj, p0 : JString);
19
20};
java/pkg/awt/iFramePeer.java+527−0
@@ -0,0 +1,527 @@
1package inferno.awt;
2
3import java.awt.*;
4import java.awt.event.*;
5import java.awt.peer.*;
6import java.awt.image.ImageProducer;
7import java.awt.image.ImageObserver;
8import java.awt.image.ColorModel;
9import java.awt.image.DirectColorModel;
10import java.util.*;
11import inferno.awt.iGraphics;
12
13public class iFramePeer implements FramePeer, DoubleBufferingPeer {
14 private Object pCanvas; // Set inside create() used by natives
15
16 // set inside create(), used by natives, to avoid some clutter in
17 // escaping the Limbo type system.
18 private Object thisAsJObject;
19
20 private Frame target;
21
22 private int leftInset=0; // How much canvas is inset from frame
23 private int rightInset=0;
24 private int topInset=0;
25 private int bottomInset=0;
26 private int left; // x position of left of frame
27 private int top; // y position of top of frame
28
29 private Point oldMousePoint;
30 private boolean buttonState[];
31
32 private int resizable = 1;
33
34 public iFramePeer(Frame target) {
35 this.target = target;
36 oldMousePoint=new Point(-1,-1);
37 buttonState=new boolean[3];
38 for (int i=0;i<3;i++) buttonState[i]=false; //up
39 // create(this);
40 if (target.getTitle() != null) {
41 setTitle(target.getTitle());
42 }
43 Font f = target.getFont();
44 if (f == null) {
45 f = new Font("Dialog", Font.PLAIN, 12);
46 target.setFont(f);
47 setFont(f);
48 }
49 Color c = target.getBackground();
50 if (c == null) {
51 c = SystemColor.window;
52 target.setBackground(c);
53 setBackground(c);
54 }
55 c = target.getForeground();
56 if (c == null) {
57 target.setForeground(Color.black);
58 setForeground(Color.black);
59 }
60 if (!target.isResizable())
61 this.resizable = 0;
62
63 create(this);
64
65 }
66
67 /* implementation of java.awt.peer.DoubleBufferingPeer */
68 public boolean isDoubleBuffered() {
69 return true;
70 }
71
72 private native Object getRefImage(); // Returns dev/draw image of canvas
73
74 private native Object getRefOffScreenImage(); // Returns off-screen buffer image
75
76 private native void pReshape(int x, int y, int width, int height);
77
78 private native void pHide(); // Hide frame
79
80 private native void pShow(iFramePeer fp); // Show frame
81
82 private native int getXYLoc(int coord); // get x or y value of the global position
83
84 // Create frame putting canvas in pcanvas
85 private native void create(iFramePeer me);
86
87 public native void pDispose(); // Destroy frame
88 public native void setCursor(int cursorType); // Set cursor
89 public native void setTitle(String title); // Set title of frame
90 public native void toFront(); // Move frame to front
91 public native void toBack(); // Move frame to back
92
93
94 /* New 1.1 API */
95 public Point getLocationOnScreen() // Return position on screen
96 {
97 Point p = new Point();
98 p.x = getXYLoc(0);
99 p.y = getXYLoc(1);
100 return p;
101 }
102
103 public void recalculate()
104 {
105 MenuBar mb=target.getMenuBar();
106 if (mb!=null)
107 {
108 iMenuBarPeer ip=(iMenuBarPeer)mb.getPeer();
109
110 if (ip!=null)
111 {
112 ip.recalculate();
113 }
114 }
115 }
116
117 public void setCursor(Cursor c)
118 {
119 if (c!=null)
120 setCursor(c.getType());
121 }
122
123 public void setResizable(boolean resizable)
124 {
125 System.out.println("java: setResizable() get called" + resizable);
126 if(!resizable)
127 this.resizable = 0;
128 }
129
130 public void setMenuBar(MenuBar mb)
131 {
132 recalculate();
133 }
134
135 public void setIconImage(Image im)
136 {
137 }
138
139 public Insets getInsets()
140 {
141 Insets i=new Insets(topInset,leftInset,bottomInset,rightInset);
142
143 MenuBar mb=target.getMenuBar();
144
145 if (mb!=null)
146 {
147 iMenuBarPeer peer=(iMenuBarPeer)mb.getPeer();
148
149 if (peer!=null)
150 {
151 i=(Insets)i.clone(); //Get new copy
152
153 i.top+=peer.getHeight();
154 }
155
156 }
157
158 return i;
159 }
160
161 public Insets insets()
162 {
163 return getInsets();
164 }
165
166 public void endValidate()
167 {
168
169 }
170
171 public void beginValidate()
172 {
173
174 }
175
176 public void setBounds(int x, int y, int width, int height) {
177 pReshape(x, y, width, height);
178 }
179
180 public void reshape(int x, int y, int width, int height) {
181 pReshape(x, y, width, height);
182 }
183
184
185 public void dispose()
186 {
187 pDispose();
188 pCanvas=null;
189 }
190
191 public void disable()
192 {
193 setEnabled(false);
194 }
195
196 public void enable()
197 {
198 setEnabled(false);
199 }
200
201 public void setEnabled(boolean b)
202 {
203
204 }
205
206 public void hide()
207 {
208 setVisible(false);
209 }
210
211 public void show()
212 {
213 setVisible(true);
214 }
215
216 public void setVisible(boolean b)
217 {
218 if (b)
219 pShow(this);
220 else
221 pHide();
222 }
223
224 public Dimension getMinimumSize() {
225 return target.getSize();
226 }
227
228 public Dimension getPreferredSize() {
229 return getMinimumSize();
230 }
231
232 public Dimension minimumSize() {
233 return getMinimumSize();
234 }
235
236 public Dimension preferredSize() {
237 return getPreferredSize();
238 }
239
240
241 public int checkImage(Image img, int w, int h, ImageObserver o) {
242 return 0;
243 }
244
245 public FontMetrics getFontMetrics(Font font) {
246 return iFontMetrics.getFontMetrics(font);
247 }
248
249 public boolean prepareImage(Image img, int w, int h, ImageObserver o) {
250 return false;
251 }
252
253
254 public Image createImage(ImageProducer producer) {
255 return null/*new Win32Image(producer)*/;
256 }
257 public Image createImage(int width, int height) {
258 return null/*new Win32Image(target, width, height)*/;
259 }
260
261 public boolean isFocusTraversable() {
262 return false;
263 }
264
265 public void requestFocus()
266 {
267 }
268
269 public void nextFocus()
270 {
271 }
272
273 public void setFont(Font f)
274 {
275
276 }
277
278 public Font getFont()
279 {
280 return null;
281 }
282
283 public void setBackground(Color c)
284 {
285
286 }
287
288 public void setForeground(Color c)
289 {
290
291 }
292
293 public Graphics getGraphics()
294 {
295 if (pCanvas==null) {
296 System.out.println("iFramePeer.getGraphics(): pCanvas == null!"); // jfs - remove
297 return null;
298 }
299 Rectangle bounds = target.getBounds();
300 Rectangle clip = new Rectangle(bounds.x+leftInset,
301 bounds.y+topInset,
302 bounds.width-leftInset-rightInset,
303 bounds.height-topInset-bottomInset);
304 Graphics g=new iGraphics(getRefImage(),getRefOffScreenImage(), clip, target);
305 g.translate(bounds.x,bounds.y); // bounds have already been set - lg
306 return g;
307 }
308
309 public java.awt.Toolkit getToolkit() {
310 return Toolkit.getDefaultToolkit();
311 }
312
313 public ColorModel getColorModel() {
314 return iToolkit.getStaticColorModel();
315 }
316
317 public void handleEvent(AWTEvent e)
318 {
319
320 }
321
322 public void print(Graphics g)
323 {
324 }
325
326 public void paint(Graphics g)
327 {
328 g.setColor(target.getForeground());
329 g.setFont(target.getFont());
330 MenuBar mb=target.getMenuBar();
331 if (mb!=null)
332 {
333 iMenuBarPeer ip=(iMenuBarPeer)mb.getPeer();
334
335 if (ip!=null)
336 {
337 ip.paint(g);
338 }
339 }
340 target.paint(g);
341 }
342
343
344 public void repaint(long tm, int x, int y, int width, int height) {
345
346 iToolkit.postEvent(new PaintEvent((Component)target, PaintEvent.UPDATE,
347 new Rectangle(x, y, width, height)));
348
349 }
350
351 private void handleKeyEvents(int ch)
352 {
353 char keyChar = (char)ch;
354 boolean control = ch >= 0 && ch <= 31;
355 boolean lowercase = ch >= (int)'a' && ch <= (int)'z';
356 boolean uppercase = ch >= (int)'A' && ch <= (int)'Z';
357 int modifiers = control?InputEvent.CTRL_MASK:
358 uppercase?InputEvent.SHIFT_MASK:0;
359 int keyCode = control?ch+64:lowercase?ch-32:ch;
360
361 // constructing a Date is slow, System.currentTimeMillis(),
362 // is faster, but it's implementation opens #c/time and
363 // converts a string to a big. Fastest still and probably
364 // with sufficient resolution would be natively time stamping
365 // events with sys->millisec(). -jfs
366 //// Date d = new Date();
367 //// long when = d.getTime();
368 long when = System.currentTimeMillis();
369
370
371 iToolkit.postEvent(new KeyEvent(target,KeyEvent.KEY_PRESSED,
372 when,modifiers,keyCode,keyChar));
373
374 // synthesize events that we don't get from /dev/keyboard via
375 // Inferno's Tk (this is some fast typist!)
376 /*
377 iToolkit.postEvent(new KeyEvent(target,KeyEvent.KEY_TYPED,
378 when+1,modifiers,keyCode,keyChar));
379 iToolkit.postEvent(new KeyEvent(target,KeyEvent.KEY_RELEASED,
380 when+2,modifiers,keyCode,keyChar));
381 */
382 }
383
384 private void handleMouseEvents(int m,int button,int x,int y)
385 {
386 char mode=(char)m;
387 // System.out.println("Mouse event "+mode+" "+button+" "+x+" "+y);
388 switch(mode)
389 {
390case 'd':
391case 'r':
392case 'm':
393case 'p':
394 Rectangle bounds = target.getBounds();
395 int xx=x-bounds.x-leftInset;
396 int yy=y-bounds.y; // -topInset;
397
398 Point mousePoint=new Point(xx,yy);
399 long when = System.currentTimeMillis();
400 int modifier;
401
402 switch(button)
403 {
404case 1:
405 modifier=InputEvent.BUTTON1_MASK;
406 break;
407
408case 2:
409 modifier=InputEvent.BUTTON2_MASK;
410 break;
411
412case 3:
413 modifier=InputEvent.BUTTON3_MASK;
414 break;
415
416default:
417 modifier=0;
418 }
419
420 switch(mode)
421 {
422case 'p': // Pressed
423case 'd': // Double click
424 {
425 if (button>0 && button<=3 && buttonState[button-1]==false)
426 {
427 oldMousePoint=mousePoint;
428 buttonState[button-1]=true;
429 iToolkit.postEvent(new MouseEvent(target,MouseEvent.MOUSE_PRESSED,
430 when,modifier,xx,yy,1,false));
431
432 }
433 break;
434 }
435case 'r': // Released
436 {
437 if (button>0 && button<=3 && buttonState[button-1]==true)
438 {
439 buttonState[button-1]=false;
440 iToolkit.postEvent(new MouseEvent(target,MouseEvent.MOUSE_RELEASED,
441 when,modifier,xx,yy,1,false));
442 if (mousePoint.equals(oldMousePoint))
443 {
444 iToolkit.postEvent(new MouseEvent(target,MouseEvent.MOUSE_CLICKED,
445 when,modifier,xx,yy,1,button==2));
446 }
447 }
448 break;
449 }
450case 'm': // Moved
451 {
452 modifier=0;
453 if (buttonState[0]) modifier|=InputEvent.BUTTON1_MASK;
454 if (buttonState[1]) modifier|=InputEvent.BUTTON2_MASK;
455 if (buttonState[2]) modifier|=InputEvent.BUTTON3_MASK;
456 iToolkit.postEvent(new MouseEvent(target,
457 modifier==0?MouseEvent.MOUSE_MOVED:MouseEvent.MOUSE_DRAGGED,
458 when,modifier,xx,yy,1,false));
459
460 break;
461 }
462default:
463 // System.out.println("focusEvent:" + mouseString);
464 }
465 break;
466 }
467
468 // System.out.println("mouseString "+mouseString);
469 }
470
471 private void moveSize(int x, int y, int width, int height)
472 {
473 Rectangle old = target.getBounds();
474 Rectangle n = new Rectangle(x, y, width, height);
475 if (!n.equals(old)){
476 target.setBounds(x, y, width, height);
477 target.validate();
478 target.repaint();
479 }
480 }
481
482 private void paintTarget(int x, int y, int width, int height)
483 {
484 target.setBounds(x, y, width, height);
485 target.validate();
486 target.repaint();
487 }
488
489 //
490 // Callbacks from native for Window Events
491 //
492 private void handleActivated() {
493 iToolkit.postEvent(new WindowEvent(target,
494 WindowEvent.WINDOW_ACTIVATED));
495 iToolkit.postEvent(new FocusEvent(target,
496 FocusEvent.FOCUS_GAINED, false));
497 }
498 private void handleDeactivated() {
499 iToolkit.postEvent(new WindowEvent(target,
500 WindowEvent.WINDOW_DEACTIVATED));
501 iToolkit.postEvent(new FocusEvent(target,
502 FocusEvent.FOCUS_LOST, true));
503 }
504 private void handleClosing() {
505 //System.out.println("iFramePeer.handleClosing():");
506 // Java Frame can then call System.exit() to shutdown the VM
507 // if it so desires
508 iToolkit.postEvent(new WindowEvent(target,
509 WindowEvent.WINDOW_CLOSING));
510 }
511 private void handleIconified() {
512 //System.out.println("iFramePeer.handleIconified():");
513 iToolkit.postEvent(new WindowEvent(target,
514 WindowEvent.WINDOW_ICONIFIED));
515
516 }
517 private void handleDeIconified() {
518 // System.out.println("iFramePeer.handleDeiconified():");
519 iToolkit.postEvent(new WindowEvent(target,
520 WindowEvent.WINDOW_DEICONIFIED));
521
522 // may need to make Cursors visible as well??? - jfs
523 // target.repaint();
524 }
525}
526
527
java/pkg/awt/iFramePeer_L.b+588−0
@@ -0,0 +1,588 @@
1implement iFramePeer_L;
2
3# javal v1.5 generated file: edit with care
4
5include "jni.m";
6 jni : JNI;
7 ClassModule,
8 JString,
9 JArray,
10 JArrayI,
11 JArrayC,
12 JArrayB,
13 JArrayS,
14 JArrayJ,
15 JArrayF,
16 JArrayD,
17 JArrayZ,
18 JArrayJObject,
19 JArrayJClass,
20 JArrayJString,
21 JClass,
22 JThread,
23 JObject : import jni;
24
25#>> extra pre includes here
26
27 cast : Cast;
28
29 sys : Sys;
30
31 draw: Draw;
32 Context, Screen, Display, Rect, Font, Point, Image: import draw;
33
34include "tk.m";
35 tk: Tk;
36 Toplevel: import tk;
37
38include "wmlib.m";
39 wmlib: Wmlib;
40
41include "awt_Color.m";
42 awt : AwtColor;
43
44#<<
45
46include "iFramePeer_L.m";
47
48#>> extra post includes here
49 str : String;
50 Value : import jni;
51 ctxt : ref Draw->Context;
52 title : string;
53
54 # channel for receiving Tk events and "reallyExit" from dispose().
55 cmdchan: chan of string;
56
57 #
58 # the following was included from awt_Frame.b and sees varying
59 # degrees of use.
60 #
61
62 screen: ref Screen;
63 display: ref Display;
64 ones: ref Image;
65 white: ref Image;
66 nochan: chan of string;
67 tHeight : int;
68 bWidth: int;
69 last_x, last_y : int;
70
71 Event: adt
72 {
73 event: int;
74 detail: string;
75
76 Button, Key,
77 Icon, DeIcon,
78 Resize, Shutdown
79 : con iota;
80 };
81
82 Attr: adt
83 {
84 origin: Draw->Point;
85 dims: Draw->Point;
86 };
87
88 Canvas: adt
89 {
90 # interface
91 image: ref Draw->Image;
92 buf: ref Draw->Image;
93 rect: Draw->Rect;
94 events: chan of ref Event;
95 attr: ref Attr;
96 # implementation
97 ctxt : ref Draw->Context;
98 top: ref Tk->Toplevel;
99 canvas: string;
100 pid: int;
101 };
102 # end of historical inclusions from awt_Frame.b
103#<<
104init( jni_p : JNI )
105{
106 # save java native inteface mod instance
107 jni = jni_p;
108 #>>extra initialization here
109
110 sys = jni->sys;
111
112 str = load String String->PATH;
113 awt = load AwtColor AwtColor->PATH;
114 cast = jni->CastMod();
115
116 # draw and tk are module refs that JNI may someday provide, saving a
117 # Limbo load operation for every FramePeer construction
118 draw = load Draw Draw->PATH;
119 tk = load Tk Tk->PATH;
120 wmlib = load Wmlib Wmlib->PATH;
121
122 ctxt = jni->getContext();
123 title = "Untitled";
124
125 nochan = chan of string;
126 screen = ctxt.screen;
127 last_x = last_y = -10;
128 wmlib->init();
129 #<<
130}
131
132getRefImage_rObject( this : ref iFramePeer_obj) : ref Draw->Image
133{#>>
134 return this.pCanvas.image;
135}#<<
136
137getRefOffScreenImage_rObject(this :ref iFramePeer_obj) : ref Draw->Image
138{#>>
139 return this.pCanvas.buf;
140}#<<
141
142pReshape_I_I_I_I_V( this : ref iFramePeer_obj, p0 : int,p1 : int,p2 : int,p3 : int)
143{#>>
144 strcmd := ". configure -x " + string p0 + " -y " + string p1 +
145 " -width " + string p2 + " -height " + string p3;
146
147 tk->cmd(this.pCanvas.top, strcmd);
148 tk->cmd(this.pCanvas.top, "update");
149}#<<
150
151pHide_V( this : ref iFramePeer_obj)
152{#>>
153 # Explicit filtering of input (mouse and keyboard) events shouldn't
154 # be needed if Tk is doing it's job wrt "map" and "unmap".
155 tk->cmd(this.pCanvas.top, ". unmap");
156 this.pCanvas.image = nil;
157}#<<
158
159pShow_riFramePeer_V( this : ref iFramePeer_obj, p0 : JObject)
160{#>>
161 # Window.show() has already produced a WINDOW_OPENED event
162 # Tk\'s " . map" will result in a WINDOW_ACTIVATE event when it
163 # directs focus to the newly mapped frame.
164
165 tk->cmd(this.pCanvas.top, ". map");
166# spawn doEvent(this, p0);
167}#<<
168
169getXYLoc_I_I( this : ref iFramePeer_obj,p0 : int) : int
170{#>>
171 if (p0 == 0)
172 return this.pCanvas.rect.min.x;
173 else
174 return this.pCanvas.rect.min.y;
175}#<<
176
177create_riFramePeer_V( this : ref iFramePeer_obj, p0 : JObject)
178{#>>
179 # make's for easy punning around the Limbo type system.
180 # two refs to same object: "this" and "thisAsJObject".
181 this.thisAsJObject = p0;
182
183 t := jni->GetObjField(this.target, "title", "Ljava/lang/String;");
184
185 if (t == nil)
186 sys->print("Cannot get title\n");
187 else{
188 sobj := t.Object();
189 c := jni->CastMod();
190 js := cast->ToJString(sobj);
191 title = js.str;
192 }
193
194 xval := jni->GetObjField(this.target, "x", "I");
195 yval := jni->GetObjField(this.target, "y", "I");
196 wval := jni->GetObjField(this.target, "width", "I");
197 hval := jni->GetObjField(this.target, "height", "I");
198
199
200 x := xval.Int();
201 y := yval.Int();
202 w := wval.Int();
203 h := hval.Int();
204
205 makewin(ctxt, title, x, y, w, h, this, p0);
206
207 this.topInset = tHeight + bWidth + bWidth;
208 this.leftInset = bWidth;
209 this.rightInset = bWidth;
210 this.bottomInset = bWidth;
211 this.left = this.pCanvas.rect.min.x;
212 this.top = this.pCanvas.rect.min.y;
213
214 tk->cmd(this.pCanvas.top, ". unmap");
215 this.pCanvas.image = nil;
216}#<<
217
218pDispose_V( this : ref iFramePeer_obj)
219{#>>
220 # sys->print("iFramePeer_L.pDispose_V(): entered on pid=%d\n", sys->pctl(0,nil));
221
222 # request evenhandler's suicide, and sync until done
223 cmdchan <- = "reallyExit";
224
225 this.pCanvas = nil;
226}#<<
227
228setCursor_I_V( this : ref iFramePeer_obj, p0 : int)
229{#>>
230}#<<
231
232
233setTitle_rString_V( this : ref iFramePeer_obj, p0 : JString)
234{#>>
235 title = p0.str;
236 if (wmlib != nil && this.pCanvas != nil && this.pCanvas.top != nil &&
237 title != nil)
238 {
239
240 # sys->print("iFramePeer_L.b.setTitle(): %s\n", title);
241
242 # A change of title string to an iconfied Frmae will only be seen
243 # after deiconification, as Inferno's wm provides no mechanism
244 # to change the value displayed on the "taskbar" once a window's
245 # been iconified, contrary to the commentary in appl/lib/wmlib.b
246 wmlib->taskbar(this.pCanvas.top, title);
247 }
248}#<<
249
250toFront_V( this : ref iFramePeer_obj)
251{#>>
252 this.pCanvas.image.top();
253}#<<
254
255toBack_V( this : ref iFramePeer_obj)
256{#>>
257 this.pCanvas.image.bottom();
258}#<<
259
260#>>
261doEvent(i : ref iFramePeer_obj, job : JObject)
262{
263# cc := i.pCanvas;
264 for (;;) {
265 e := <- i.pCanvas.events;
266 case e.event {
267 Event.Shutdown =>
268 exit;
269 * =>
270 ;
271 }
272 }
273}
274
275javapainttarget(j : JObject, r : Draw->Rect)
276{
277 args := array[4] of ref Value;
278 args[0] = ref Value.TInt(r.min.x);
279 args[1] = ref Value.TInt(r.min.y);
280 args[2] = ref Value.TInt(r.max.x - r.min.x + 1);
281 args[3] = ref Value.TInt(r.max.y - r.min.y + 1);
282 (val, err) := jni->CallMethod(j, "paintTarget", "(IIII)V", args);
283 if (err != jni->OK){
284 sys->print( "CallMethod Error %d: paintTarget\n",err);
285 }
286}
287
288javamvsz(j : JObject, r : Draw->Rect)
289{
290 args := array[4] of ref Value;
291 args[0] = ref Value.TInt(r.min.x);
292 args[1] = ref Value.TInt(r.min.y);
293 args[2] = ref Value.TInt(r.max.x - r.min.x + 1);
294 args[3] = ref Value.TInt(r.max.y - r.min.y + 1);
295 (val, err) := jni->CallMethod(j, "moveSize", "(IIII)V", args);
296 if (err != jni->OK){
297 sys->print( "CallMethod Error %d: moveSize\n",err);
298 }
299}
300#<<
301
302
303#>>
304win_cfg := array[] of {
305 "canvas .c -height 6 -width 6",
306 "pack .c -side bottom -fill both -expand 1",
307 "pack propagate . 0",
308};
309
310win_bind := array[] of {
311 "bind . <Configure> {send cmd configure}",
312 "bind . <Map> {send cmd map}",
313 "bind . <FocusIn> +{send cmd focusIn}",
314 "bind . <FocusOut> +{send cmd focusOut}",
315 "bind # <Motion> {send butt m %b %X %Y}",
316 "bind # <Leave> {send butt Leave}",
317 "bind # <ButtonPress> {focus #;send butt p %b %X %Y}",
318 "bind # <ButtonRelease> {send butt r %b %X %Y}",
319 "bind # <Double-Button> {send butt d %b %X %Y}",
320 "bind # <Enter> {send butt Enter}",
321 "bind # <KeyPress> {send key %K}",
322 "bind .Wm_t <Button-1> +{send butt p %b %x %y}",
323 "bind .Wm_t.title <Button-1> +{send butt p %b %x %y}",
324 "bind .Wm_t <Button-1> +{focus #}",
325 "bind .Wm_t.title <Button-1> +{focus #}",
326
327 # Optional button 2 input focus to frame. Deviates from
328 # current (crippled IMHO) wmlib practice. Benefit is keyboard
329 # focus without raising frame to top. - jfs
330 "bind .Wm_t <Button-2> +{focus #}",
331 "bind .Wm_t.title <Button-2> +{focus #}",
332};
333
334modinit(ctxt: ref Context)
335{
336 draw = load Draw Draw->PATH;
337 tk = load Tk Tk->PATH;
338 wmlib = load Wmlib Wmlib->PATH;
339
340 nochan = chan of string;
341
342 screen = ctxt.screen;
343 last_x = last_y = -10;
344
345 wmlib->init();
346}
347
348makewin(ctxt: ref Context, title: string, x, y, width, height: int, this: ref iFramePeer_obj, job: JObject)
349{
350# modinit(ctxt);
351 t : ref Toplevel;
352 menu : chan of string;
353 where := "-x " + string x + " -y " + string y;
354 if (this.resizable == 1)
355 (t, menu) = wmlib->titlebar(screen, where, title, Wmlib->Appl);
356 else
357 (t, menu) = wmlib->titlebar(screen, where, title, Wmlib->Hide);
358
359# calculate topInset and boardwidth
360 bWidth = int tk->cmd(t, ". cget -bd");
361 tHeight = int tk->cmd(t, ". cget -height");
362
363 if (width > 0 && height > 0)
364 win_cfg[0] = "canvas .c -height " + string (height - tHeight -bWidth -bWidth) + " -width " + string (width);
365# win_cfg[0] = "canvas .c -height " + string (height - tHeight) + " -width " + string width;
366
367 wmlib->tkcmds(t, win_cfg);
368
369 ones = t.image.display.ones;
370 white = t.image.display.color(Draw->White);
371 alloccanvas(t, ctxt, ".c", menu, this, job);
372}
373
374alloccanvas(t: ref Toplevel, ctxt: ref Draw->Context, canvas: string, menu: chan of string, this :ref iFramePeer_obj, job: JObject)
375{
376 cmdchan = chan of string;
377 tk->namechan(t, cmdchan, "cmd");
378 butt := chan of string;
379 tk->namechan(t, butt, "butt");
380
381 key := chan of string;
382 tk->namechan(t, key, "key");
383
384# tk->cmd(t, "bind . <Configure> {send cmd resize}");
385# tk->cmd(t, "bind . <Map> {send cmd map}");
386
387 for (i := 0; i < len win_bind; i++)
388 tk->cmd(t, expand(win_bind[i], canvas));
389
390 tk->cmd(t, "update");
391
392 c := ref Canvas;
393 this.pCanvas = c;
394 c = nil;
395
396 bg := Draw->White;
397 jcol := jni->GetObjField(this.target, "background", "Ljava/awt/Color;");
398 if (jcol == nil) {
399 sys->print("iFramePeer_L: Cannot get background color\n");
400 } else {
401 color := jcol.Object();
402 bg = awt->getColorIndex(jni, color);
403 }
404
405 this.pCanvas.image = t.image;
406 display = t.image.display;
407 this.pCanvas.rect = canvposn(t, canvas);
408 this.pCanvas.buf = ctxt.display.newimage(ctxt.display.image.r,
409 this.pCanvas.image.ldepth , 0, bg);
410 this.pCanvas.events = nil; # not currently used
411 this.pCanvas.top = t;
412 this.pCanvas.ctxt = ctxt;
413 this.pCanvas.canvas = canvas;
414 this.pCanvas.pid = sys->pctl(0, nil);
415
416 spawn handler(menu, cmdchan, butt, key, this, job);
417}
418
419handler(menu, cmd, butt, key : chan of string, this : ref iFramePeer_obj, job: JObject)
420{
421 detail: string;
422 iconified := 0;
423 toplvl := this.pCanvas.top;
424
425 if (menu == nil)
426 menu = nochan;
427 for (;;) alt {
428 detail = <- menu =>
429 case detail {
430 "exit" =>
431# this.pCanvas.events <- = ref Event(Event.Shutdown, nil);
432 # 'X' button in titlebar is passed to Java code
433 # as a WINDOW_CLOSING event.
434 doFclosing(this.thisAsJObject);
435
436 "task" =>
437 iconified = 1;
438 this.pCanvas.image = nil;
439 doFiconified(job);
440
441 # synthesize a WINDOW_DEACTIVATED event, the TK "FocusOut"
442 # event doesn't arrive until after this window has been
443 # selected and deiconified from the toolbar.
444 doFdeactivated(this.thisAsJObject);
445 wmlib->titlectl(toplvl, detail); # shrink it
446
447 * => # default wmlib actions for move, size, ok, help
448 wmlib->titlectl(toplvl, detail);
449 }
450# wmlib->titlectl(this.pCanvas.top, detail);
451
452 detail = <- cmd =>
453 (n, word) := sys->tokenize(detail, " ");
454 case hd word {
455 "configure" or "map" =>
456 this.pCanvas.image = this.pCanvas.top.image;
457 this.pCanvas.rect = canvposn(toplvl, this.pCanvas.canvas);
458# e := Event.Resize;
459 if (hd word == "map") {
460 # if being mapped after an iconfication
461 if (iconified) {
462 iconified = 0;
463 doFdeIconified(this.thisAsJObject);
464 }
465# sys->print("mapped\n");
466 tk->cmd(toplvl, "focus " + this.pCanvas.canvas);
467# deIconify(job);
468 r := this.pCanvas.rect;
469 javapainttarget(job, r);
470 }
471 else{
472 r := this.pCanvas.rect;
473 javamvsz(job, r);
474 }
475
476 # receiving or losing window's keyboard focus should
477 # generate frame activation events upto Javaland
478 "focusIn" =>
479 doFactivated(this.thisAsJObject);
480 "focusOut" =>
481 # ignore loss-of-Tk-focus events that result from
482 # iconification.
483 if (! iconified) {
484 doFdeactivated(this.thisAsJObject);
485 }
486 # sent by dispose() to terminate this event handling thread
487 "reallyExit" =>
488 sys->print("iFrame_Peer_L.handler(): suicide\n");
489 exit;
490 * =>
491 sys->print("iFrame_Peer_L.handler(): unknown event - %s\n",
492 detail);
493 }
494
495 detail = <- butt =>
496 doMouseEvent(job, detail);
497 detail = <- key =>
498 doKeyEvent(job, detail);
499 }
500}
501
502expand(cmd, canvas: string): string
503{
504 s: string;
505 for (;;) {
506 (l, r) := str->splitl(cmd, "#");
507 s = s + l;
508 if (r == nil)
509 return s;
510 s = s + canvas;
511 cmd = r[1:];
512 }
513}
514
515canvposn(t: ref Toplevel, c: string): Rect
516{
517 r: Rect;
518
519 r.min.x = int tk->cmd(t, ". cget -actx");
520 r.min.y = int tk->cmd(t, ". cget -acty");
521 r.max.x = r.min.x - 1 + int tk->cmd(t, ". cget -actwidth");
522 r.max.y = r.min.y - 1 + int tk->cmd(t, ". cget -actheight");
523 return r;
524}
525
526doFactivated(job : JObject) {
527 (val, err) := jni->CallMethod(job, "handleActivated", "()V", nil);
528 if (err != jni->OK)
529 sys->print( "CallMethod Error %d: handleActivated\n",err);
530
531}
532
533doFdeactivated(job : JObject) {
534 (val, err) := jni->CallMethod(job, "handleDeactivated", "()V", nil);
535 if (err != jni->OK)
536 sys->print( "CallMethod Error %d: handleDeactivated\n",err);
537
538}
539
540doFclosing(job : JObject) {
541 (val, err) := jni->CallMethod(job, "handleClosing", "()V", nil);
542 if (err != jni->OK)
543 sys->print( "CallMethod Error %d: handleClosingt\n",err);
544
545}
546
547doFiconified(job : JObject) {
548 (val, err) := jni->CallMethod(job, "handleIconified", "()V", nil);
549 if (err != jni->OK)
550 sys->print( "CallMethod Error %d: handleIconified\n",err);
551}
552
553doFdeIconified(job : JObject) {
554 (val, err) := jni->CallMethod(job, "handleDeIconified", "()V", nil);
555 if (err != jni->OK)
556 sys->print( "CallMethod Error %d: handleDeIconified\n",err);
557}
558doKeyEvent(job : JObject, detail : string) {
559 (kchar, st) := str->toint(detail, 16);
560 args := array[1] of ref Value;
561 args[0] = ref Value.TInt(kchar);
562 (val, err) := jni->CallMethod(job, "handleKeyEvents", "(I)V", args);
563 if (err != jni->OK){
564 sys->print( "CallMethod Error %d: handleKeyEvents\n",err);
565 }
566}
567
568doMouseEvent(job : JObject, detail : string) {
569 (n,toks) := sys->tokenize(detail," ");
570 if (n != 4) return;
571 mode := array of byte hd toks;
572 toks = tl toks;
573 button:=int hd toks;
574 toks = tl toks;
575 x:=int hd toks;
576 toks = tl toks;
577 y:=int hd toks;
578 args := array[4] of ref Value;
579 args[0] = ref Value.TInt(int mode[0]);
580 args[1] = ref Value.TInt(button);
581 args[2] = ref Value.TInt(x);
582 args[3] = ref Value.TInt(y);
583 (val, err) := jni->CallMethod(job, "handleMouseEvents", "(IIII)V", args);
584 if (err != jni->OK){
585 sys->print( "CallMethod Error %d: handleMouseEvents\n",err);
586 }
587}
588#<<
java/pkg/awt/iFramePeer_L.m+36−0
@@ -0,0 +1,36 @@
1# javal v1.5 generated file: edit with care
2
3iFramePeer_L : module
4{
5 iFramePeer_obj : adt
6 {
7 cl_mod : ClassModule;
8 pCanvas : ref Canvas; #JObject;
9 thisAsJObject : JObject;
10 target : JObject;
11 leftInset : int;
12 rightInset : int;
13 topInset : int;
14 bottomInset : int;
15 left : int;
16 top : int;
17 buttonState : JArrayZ;
18 oldMousePoint : JObject;
19 resizable : int;
20 };
21
22 init : fn( jni_p : JNI );
23 getRefImage_rObject : fn( this : ref iFramePeer_obj) : ref Draw->Image;
24 getRefOffScreenImage_rObject : fn(this :ref iFramePeer_obj) : ref Draw->Image;
25 pReshape_I_I_I_I_V : fn( this : ref iFramePeer_obj, p0 : int,p1 : int,p2 : int,p3 : int);
26 pHide_V : fn( this : ref iFramePeer_obj);
27 pShow_riFramePeer_V : fn( this : ref iFramePeer_obj, p0 : JObject);
28 getXYLoc_I_I : fn( this : ref iFramePeer_obj, p0 : int) : int;
29 create_riFramePeer_V : fn( this : ref iFramePeer_obj, p0 : JObject);
30 pDispose_V : fn( this : ref iFramePeer_obj);
31 setCursor_I_V : fn( this : ref iFramePeer_obj, p0 : int);
32 setTitle_rString_V : fn( this : ref iFramePeer_obj, p0 : JString);
33 toFront_V : fn( this : ref iFramePeer_obj);
34 toBack_V : fn( this : ref iFramePeer_obj);
35
36};
java/pkg/awt/iGraphics.java+606−0
@@ -0,0 +1,606 @@
1package inferno.awt;
2
3import java.awt.*;
4import java.awt.peer.*;
5import java.io.*;
6import java.util.*;
7import java.awt.image.ImageObserver;
8import inferno.awt.iFontPeer;
9
10//import sun.awt.image.OffScreenImageSource;
11//import sun.awt.image.ImageRepresentation;
12
13/**
14 * iGraphics is an object that encapsulates a graphics context for a
15 * particular canvas.
16 *
17 * @version 1.18 18 Mar 1996
18 */
19
20public class iGraphics extends Graphics {
21 // Object pcanvas;
22 Object refImage;
23 Object refOffScreenImage;
24 Component target;
25 Color foreground;
26 Font font;
27 private iFontPeer ifontpeer;
28 int originX;
29 int originY;
30 Rectangle clipRect;
31 Rectangle initialClipRect;
32 boolean dirty;
33
34 //private native void imageCreate(ImageRepresentation ir);
35 private native void pSetForeground(int r, int g, int b);
36
37 private Image image;
38
39 private Object awt; // Pointer to awt object
40
41 private native void createGraphics();
42
43 public iGraphics(Object refImage, Object refOffScreenImage, Rectangle initialClipRect, Component target)
44 {
45 this.refImage = refImage;
46 this.refOffScreenImage = refOffScreenImage;
47 this.initialClipRect = new Rectangle(initialClipRect);
48 this.clipRect = new Rectangle(initialClipRect);
49 this.target = target;
50 this.font = target.getFont();
51 if (font != null) {
52 this.ifontpeer = (iFontPeer)font.getPeer();
53 }
54 dirty = false;
55 createGraphics();
56 }
57
58// a dummy constructor for testing
59 public iGraphics(Object im) {
60 }
61
62
63 public iGraphics(Image image) {
64 }
65
66 /**
67 * Create a new iGraphics Object based on this one.
68 */
69 public Graphics create() {
70 iGraphics g = new iGraphics(refImage, refOffScreenImage, initialClipRect, target);
71 g.foreground = foreground;
72 g.font = font;
73 g.ifontpeer = ifontpeer;
74 g.originX = originX;
75 g.originY = originY;
76 g.image = image;
77 //g.clipRect = clipRect;
78 //g.initialClipRect = initialClipRect;
79 return g;
80 }
81
82 private void checkDirty()
83 {
84 if (dirty)
85 {
86 dirty = false;
87 copyOffscreenImage(clipRect.x,clipRect.y,clipRect.width,clipRect.height);
88 }
89
90 }
91
92
93 /**
94 * Translate
95 */
96 public void translate(int x, int y) {
97 originX += x;
98 originY += y;
99 clipRect.translate(-x,-y);
100 initialClipRect.translate(-x,-y);
101 }
102
103 /**
104 * Disposes of this iGraphics context. It cannot be used after being
105 * disposed.
106 */
107 private native void pDispose();
108
109 public void dispose()
110 {
111 checkDirty();
112 pDispose();
113 }
114
115 public void setFont(Font font) {
116 if ((font != null) && (this.font != font)) {
117 synchronized (this.font) {
118 this.font = font;
119 ifontpeer = (iFontPeer)font.getPeer();
120 }
121 }
122 }
123 public Font getFont() {
124 return this.font;
125 }
126
127 /**
128 * Gets font metrics for the given font.
129 */
130 public FontMetrics getFontMetrics(Font font) {
131 return iFontMetrics.getFontMetrics(font);
132 }
133
134
135 private void ourSetForeground()
136 {
137 pSetForeground(foreground.getRed(), foreground.getGreen(), foreground.getBlue());
138 }
139
140 /**
141 * Sets the foreground color.
142 */
143 public void setColor(Color c) {
144 if ((c != null) && (c != foreground)) {
145 foreground = c;
146 pSetForeground(c.getRed(), c.getGreen(), c.getBlue());
147 }
148 }
149 public Color getColor() {
150 return foreground;
151 }
152
153
154 /**
155 * Sets the paint mode to overwrite the destination with the
156 * current color. This is the default paint mode.
157 */
158 public native void setPaintMode();
159
160 /**
161 * Sets the paint mode to alternate between the current color
162 * and the given color.
163 */
164 public native void setXORMode(Color c1);
165
166 /**
167 * Gets the current clipping area
168 */
169 public Rectangle getClipBounds()
170 {
171 return new Rectangle(clipRect);
172 }
173
174 private native void changeClip(int X, int Y, int W, int H, boolean set);
175
176 private void removeClip()
177 {
178 checkDirty();
179 clipRect = new Rectangle(initialClipRect);
180 }
181
182 private void ourSetClip()
183 {
184 dirty = true;
185 changeClip(clipRect.x,clipRect.y,clipRect.width,clipRect.height,true);
186 }
187
188 /** Crops the clipping rectangle for this iGraphics context. */
189 public void clipRect(int X, int Y, int W, int H) {
190 checkDirty();
191 clipRect = clipRect.intersection(new Rectangle(X,Y,W,H)); // test lg
192 // System.out.println("java == intersection: "+ clipRect);
193 //changeClip(X, Y, W, H, false);
194 }
195
196 /** Sets the clipping rectangle for this iGraphics context. */
197 public void setClip(int X, int Y, int W, int H) {
198 checkDirty();
199 clipRect = new Rectangle(X,Y,W,H);
200 //changeClip(X, Y, W, H, true);
201 }
202
203 /** Returns a Shape object representing the clip. */
204 public Shape getClip() {
205 return getClipBounds();
206 }
207
208 /** Sets the clip to a Shape (only Rectangle allowed). */
209 public void setClip(Shape clip) {
210 if (clip == null) {
211 removeClip();
212 } else if (clip instanceof Rectangle) {
213 Rectangle r = (Rectangle) clip;
214 checkDirty();
215 clipRect = new Rectangle(r);
216 //changeClip(r.x, r.y, r.width, r.height, true);
217 } else {
218 throw new IllegalArgumentException("setClip(Shape) only supports Rectangle objects");
219 }
220 }
221
222 /** Clears the rectangle indicated by x,y,w,h. */
223 private native void pClearRect(int x, int y, int w, int h);
224
225 public void clearRect(int x, int y, int w, int h)
226 {
227 ourSetClip();
228 pClearRect(x,y,w,h);
229 }
230
231 /** Fills the given rectangle with the foreground color. */
232 private native void pFillRect(int X, int Y, int W, int H);
233
234 public void fillRect(int X, int Y, int W, int H)
235 {
236 ourSetClip();
237 pFillRect(X,Y,W,H);
238 }
239
240 /** Draws the given rectangle. */
241 private native void pDrawRect(int X, int Y, int W, int H);
242
243 public void drawRect(int X, int Y, int W, int H)
244 {
245 ourSetClip();
246 pDrawRect(X,Y,W,H);
247 }
248
249
250 /** Draws the given string. */
251 public void drawString(String str, int x, int y) {
252 drawStringWidth(str, x, y);
253 }
254
255 /** Draws the given character array. */
256 public void drawChars(char data[], int offset, int length, int x, int y) {
257 String str = new String(data, offset, length);
258 drawStringWidth(str, x, y);
259 // drawCharsWidth(data, offset, length, x, y);
260 }
261
262 /** Draws the given byte array. */
263 public void drawBytes(byte data[], int offset, int length, int x, int y) {
264 String str = new String(data, offset, length);
265 drawStringWidth(str, x, y);
266 // drawBytesWidth(data, offset, length, x, y);
267 }
268
269 /** Draws the given string and returns the length of the drawn
270 string in pixels. If font is not set then returns -1. */
271 private native int pDrawStringWidth(String str, int x, int y);
272
273 private int drawStringWidth(String str, int x, int y)
274 {
275 int r;
276 ourSetClip();
277 if (ifontpeer == null) {
278 return 0;
279 }
280 r = pDrawStringWidth(str, x, y - ifontpeer.iAscent - ifontpeer.fLeading);
281 // System.out.println("Length of string "+r);
282 return r;
283 }
284
285 /** Draws the given character array and return the width in
286 pixels. If font is not set then returns -1. */
287// public native int drawCharsWidth(char data[], int offset, int length,
288// int x, int y);
289
290 /** Draws the given character array and return the width in
291 pixels. If font is not set then returns -1. */
292// public native int drawBytesWidth(byte data[], int offset, int length,
293// int x, int y);
294
295 /** Draws the given line. */
296 private native void pDrawLine(int x1, int y1, int x2, int y2);
297
298 public void drawLine(int x1, int y1, int x2, int y2) {
299 ourSetClip();
300 pDrawLine(x1, y1, x2, y2);
301 }
302
303 /**
304 * Draws an image at x,y in nonblocking mode with a callback object.
305 */
306 public boolean drawImage(Image img, int x, int y, ImageObserver observer) {
307 // We need to get the bits.
308 if ( img == null )
309 return false;
310 java.awt.image.ImageProducer ip = img.getSource();
311 java.awt.image.ImageConsumer ic = new iImageConsumer(this, img, x, y);
312 ip.startProduction(ic);
313 ip.removeConsumer(ic);
314 /*WImage wImg = (WImage) img;
315 if (wImg.hasError()) {
316 if (observer != null) {
317 observer.imageUpdate(img,
318 ImageObserver.ERROR|ImageObserver.ABORT,
319 -1, -1, -1, -1);
320 }
321 return false;
322 }
323 ImageRepresentation ir = wImg.getImageRep();
324 return ir.drawImage(this, x, y, null, observer);
325 */
326 return false;
327 }
328
329 /**
330 * Draws an image scaled to x,y,w,h in nonblocking mode with a
331 * callback object.
332 */
333 public boolean drawImage(Image img, int x, int y, int width, int height,
334 ImageObserver observer) {
335 /*if (width == 0 || height == 0) {
336 return true;
337 }
338 WImage wImg = (WImage) img;
339 if (wImg.hasError()) {
340 if (observer != null) {
341 observer.imageUpdate(img,
342 ImageObserver.ERROR|ImageObserver.ABORT,
343 -1, -1, -1, -1);
344 }
345 return false;
346 }
347 ImageRepresentation ir = wImg.getImageRep();
348 return ir.drawScaledImage(this, x, y, width, height, null, observer);
349 */
350 return false;
351 }
352
353 /**
354 * Draws an image at x,y in nonblocking mode with a solid background
355 * color and a callback object.
356 */
357 public boolean drawImage(Image img, int x, int y, Color bg,
358 ImageObserver observer) {
359 /*WImage wImg = (WImage) img;
360 if (wImg.hasError()) {
361 if (observer != null) {
362 observer.imageUpdate(img,
363 ImageObserver.ERROR|ImageObserver.ABORT,
364 -1, -1, -1, -1);
365 }
366 return false;
367 }
368 ImageRepresentation ir = wImg.getImageRep();
369 return ir.drawImage(this, x, y, bg, observer);
370 */
371 return false;
372 }
373
374 /**
375 * Draws an image scaled to x,y,w,h in nonblocking mode with a
376 * solid background color and a callback object.
377 */
378 public boolean drawImage(Image img, int x, int y, int width, int height,
379 Color bg, ImageObserver observer) {
380 /*if (width == 0 || height == 0) {
381 return true;
382 }
383 WImage wImg = (WImage) img;
384 if (wImg.hasError()) {
385 if (observer != null) {
386 observer.imageUpdate(img,
387 ImageObserver.ERROR|ImageObserver.ABORT,
388 -1, -1, -1, -1);
389 }
390 return false;
391 }
392 ImageRepresentation ir = wImg.getImageRep();
393 return ir.drawScaledImage(this, x, y, width, height, bg, observer);
394 */
395 return false;
396 }
397
398 /**
399 * Draws a subrectangle of an image scaled to a destination rectangle
400 * in nonblocking mode with a callback object.
401 */
402 public boolean drawImage(Image img,
403 int dx1, int dy1, int dx2, int dy2,
404 int sx1, int sy1, int sx2, int sy2,
405 ImageObserver observer) {
406 /*if (dx1 == dx2 || dy1 == dy2) {
407 return true;
408 }
409 WImage wImg = (WImage) img;
410 if (wImg.hasError()) {
411 if (observer != null) {
412 observer.imageUpdate(img,
413 ImageObserver.ERROR|ImageObserver.ABORT,
414 -1, -1, -1, -1);
415 }
416 return false;
417 }
418 ImageRepresentation ir = wImg.getImageRep();
419 return ir.drawStretchImage(this,
420 dx1, dy1, dx2, dy2,
421 sx1, sy1, sx2, sy2,
422 null, observer);
423 */
424 return false;
425 }
426
427 /**
428 * Draws a subrectangle of an image scaled to a destination rectangle in
429 * nonblocking mode with a solid background color and a callback object.
430 */
431 public boolean drawImage(Image img,
432 int dx1, int dy1, int dx2, int dy2,
433 int sx1, int sy1, int sx2, int sy2,
434 Color bgcolor, ImageObserver observer) {
435 /*if (dx1 == dx2 || dy1 == dy2) {
436 return true;
437 }
438 WImage wImg = (WImage) img;
439 if (wImg.hasError()) {
440 if (observer != null) {
441 observer.imageUpdate(img,
442 ImageObserver.ERROR|ImageObserver.ABORT,
443 -1, -1, -1, -1);
444 }
445 return false;
446 }
447 ImageRepresentation ir = wImg.getImageRep();
448 return ir.drawStretchImage(this,
449 dx1, dy1, dx2, dy2,
450 sx1, sy1, sx2, sy2,
451 bgcolor, observer);
452 */
453 return false;
454 }
455
456 /**
457 * Actually draws the image on the Inferno display in a blocking mode.
458 */
459 private native void pGenDraw(int x, int y, int w, int h, byte pixels[]);
460
461 protected void drawImage(int x, int y, int w, int h, byte pixels[]) {
462 ourSetClip();
463 //ourSetForeground();
464 pGenDraw(x, y, w, h, pixels);
465 return;
466 }
467
468 /**
469 * Copies an area of the canvas that this graphics context paints to.
470 * @param X the x-coordinate of the source.
471 * @param Y the y-coordinate of the source.
472 * @param W the width.
473 * @param H the height.
474 * @param dx the x-coordinate of the destination.
475 * @param dy the y-coordinate of the destination.
476 */
477 public native void copyArea(int X, int Y, int W, int H, int dx, int dy);
478
479
480 /** Draws a rounded rectangle. */
481 private native void pDrawRoundRect(int x, int y, int w, int h,
482 int arcWidth, int arcHeight);
483
484 public void drawRoundRect(int x, int y, int w, int h,
485 int arcWidth, int arcHeight)
486 {
487 ourSetClip();
488 pDrawRoundRect(x,y,w,h,arcWidth,arcHeight);
489 }
490
491 /** Draws a filled rounded rectangle. */
492 private native void pFillRoundRect(int x, int y, int w, int h,
493 int arcWidth, int arcHeight);
494
495 public void fillRoundRect(int x, int y, int w, int h,
496 int arcWidth, int arcHeight)
497 {
498 ourSetClip();
499 pFillRoundRect(x,y,w,h,arcWidth,arcHeight);
500 }
501
502 /** Draws a polygon defined by an array of x points and y points */
503 private native void pDrawPolygon(int xPoints[], int yPoints[], int nPoints);
504
505 public void drawPolygon(int xPoints[], int yPoints[], int nPoints)
506 {
507 ourSetClip();
508 pDrawPolygon(xPoints,yPoints,nPoints);
509 }
510
511 /** Draws a polygon defined by an array of x points and y points */
512 private native void pDrawPolyline(int xPoints[], int yPoints[], int nPoints);
513
514 public void drawPolyline(int xPoints[], int yPoints[], int nPoints)
515 {
516 ourSetClip();
517 pDrawPolyline(xPoints,yPoints,nPoints);
518 }
519
520 /** Fills a polygon with the current fill mask */
521 private native void pFillPolygon(int xPoints[], int yPoints[], int nPoints);
522
523 public void fillPolygon(int xPoints[], int yPoints[], int nPoints)
524 {
525 ourSetClip();
526 pFillPolygon(xPoints,yPoints,nPoints);
527 }
528
529 /** Draws an oval to fit in the given rectangle */
530 private native void pDrawOval(int x, int y, int w, int h);
531
532 public void drawOval(int x, int y, int w, int h)
533 {
534 ourSetClip();
535 pDrawOval(x,y,w,h);
536 }
537
538 /** Fills an oval to fit in the given rectangle */
539 private native void pFillOval(int x, int y, int w, int h);
540
541 public void fillOval(int x, int y, int w, int h)
542 {
543 ourSetClip();
544 pFillOval(x,y,w,h);
545 }
546
547 /**
548 * Draws an arc bounded by the given rectangle from startAngle to
549 * endAngle. 0 degrees is a vertical line straight up from the
550 * center of the rectangle. Positive angles indicate clockwise
551 * rotations, negative angle are counter-clockwise.
552 */
553 private native void pDrawArc(int x, int y, int w, int h,
554 int startAngle,
555 int endAngle);
556
557 public void drawArc(int x, int y, int w, int h,
558 int startAngle,
559 int endAngle)
560 {
561 ourSetClip();
562 pDrawArc(x,y,w,h,startAngle,endAngle);
563 }
564
565 /** fills an arc. arguments are the same as drawArc. */
566 private native void pFillArc(int x, int y, int w, int h,
567 int startAngle,
568 int endAngle);
569
570 public void fillArc(int x, int y, int w, int h,
571 int startAngle,
572 int endAngle)
573 {
574 ourSetClip();
575 pFillArc(x,y,w,h,startAngle,endAngle);
576 }
577
578
579 public String toString() {
580 return (getClass().getName() + "[" + originX + "," + originY +
581 "[font=" + getFont() + "], color=" + getColor() + "]");
582 }
583
584 // Print a peer using this graphics object.
585 void print(ComponentPeer peer)
586 {
587 }
588
589 /* Outline the given region. */
590 //public native void drawRegion(Region r);
591
592 /* Fill the given region. */
593 //public native void fillRegion(Region r);
594
595 /** Terminates a PrintJob and releases resources */
596 public void close(PrintJob pj)
597 {
598 }
599
600 private native void copyOffscreenImage(int X, int Y, int W, int H);
601
602}
603
604
605
606
java/pkg/awt/iGraphics_L.b+245−0
@@ -0,0 +1,245 @@
1implement iGraphics_L;
2
3include "jni.m";
4 jni : JNI;
5 ClassModule,
6 JString,
7 JArray,
8 JArrayI,
9 JArrayC,
10 JArrayB,
11 JArrayS,
12 JArrayJ,
13 JArrayF,
14 JArrayD,
15 JArrayZ,
16 JArrayJObject,
17 JArrayJClass,
18 JArrayJString,
19 JClass,
20 JThread,
21 JObject : import jni;
22
23#>> extra pre includes here
24#
25# %W% - %E%
26#
27 sys : Sys;
28 draw: Draw;
29 Point, Font: import draw;
30include "awt_Graphics.m";
31
32include "iFontPeer_L.m";
33 ifontpeerm: iFontPeer_L;
34 iFontPeer_obj : import ifontpeerm;
35
36#<<
37
38include "iGraphics_L.m";
39
40#>> extra post includes here
41
42#<<
43
44init( jni_p : JNI )
45{
46 # save java native inteface mod instance
47 jni = jni_p;
48 #>>extra initialization here
49 sys = jni->sys;
50
51 #<<
52}
53
54
55pSetForeground_I_I_I_V( this : ref iGraphics_obj, p0 : int,p1 : int,p2 : int)
56{#>>
57 this.awt->setForeground(p0, p1, p2);
58}#<<
59
60createGraphics_V( this : ref iGraphics_obj)
61{#>>
62 this.awt = load AwtGraphics AwtGraphics->PATH;;
63 if (this.awt == nil) {
64 sys->print("could not load %s: %r\n", AwtGraphics->PATH);
65 return;
66 }
67 this.awt->init(this.refImage, this.refOffScreenImage);
68}#<<
69
70pDispose_V( this : ref iGraphics_obj)
71{#>>
72}#<<
73
74setPaintMode_V( this : ref iGraphics_obj)
75{#>>
76}#<<
77
78setXORMode_rColor_V( this : ref iGraphics_obj, p0 : JObject)
79{#>>
80}#<<
81
82changeClip_I_I_I_I_Z_V( this : ref iGraphics_obj, p0 : int,p1 : int,p2 : int,p3 : int,p4 : int)
83{#>>
84 this.awt->changeClip(p0 + this.originX, p1 + this.originY, p2, p3);
85}#<<
86
87pClearRect_I_I_I_I_V( this : ref iGraphics_obj, p0 : int,p1 : int,p2 : int,p3 : int)
88{#>>
89 this.awt->clearRect(p0 + this.originX, p1 + this.originY, p2, p3);
90}#<<
91
92pFillRect_I_I_I_I_V( this : ref iGraphics_obj, p0 : int,p1 : int,p2 : int,p3 : int)
93{#>>
94
95 tp := (p0, p1);
96 p := dp(this, tp);
97
98 ply := array [5] of {p, (p.x + p2 - 1, p.y), (p.x + p2 - 1, p.y + p3 - 1),
99 (p.x, p.y + p3 - 1), p};
100 this.awt->fillRect(ply);
101}#<<
102
103pDrawRect_I_I_I_I_V( this : ref iGraphics_obj, p0 : int,p1 : int,p2 : int,p3 : int)
104{#>>
105 tp := (p0, p1);
106 p := dp(this, tp);
107
108 ply := array [5] of {p, (p.x + p2 - 1, p.y), (p.x + p2 - 1, p.y + p3 - 1),
109 (p.x, p.y + p3 - 1), p};
110 this.awt->drawRect(ply);
111}#<<
112
113pDrawStringWidth_rString_I_I_I( this : ref iGraphics_obj, p0 : JString,p1 : int,p2 : int) : int
114{#>>
115 str : string;
116 sp : Point;
117 sp.x = p1;
118 sp.y = p2;
119
120 str = p0.str;
121 sp = dp(this, sp);
122 return this.awt->drawStringWidth(str, sp, this.ifontpeer.iFontRef );
123}#<<
124
125pDrawLine_I_I_I_I_V( this : ref iGraphics_obj, p0 : int,p1 : int,p2 : int,p3 : int)
126{#>>
127 sp, ep : Point;
128 sp.x = this.originX + p0;
129 sp.y = this.originY + p1;
130 ep.x = this.originX + p2;
131 ep.y = this.originY + p3;
132 this.awt->drawLine(sp, ep);
133}#<<
134
135pGenDraw_I_I_I_I_aB_V( this : ref iGraphics_obj, p0 : int,p1 : int,p2 : int,p3 : int, p4 : JArrayB)
136{#>>
137 p0 += this.originX;
138 p1 += this.originY;
139 r := Draw->Rect((p0,p1),(p0+p2,p1+p3));
140 this.awt->genDraw(r, p4.ary);
141}#<<
142
143copyArea_I_I_I_I_I_I_V( this : ref iGraphics_obj, p0 : int,p1 : int,p2 : int,p3 : int,p4 : int,p5 : int)
144{#>>
145 data := array [(p2 - p0 + 1) * (p3 - p1 + 1)] of byte;
146 rect0, rect1 : Draw->Rect;
147 rect0.min = (p0, p1);
148 rect0.max = (p2, p3);
149 rect1.min = (p0 + p4, p1 + p5);
150 rect1.max = (p2 + p4, p3 + p5);
151 this.awt->copyArea(rect0, rect1, data);
152}#<<
153
154pDrawRoundRect_I_I_I_I_I_I_V( this : ref iGraphics_obj, p0 : int,p1 : int,p2 : int,p3 : int,p4 : int,p5 : int)
155{#>>
156}#<<
157
158pFillRoundRect_I_I_I_I_I_I_V( this : ref iGraphics_obj, p0 : int,p1 : int,p2 : int,p3 : int,p4 : int,p5 : int)
159{#>>
160}#<<
161
162pDrawPolygon_aI_aI_I_V( this : ref iGraphics_obj, p0 : JArrayI,p1 : JArrayI,p2 : int)
163{#>>
164 ply := array [p2 + 1] of Point;
165 for (i := 0; i < p2; i++){
166 ply[i].x = p0.ary[i] + this.originX;
167 ply[i].y = p1.ary[i] + this.originY;
168 }
169 ply[p2].x = ply[0].x;
170 ply[p2].y = ply[0].y;
171 this.awt->drawPolygon(ply);
172}#<<
173
174pDrawPolyline_aI_aI_I_V( this : ref iGraphics_obj, p0 : JArrayI,p1 : JArrayI,p2 : int)
175{#>>
176 ply := array [p2] of Point;
177 for (i := 0; i < p2; i++){
178 ply[i].x = p0.ary[i] + this.originX;
179 ply[i].y = p1.ary[i] + this.originY;
180 }
181 this.awt->drawPolygon(ply);
182}#<<
183
184pFillPolygon_aI_aI_I_V( this : ref iGraphics_obj, p0 : JArrayI,p1 : JArrayI,p2 : int)
185{#>>
186 ply := array [p2 + 1] of Point;
187 for (i := 0; i < p2; i++){
188 ply[i].x = p0.ary[i] + this.originX;
189 ply[i].y = p1.ary[i] + this.originY;
190 }
191 ply[p2].x = ply[0].x;
192 ply[p2].y = ply[0].y;
193 this.awt->fillPolygon(ply);
194}#<<
195
196pDrawOval_I_I_I_I_V( this : ref iGraphics_obj, p0 : int,p1 : int,p2 : int,p3 : int)
197{#>>
198 tp := (p0, p1);
199 p := dp(this, tp);
200 this.awt->drawOval(p, p2, p3);
201}#<<
202
203pFillOval_I_I_I_I_V( this : ref iGraphics_obj, p0 : int,p1 : int,p2 : int,p3 : int)
204{#>>
205 tp := (p0, p1);
206 p := dp(this, tp);
207
208 this.awt->fillOval(p, p2, p3);
209}#<<
210
211pDrawArc_I_I_I_I_I_I_V( this : ref iGraphics_obj, p0 : int,p1 : int,p2 : int,p3 : int,p4 : int,p5 : int)
212{#>>
213
214 tp := (p0, p1);
215 p := dp(this, tp);
216 this.awt->drawArc(p, p2, p3, p4, p5);
217}#<<
218
219pFillArc_I_I_I_I_I_I_V( this : ref iGraphics_obj, p0 : int,p1 : int,p2 : int,p3 : int,p4 : int,p5 : int)
220{#>>
221 tp := (p0, p1);
222 p := dp(this, tp);
223 this.awt->fillArc(p, p2, p3, p4, p5);
224}#<<
225
226copyOffscreenImage_I_I_I_I_V( this : ref iGraphics_obj, p0 : int, p1: int, p2: int, p3: int)
227{#>>
228 this.awt->getDC(this.refImage, this.refOffScreenImage);
229 this.awt->sendToDisplay(((p0+this.originX,p1+this.originY),
230 (p0+this.originX+p2-1,p1+this.originY+p3-1)));
231}#<<
232
233
234#>>
235
236# duplicates a point and translates into this graphic's region
237dp(this : ref iGraphics_obj, p : Point) :Point
238{
239 pt := p;
240 pt.x += this.originX;
241 pt.y += this.originY;
242 return pt;
243}
244
245#<<
java/pkg/awt/iGraphics_L.m+50−0
@@ -0,0 +1,50 @@
1#
2# %W% - %E%
3#
4# generated file edit with care
5
6iGraphics_L : module
7{
8 iGraphics_obj : adt
9 {
10 cl_mod : ClassModule;
11 refImage : ref Draw->Image;
12 refOffScreenImage : ref Draw->Image;
13 target : JObject;
14 foreground : JObject;
15 font : JObject;
16 ifontpeer : ref iFontPeer_obj;
17 originX : int;
18 originY : int;
19 clipRect : JObject;
20 initialClipRect : JObject;
21 dirty : int;
22 image : JObject;
23 awt : AwtGraphics;
24 };
25
26 init : fn( jni_p : JNI );
27 pSetForeground_I_I_I_V : fn( this : ref iGraphics_obj, p0 : int,p1 : int,p2 : int);
28 createGraphics_V : fn( this : ref iGraphics_obj);
29 pDispose_V : fn( this : ref iGraphics_obj);
30 setPaintMode_V : fn( this : ref iGraphics_obj);
31 setXORMode_rColor_V : fn( this : ref iGraphics_obj, p0 : JObject);
32 changeClip_I_I_I_I_Z_V : fn( this : ref iGraphics_obj, p0 : int,p1 : int,p2 : int,p3 : int,p4 : int);
33 pClearRect_I_I_I_I_V : fn( this : ref iGraphics_obj, p0 : int,p1 : int,p2 : int,p3 : int);
34 pFillRect_I_I_I_I_V : fn( this : ref iGraphics_obj, p0 : int,p1 : int,p2 : int,p3 : int);
35 pDrawRect_I_I_I_I_V : fn( this : ref iGraphics_obj, p0 : int,p1 : int,p2 : int,p3 : int);
36 pDrawStringWidth_rString_I_I_I : fn( this : ref iGraphics_obj, p0 : JString,p1 : int,p2 : int) : int;
37 pDrawLine_I_I_I_I_V : fn( this : ref iGraphics_obj, p0 : int,p1 : int,p2 : int,p3 : int);
38 pGenDraw_I_I_I_I_aB_V : fn( this : ref iGraphics_obj, p0 : int,p1 : int,p2 : int,p3 : int,p4 : JArrayB);
39 copyArea_I_I_I_I_I_I_V : fn( this : ref iGraphics_obj, p0 : int,p1 : int,p2 : int,p3 : int,p4 : int,p5 : int);
40 pDrawRoundRect_I_I_I_I_I_I_V : fn( this : ref iGraphics_obj, p0 : int,p1 : int,p2 : int,p3 : int,p4 : int,p5 : int);
41 pFillRoundRect_I_I_I_I_I_I_V : fn( this : ref iGraphics_obj, p0 : int,p1 : int,p2 : int,p3 : int,p4 : int,p5 : int);
42 pDrawPolygon_aI_aI_I_V : fn( this : ref iGraphics_obj, p0 : JArrayI,p1 : JArrayI,p2 : int);
43 pDrawPolyline_aI_aI_I_V : fn( this : ref iGraphics_obj, p0 : JArrayI,p1 : JArrayI,p2 : int);
44 pFillPolygon_aI_aI_I_V : fn( this : ref iGraphics_obj, p0 : JArrayI,p1 : JArrayI,p2 : int);
45 pDrawOval_I_I_I_I_V : fn( this : ref iGraphics_obj, p0 : int,p1 : int,p2 : int,p3 : int);
46 pFillOval_I_I_I_I_V : fn( this : ref iGraphics_obj, p0 : int,p1 : int,p2 : int,p3 : int);
47 pDrawArc_I_I_I_I_I_I_V : fn( this : ref iGraphics_obj, p0 : int,p1 : int,p2 : int,p3 : int,p4 : int,p5 : int);
48 pFillArc_I_I_I_I_I_I_V : fn( this : ref iGraphics_obj, p0 : int,p1 : int,p2 : int,p3 : int,p4 : int,p5 : int);
49 copyOffscreenImage_I_I_I_I_V : fn( this : ref iGraphics_obj, p0 : int, p1: int, p2: int, p3: int);
50};
java/pkg/awt/iImage.java+51−0
@@ -0,0 +1,51 @@
1/*
2 *
3 * %W% - %E%
4 *
5 * Adapted from SunSoft's X11Image.java 1.7 97/02/24
6 */
7package inferno.awt;
8
9import java.awt.Component;
10import java.awt.Graphics;
11import java.awt.image.ImageProducer;
12
13import sun.awt.image.ImageRepresentation;
14
15class iImage extends sun.awt.image.Image {
16 /**
17 * Construct an image for offscreen rendering to be used with a
18 * given Component.
19 */
20 public iImage(Component c, int w, int h) {
21 super(c, w, h);
22 }
23
24 /**
25 * Construct an image from an ImageProducer object.
26 */
27 public iImage(ImageProducer producer) {
28 super(producer);
29 }
30
31 public Graphics getGraphics() {
32 throw new IllegalAccessError("getGraphics() only valid for images created with createImage(w, h)");
33 }
34
35 protected ImageRepresentation makeImageRep() {
36 // make Inferno ImageRepresentation - jfs
37 //return new ImageRepresentation(this, -1, -1, 0);
38 return new iImageRepresentation(this, -1, -1, 0);
39 }
40
41 protected ImageRepresentation getImageRep() {
42 return super.getImageRep();
43 }
44
45 // overridden strictly for tracing and debugging. - jfs
46 protected void initGraphics(Graphics g) {
47 System.out.println("iImage.initGraphics() this=" + this +
48 "\n g=" + g);
49 super.initGraphics(g);
50 }
51}
java/pkg/awt/iImageConsumer.java+0−0

Empty file added.

java/pkg/awt/iImageRepresentation.java+91−0
@@ -0,0 +1,91 @@
1/*
2 *
3 */
4
5package inferno.awt;
6
7import java.awt.Color;
8import java.awt.Graphics;
9//import java.awt.AWTException;
10//import java.awt.Rectangle;
11import java.awt.image.ColorModel;
12import java.awt.image.ImageConsumer;
13import java.awt.image.ImageObserver;
14import sun.awt.image.ImageWatched;
15import sun.awt.image.Image;
16//import sun.awt.AWTFinalizeable;
17//import sun.awt.AWTFinalizer;
18//import java.util.Hashtable;
19
20/*
21 * This implementation the implementation class for Sun's
22 * sun.awt.image.ImageRepresentation.
23 * - jfs
24 */
25public class iImageRepresentation extends sun.awt.image.ImageRepresentation
26{
27 /* ref Draw->Image, used by native code */
28 Object piImage;
29
30 /**
31 * Create an ImageRepresentation for the given Image scaled
32 * to the given width and height and dithered or converted to
33 * a ColorModel appropriate for the given image tag.
34 */
35 //public iImageRepresentation(Image im, int w, int h, int t) {
36 public iImageRepresentation(iImage im, int w, int h, int t) {
37 super(im, w, h, t);
38 System.out.println("iImageRep.iImagRep(): w=" + w + " h=" + h +
39 "t=" + t + "im=" + im);
40 }
41 /**
42 * Initialize this ImageRepresentation object to act as the
43 * destination drawable for this OffScreen Image.
44 */
45 protected native void offscreenInit(Color bg);
46
47 /* make Inferno's own ImageRepresentation - jfs
48 private native boolean setBytePixels(int x, int y, int w, int h,
49 ColorModel model,
50 byte pix[], int off, int scansize);
51 */
52 protected native boolean setBytePixels(int x, int y, int w, int h,
53 ColorModel model,
54 byte pix[], int off, int scansize);
55
56 /* make Inferno's own ImageRepresentation - jfs
57 private native boolean setIntPixels(int x, int y, int w, int h,
58 ColorModel model,
59 int pix[], int off, int scansize);
60 */
61 protected native boolean setIntPixels(int x, int y, int w, int h,
62 ColorModel model,
63 int pix[], int off, int scansize);
64
65 /* make Inferno's own ImageRepresentation - jfs
66 private native boolean finish(boolean force);
67 */
68 protected native boolean finish(boolean force);
69
70 /* make Inferno's own ImageRepresentation - jfs
71 native synchronized void imageDraw(Graphics g, int x, int y, Color c);
72
73 */
74 native protected synchronized void imageDraw(Graphics g, int x, int y, Color c);
75
76 /* make Inferno's own ImageRepresentation - jfs
77 native synchronized void imageStretch(Graphics g,
78 int dx1, int dy1, int dx2, int dy2,
79 int sx1, int sy1, int sx2, int sy2,
80 Color c);
81 */
82 native protected synchronized void imageStretch(Graphics g,
83 int dx1, int dy1, int dx2, int dy2,
84 int sx1, int sy1, int sx2, int sy2,
85 Color c);
86
87 /* make Inferno's own ImageRepresentation - jfs
88 private native void disposeImage();
89 */
90 protected native void disposeImage();
91}
java/pkg/awt/iImageRepresentation_L.b+152−0
@@ -0,0 +1,152 @@
1implement iImageRepresentation_L;
2
3# javal v1.5 generated file: edit with care
4
5include "jni.m";
6 jni : JNI;
7 ClassModule,
8 JString,
9 JArray,
10 JArrayI,
11 JArrayC,
12 JArrayB,
13 JArrayS,
14 JArrayJ,
15 JArrayF,
16 JArrayD,
17 JArrayZ,
18 JArrayJObject,
19 JArrayJClass,
20 JArrayJString,
21 JClass,
22 JThread,
23 JObject : import jni;
24
25#>> extra pre includes here
26
27#<<
28
29include "iImageRepresentation_L.m";
30
31#>> extra post includes here
32 sys : import jni; # std Inferno Sys module
33 str : import jni; # std Inferno String module
34
35 FALSE : import jni;
36 TRUE : import jni;
37
38 # draw.m in included by something included by jni.m
39 draw : Draw;
40 Context, Screen, Display, Rect, Point, Image : import draw;
41 ctxt: ref Context;
42
43include "awt_Image.m";
44
45 awtIm : AwtImage;
46
47 # Some constants that aggregate status state.
48 IM_SIZEINFO: con (awtIm->ImO_WIDTH | awtIm->ImO_HEIGHT);
49 IM_DRAWINFO: con (awtIm->ImO_WIDTH | awtIm->ImO_HEIGHT |
50 awtIm->ImO_SOMEBITS);
51 IM_FULLDRAWINFO: con (awtIm->ImO_FRAMEBITS | awtIm->ImO_ALLBITS);
52 IM_OFFSCREENINFO: con (awtIm->ImO_WIDTH | awtIm->ImO_HEIGHT |
53 awtIm->ImO_SOMEBITS | awtIm->ImO_ALLBITS);
54
55 # Some constants that aggregate hints state
56 HINT_OFFSCREENSEND: con (awtIm->ImC_TOPDOWNLEFTRIGHT |
57 awtIm->ImC_COMPLETESCANLINES |
58 awtIm->ImC_SINGLEPASS);
59
60include "awt_Color.m";
61 awtColor : AwtColor;
62
63#<<
64
65init( jni_p : JNI )
66{
67 # save java native inteface mod instance
68 jni = jni_p;
69 #>>extra initialization here
70 sys = jni->sys;
71 draw = load Draw Draw->PATH;
72 if (draw == nil) {
73 jni->InitError(sys->sprint(
74 "inferno.awt.iImageRepresentation: could not load %s: %r",
75 Draw->PATH));
76 }
77 awtColor = load AwtColor AwtColor->PATH;
78 if (awtColor == nil) {
79 jni->InitError(sys->sprint(
80 "inferno.awt.iImageRepresentation: could not load %s: %r",
81 AwtColor->PATH));
82 }
83 ctxt = jni->getContext();
84 #<<
85}
86
87offscreenInit_rColor_V( this : ref iImageRepresentation_obj, p0 : JObject)
88{#>>
89 # Type(p0) is java.awt.Color
90 # bgcolorim := ctxt.display.color(Draw->White); # default
91 bgcoloridx := Draw->White;
92 if (p0 == nil) {
93 sys->print("iImageRepresentation_L.offscreenInit(): p0 == nil!\n");
94 } else {
95 # get the colormap index for this Java Color
96 bgcoloridx = awtColor->getColorIndex(jni, p0);
97 }
98 bgcoloridx = Draw->White; # for testing... - jfs
99 if (this.width <= 0 || this.height <=0) {
100 jni->ThrowException("java.lang.IllegalArgumentException", "offscreen w and h < 0");
101 }
102 # create an Inferno Image for double buffer store.
103 ldeep := ctxt.display.image.ldepth;
104 this.piImage = ctxt.display.newimage(Draw->Rect(
105 (0,0),(this.width,this.height)),
106 ldeep, 0, bgcoloridx);
107 sys->print("iImageRepresentation_L.offscreenInit(): - this=%x, piImage=%x!\n",
108 this, this.piImage);
109}#<<
110
111setBytePixels_I_I_I_I_rColorModel_aB_I_I_Z( this : ref iImageRepresentation_obj, p0 : int,p1 : int,p2 : int,p3 : int,p4 : JObject,p5 : JArrayB,p6 : int,p7 : int) : int
112{#>>
113 # not yet implemented, so keep the type system happy by returning
114 # FALSE as nothing was done
115 sys->print("iImageRepresentation_L.setBytePixels(): - NYI!\n");
116 return(FALSE);
117}#<<
118
119setIntPixels_I_I_I_I_rColorModel_aI_I_I_Z( this : ref iImageRepresentation_obj, p0 : int,p1 : int,p2 : int,p3 : int,p4 : JObject,p5 : JArrayI,p6 : int,p7 : int) : int
120{#>>
121 # not yet implemented, so keep the type system happy by returning
122 # FALSE as nothing was done
123 sys->print("iImageRepresentation_L.setIntPixels(): - NYI!\n");
124 return(FALSE);
125}#<<
126
127finish_Z_Z( this : ref iImageRepresentation_obj, p0 : int) : int
128{#>>
129 # not yet implemented, so just return false so the calling code
130 # wont try a resend in TopDownLeftRight order...
131 sys->print("iImageRepresentation_L.finish(): - NYI!\n");
132 return(FALSE);
133}#<<
134
135imageDraw_rGraphics_I_I_rColor_V( this : ref iImageRepresentation_obj, p0 : JObject,p1 : int,p2 : int,p3 : JObject)
136{#>>
137 sys->print("iImageRepresentation_L.imageDraw(): - NYI!\n");
138}#<<
139
140imageStretch_rGraphics_I_I_I_I_I_I_I_I_rColor_V( this : ref iImageRepresentation_obj, p0 : JObject,p1 : int,p2 : int,p3 : int,p4 : int,p5 : int,p6 : int,p7 : int,p8 : int,p9 : JObject)
141{#>>
142 sys->print("iImageRepresentation_L.imageStretch(): - NYI!\n");
143}#<<
144
145disposeImage_V( this : ref iImageRepresentation_obj)
146{#>>
147 this.piImage = nil;
148 sys->print("iImageRepresentation_L.disposeImage(): - NYI!\n");
149}#<<
150
151
152
java/pkg/awt/iImageRepresentation_L.m+36−0
@@ -0,0 +1,36 @@
1# javal v1.5 generated file: edit with care
2
3iImageRepresentation_L : module
4{
5 iImageRepresentation_obj : adt
6 {
7 cl_mod : ClassModule;
8 watchers : JObject; # type java.lang.Vector;
9 pData : int;
10 src : JObject; # type sun.awt.image.InputStreamImageSource
11 image : JObject; # type sun.awt.image.Image
12 tag : int;
13 srcW : int;
14 srcH : int;
15 width : int;
16 height : int;
17 hints : int;
18 availinfo : int;
19 offscreen : byte;
20 newbits : JObject; # type java.awt.Rectangle
21 consuming : byte;
22 numWaiters : int;
23 finalnext : JObject; # type sun.awt.AWTFinalizeable
24 piImage : ref Draw->Image;
25 };
26
27 init : fn( jni_p : JNI );
28 offscreenInit_rColor_V : fn( this : ref iImageRepresentation_obj, p0 : JObject);
29 setBytePixels_I_I_I_I_rColorModel_aB_I_I_Z : fn( this : ref iImageRepresentation_obj, p0 : int,p1 : int,p2 : int,p3 : int,p4 : JObject,p5 : JArrayB,p6 : int,p7 : int) : int;
30 setIntPixels_I_I_I_I_rColorModel_aI_I_I_Z : fn( this : ref iImageRepresentation_obj, p0 : int,p1 : int,p2 : int,p3 : int,p4 : JObject,p5 : JArrayI,p6 : int,p7 : int) : int;
31 finish_Z_Z : fn( this : ref iImageRepresentation_obj, p0 : int) : int;
32 imageDraw_rGraphics_I_I_rColor_V : fn( this : ref iImageRepresentation_obj, p0 : JObject,p1 : int,p2 : int,p3 : JObject);
33 imageStretch_rGraphics_I_I_I_I_I_I_I_I_rColor_V : fn( this : ref iImageRepresentation_obj, p0 : JObject,p1 : int,p2 : int,p3 : int,p4 : int,p5 : int,p6 : int,p7 : int,p8 : int,p9 : JObject);
34 disposeImage_V : fn( this : ref iImageRepresentation_obj);
35
36};
java/pkg/awt/iImage_L.b+180−0
@@ -0,0 +1,180 @@
1implement iImage_L;
2
3# javal v1.5 generated file: edit with care
4
5include "jni.m";
6 jni : JNI;
7 ClassModule,
8 JString,
9 JArray,
10 JArrayI,
11 JArrayC,
12 JArrayB,
13 JArrayS,
14 JArrayJ,
15 JArrayF,
16 JArrayD,
17 JArrayZ,
18 JArrayJObject,
19 JArrayJClass,
20 JArrayJString,
21 JClass,
22 JThread,
23 JObject : import jni;
24
25#>> extra pre includes here
26
27#
28# %W% - %E%
29#
30
31#<<
32
33include "iImage_L.m";
34
35#>> extra post includes here
36
37draw : Draw;
38
39#include "image2enc.m";
40# image2enc : Image2enc;
41
42include "imagefile.m";
43 readimg : RImagefile;
44 imageremap : Imageremap;
45
46include "bufio.m";
47 B :Bufio;
48
49#<<
50
51init( jni_p : JNI )
52{
53 # save java native inteface mod instance
54 jni = jni_p;
55 #>>extra initialization here
56 #<<
57}
58
59getImage_V( this : ref iImage_obj)
60{#>>
61 # Open a file descriptor from which we can read a picture.
62 #
63 file : string;
64 fd : ref Sys->FD;
65 if ( this.file != nil ) {
66 file = this.file.str;
67 fd = jni->sys->open(file, Sys->OREAD);
68 if ( fd == nil )
69 jni->ThrowException("java/io/IOException", jni->sys->sprint("%r"));
70 }
71 else if ( this.url != nil ) { # Try to open a network connection
72 # file = some component of the URL
73 return; # later.
74 }
75 else
76 return;
77
78 B = load Bufio Bufio->PATH;
79 if ( B == nil )
80 return;
81
82 iobuf := B->fopen(fd, Bufio->OREAD);
83 if ( (imagetype := guesstype(file)) == nil )
84 return;
85
86 imgarr : array of byte;
87 (this.width, this.height, imgarr) = convert_img(iobuf, imagetype);
88 this.imgbytes = jni->MkAByte(imgarr);
89}#<<
90
91#
92# Guess the file type from the suffix
93#
94guesstype(name : string) : string
95{
96 imagetype : string;
97 (nil, suffix) := jni->str->splitr(name, ".");
98 case suffix {
99 "gif" => imagetype = "IMAGE/GIF";
100 "pic" => imagetype = "IMAGE/PICT";
101 "jpg" or "jpeg" => imagetype = "IMAGE/JPEG";
102 "bit" or "mask" => imagetype = "IMAGE/X-INFERNO-BIT";
103 "xbm" or "xbmp" => imagetype = "IMAGE/X-XBITMAP";
104 }
105 return imagetype;
106}
107
108#
109# Convert the image into the Inferno bit format
110# Return image height, width and the image(array of bytes)
111# Uses readgif.b/readjpg.b/readxbitmap.b/readpic.b and image2enc.b
112#
113convert_img(fd : ref Bufio->Iobuf, imagetype: string): (int, int, array of byte)
114{
115 # Initialization
116
117 case imagetype {
118 "IMAGE/GIF" => readimg = load RImagefile RImagefile->READGIFPATH;
119 "IMAGE/JPEG" => readimg = load RImagefile RImagefile->READJPGPATH;
120 "IMAGE/X-XBITMAP" => readimg = load RImagefile RImagefile->READXBMPATH;
121 "IMAGE/X-PICT" => readimg = load RImagefile RImagefile->READPICPATH;
122 "IMAGE/X-INFERNO-BIT" => # What to do here?
123 * => return(-1,-1,nil);
124 }
125
126 if ( readimg == nil )
127 return(-1,-1,nil);
128
129 readimg->init(B);
130 rawimg : ref RImagefile->Rawimage;
131
132 # Read image [gif/jpg/xbm/pic]
133 err_readimg: string;
134 (rawimg, err_readimg) = readimg->read(fd);
135 readimg = nil; # memory control
136
137 # Error check
138 if (err_readimg != "" ) {
139 return(-1,-1,nil);
140 }
141
142 # Image2enc
143# image2enc = load Image2enc Image2enc->PATH;
144# if ( image2enc == nil )
145# return (-1, -1, nil);
146# (data, mask, err_enc) := image2enc->image2enc(rawimg, 1);
147
148 # Error check
149# if (err_enc != "" ) {
150# return(-1,-1,nil);
151# }
152
153 # Masking
154# if (mask != nil) {
155# newdata := array[len data + len mask] of byte;
156# newdata[0:] = data[0:];
157# newdata[len data:] = mask[0:];
158# data = newdata;
159# }
160
161 # Make Inferno image
162 imageremap = load Imageremap Imageremap->PATH;
163 draw = load Draw Draw->PATH;
164 Image, Context : import draw;
165 if ( imageremap == nil || draw == nil )
166 return (-1, -1, nil);
167 (img, err_remap) := imageremap->remap(rawimg, jni->getContext().display, 0);
168 if ( img == nil )
169 return (-1, -1, nil);
170
171 # Determine image size
172 wd := (rawimg.r.max.x - rawimg.r.min.x);
173 ht := (rawimg.r.max.y - rawimg.r.min.y);
174
175 data := array[wd*ht] of byte; # what if depth != 3 ?
176 img.readpixels(img.r, data);
177
178 # Return width, height and image
179 return(wd, ht, data);
180}
java/pkg/awt/iImage_L.m+26−0
@@ -0,0 +1,26 @@
1#
2# %W% - %E%
3#
4
5# javal v1.5 generated file: edit with care
6
7iImage_L : module
8{
9 iImage_obj : adt
10 {
11 cl_mod : ClassModule;
12 width : int;
13 height : int;
14 file : JString;
15 url : JObject;
16 imgbytes : JArrayB;
17 properties : JObject;
18 q : JObject;
19 consumers : JObject;
20 fd : ref Sys->FD;
21 };
22
23 init : fn( jni_p : JNI );
24 getImage_V : fn( this : ref iImage_obj);
25
26};
java/pkg/awt/iMenuBarPeer.java+906−0
@@ -0,0 +1,906 @@
1package inferno.awt;
2
3import java.awt.*;
4import java.awt.event.*;
5import java.awt.peer.*;
6
7public class iMenuBarPeer implements
8MenuBarPeer,MouseListener,MouseMotionListener,zMenuParent {
9 MenuBar target;
10 int height;
11 zMenuBarObject selectedMenuObject;
12 zMenuBarObject menuObjects[];
13 int menuObjectCount;
14 Window child;
15
16 public void closeChild(Window w)
17 {
18 // Called from child via zMenuParent interface to
19 // close itself down. Since Window may take some time to
20 // close down, check to see if we are still the child window
21 // not the previous window
22 if (child!=null && child==w)
23 {
24
25 child.setVisible(false); // Hide Window
26 child.dispose(); // Destroy window
27 child=null; // Lose reference to Window
28 if (selectedMenuObject!=null)
29 {
30 // If menu item selected, display not selected
31 Frame frm=(Frame)target.getParent();
32 Graphics g=frm.getGraphics();
33 selectedMenuObject.paint(g,0);
34 g.dispose();
35 }
36 }
37 }
38
39 public void closeEverything()
40 {
41 // Close our child
42 closeChild(child);
43 }
44
45 void create(Frame f)
46 {
47 // Calculate sizes
48 recalculate();
49 }
50
51 public iMenuBarPeer(MenuBar target) {
52 Frame frm=(Frame)target.getParent();
53 frm.addMouseListener(this);
54 frm.addMouseMotionListener(this);
55 this.target = target;
56 create(frm);
57 }
58
59 // Required by MenuBarPeer interface but not used
60 public void dispose()
61 {
62 }
63
64 public void addMenu(Menu m) {
65 // Calculate sizes
66 recalculate();
67 }
68
69 public void delMenu(int index) {
70 // Calculate sizes
71 recalculate();
72 }
73
74 public void addHelpMenu(Menu m) {
75 // Calculate sizes
76 recalculate();
77 }
78
79 // Calculate height of menubar
80 public int getHeight()
81 {
82 height=0;
83
84 if (target!=null)
85 {
86 Frame frm=(Frame)target.getParent();
87 for (int i=target.getMenuCount()-1;i>=0;--i)
88 {
89 Menu m=target.getMenu(i);
90 Font f=m.getFont();
91 FontMetrics fm=frm.getFontMetrics(f);
92
93 height=Math.max(height,fm.getHeight()+2);
94 }
95 }
96 return height;
97 }
98
99 public void recalculate()
100 {
101 // Create all the objects
102 if (target!=null)
103 {
104 Frame frm=(Frame)target.getParent();
105 Rectangle d=frm.getBounds();
106 Insets is=frm.getInsets();
107 Menu hm=target.getHelpMenu();
108
109 selectedMenuObject=null;
110 menuObjects=null;
111 menuObjectCount=target.getMenuCount();
112 if (menuObjectCount!=0)
113 {
114 int x=is.left;
115 int y=is.top-height;
116 menuObjects=new zMenuBarObject[menuObjectCount];
117
118
119 for (int i=0;i<menuObjectCount;i++)
120 {
121 int w,xx;
122 Menu m=target.getMenu(i);
123 Font f=m.getFont();
124 if (f==null)
125 {
126 w=0;
127 xx=0;
128 }
129 else
130 {
131 FontMetrics fm=frm.getFontMetrics(f);
132 w=fm.stringWidth(" "+m.getLabel()+" ")+2;
133
134 if (m==hm)
135 {
136 xx=d.width-is.right-w;
137 }
138 else
139 {
140 xx=x;
141 x+=w;
142 }
143
144 }
145 menuObjects[i]=new zMenuBarObject(m,new Rectangle(xx,y,w,height));
146
147 }
148 }
149
150 }
151 }
152
153 // Not the Component paint but similar
154 // called from Frame.paint
155 public void paint(Graphics gg)
156 {
157 Frame frm=(Frame)target.getParent();
158 Insets is=frm.getInsets();
159 Rectangle d=frm.getBounds();
160 int y=is.top-height;
161 int x=is.left;
162 int w=d.width-is.left-is.right;
163 int h=height;
164 Graphics g=gg.create();
165
166 // Display the menu objects
167 g.setClip(x,y,w,h);
168 g.setColor(SystemColor.menu);
169 g.fillRect(x,y,w,h);
170
171 for (int i=0;i<menuObjectCount;i++)
172 menuObjects[i].paint(g);
173
174
175 g.dispose();
176 }
177
178 public void mouseExited(MouseEvent e)
179 {
180 // Deselect if mouse exits window
181 // (Almost certainly never called by inferno)
182 if (selectedMenuObject!=null)
183 {
184 Frame frm=(Frame)target.getParent();
185 Graphics g=frm.getGraphics();
186 selectedMenuObject.paint(g,0);
187 selectedMenuObject=null;
188 g.dispose();
189 }
190 }
191
192 // Required by listener interface but not used
193 public void mouseEntered(MouseEvent e)
194 {
195 }
196
197 // Required by listener interface but not used
198 public void mouseClicked(MouseEvent e)
199 {
200 }
201
202 public void mousePressed(MouseEvent e)
203 {
204 // If within an object (selectMenuObject set by mouseMove)
205 if (selectedMenuObject!=null && selectedMenuObject.area.contains(e.getPoint()))
206 {
207 Frame frm=(Frame)target.getParent();
208 Graphics g=frm.getGraphics();
209 selectedMenuObject.paint(g,-1);
210 g.dispose();
211
212 Menu menu=selectedMenuObject.menu;
213 if(menu != null){
214 Rectangle md=selectedMenuObject.area;
215 Rectangle fd=frm.getBounds();
216 int xoff=md.x;
217 int yoff=md.y+md.height;
218
219 closeChild(child);
220 child=new zMenuWindow(frm,this,menu,xoff,yoff);
221 child.pack();
222 child.setVisible(true);
223 }
224 }
225 else
226 {
227 // Close child window (if any)
228 if (child != null)
229 closeChild(child);
230 // Display deselected
231 if(selectedMenuObject != null){
232 Frame frm=(Frame)target.getParent();
233 Graphics g=frm.getGraphics();
234 selectedMenuObject.paint(g,0);
235 g.dispose();
236 }
237 }
238 }
239
240 // Require by listener interface but not used
241 public void mouseReleased(MouseEvent e)
242 {
243 }
244
245 public void mouseMoved(MouseEvent e)
246 {
247 // Track the mouse movement over the menuObjects
248 // setting selectedMenuObject as appropriate
249 if (selectedMenuObject==null ||
250 !selectedMenuObject.area.contains(e.getPoint()))
251 {
252 Frame frm=(Frame)target.getParent();
253 Graphics g=frm.getGraphics();
254 // if (selectedMenuObject!=null && child==null)
255 if (selectedMenuObject!=null)
256 {
257 selectedMenuObject.paint(g,0);
258 selectedMenuObject=null;
259 }
260
261 for (int i=0;i<menuObjectCount;i++)
262 if (menuObjects[i].area.contains(e.getPoint()))
263 {
264 if (selectedMenuObject!=null)
265 {
266 selectedMenuObject.paint(g,0);
267 selectedMenuObject=null;
268 }
269 if (menuObjects[i].menu.isEnabled())
270 {
271 int mode=1;
272 selectedMenuObject=menuObjects[i];
273 if (child!=null)
274 {
275 Menu menu=selectedMenuObject.menu;
276 Rectangle md=selectedMenuObject.area;
277 Rectangle fd=frm.getBounds();
278 int xoff=md.x;
279 int yoff=md.y+md.height;
280
281 Window newChild=new zMenuWindow(frm,this,menu,xoff,yoff);
282 newChild.pack();
283 newChild.setVisible(true);
284 closeChild(child);
285 child=newChild;
286 mode=-1;
287 }
288
289 selectedMenuObject.paint(g,mode);
290 }
291 break;
292 }
293
294 g.dispose();
295 }
296 }
297
298 // Require by listener interface but not used
299 public void mouseDragged(MouseEvent e)
300 {
301 }
302
303
304}
305
306// This is the object corresponding to the menu items
307// on the menubar
308class zMenuBarObject {
309 Menu menu;
310 Rectangle area;
311 int mode;
312
313 public zMenuBarObject(Menu menu,Rectangle area)
314 {
315 this.menu=menu;
316 this.area=area;
317 this.mode=0;
318 }
319
320 public void paint(Graphics g,int mode)
321 {
322 this.mode=mode;
323 paint(g);
324 }
325
326 // Not the component paint but similar
327 // displays the menu item
328 public void paint(Graphics g)
329 {
330 Font f=menu.getFont();
331 FontMetrics fm=g.getFontMetrics(f);
332
333 g.setColor(SystemColor.menu);
334
335 if (mode!=0)
336 Misc.fill3DRect(area,mode>0,g);
337 else
338 g.fillRect(area.x,area.y,area.width,area.height);
339
340 g.translate(-mode,-mode);
341
342 g.setFont(f);
343 if (menu.isEnabled())
344 {
345 g.setColor(SystemColor.menuText);
346 g.drawString(" "+menu.getLabel(),area.x+1,area.y+fm.getAscent()+1);
347 }
348 else
349 {
350 Misc.drawDisabledString(" "+menu.getLabel(),area.x+1,area.y+fm.getAscent()+1,g);
351
352 }
353
354 g.translate(+mode,+mode);
355
356 }
357
358}
359
360// This the window containing the dropdown menus
361// the painting is done by zMenuDisplay
362// zMenuDisplay returns its size and the Window sizes itself
363// accordingly
364
365class zMenuWindow extends Window implements ComponentListener,zMenuParent{
366 zMenuDisplay menudisplay;
367 zMenuParent ancestor;
368 int xoffset,yoffset;
369
370 public zMenuWindow(Frame f,zMenuParent ancestor,Menu menu,int xoffset,int yoffset)
371{
372 super(f);
373 this.xoffset=xoffset;
374 this.yoffset=yoffset;
375 this.ancestor=ancestor;
376 Point p=f.getLocation();
377 p.translate(this.xoffset,this.yoffset);
378 setLocation(p);
379 f.addComponentListener(this);
380 this.menudisplay=new zMenuDisplay(menu);
381 add(this.menudisplay,BorderLayout.CENTER);
382 }
383
384 public void closeChild(Window w)
385 {
386 if (menudisplay!=null)
387 {
388 if (!menudisplay.gotFocus() && ancestor!=null)
389 ancestor.closeChild(this);
390 else
391 menudisplay.closeChild(w);
392 }
393 }
394
395 public void closeEverything()
396{
397 if (ancestor!=null)
398 ancestor.closeEverything();
399}
400
401 public boolean gotFocus()
402 {
403 if (menudisplay==null)
404 return false;
405 else
406 return menudisplay.gotFocus();
407
408 }
409
410 public void componentHidden(ComponentEvent e)
411 {
412
413 }
414
415 public void componentMoved(ComponentEvent e)
416 {
417 Point p=e.getComponent().getLocation();
418 p.translate(xoffset,yoffset);
419 setLocation(p);
420 }
421
422 public void componentResized(ComponentEvent e)
423 {
424
425 }
426
427 public void componentShown(ComponentEvent e)
428 {
429
430 }
431
432 public void dispose()
433 {
434 if (menudisplay!=null)
435 {
436 menudisplay.closeChild(this);
437 }
438 super.dispose();
439 }
440
441}
442
443// This is the display part of the zMenuWindow
444// it covers the whole window
445
446class zMenuDisplay extends Canvas implements
447MouseListener,MouseMotionListener,
448FocusListener{
449 zMenuObject menuObjects[];
450 zMenuObject selectedMenuObject;
451 zMenuWindow child;
452 int menuObjectCount;
453 Dimension pSize;
454 boolean focus;
455 Menu menu;
456 static Color highlight = SystemColor.controlHighlight;
457 static Color light = SystemColor.controlLtHighlight;
458 static Color medium = SystemColor.controlShadow;
459 static Color dark = SystemColor.controlDkShadow;
460
461
462 static final int TickBoxSize=13;
463
464 static final int TickLabelGap=4;
465
466 static final int SeparatorHeight=6;
467
468
469 public zMenuDisplay(Menu menu)
470
471 {
472 super();
473 setMenu(menu);
474 addMouseListener(this);
475 addMouseMotionListener(this);
476 addFocusListener(this);
477 }
478
479 public boolean isFocusTraversable() {
480 return false;
481 }
482
483
484 void setMenu(Menu menu)
485
486 {
487
488 int maxwidth=0;
489
490 int yy=4;
491
492 int xx=4;
493
494 this.menu=menu;
495
496
497 menuObjectCount=menu.getItemCount();
498
499
500 selectedMenuObject=null;
501
502
503 if (menuObjectCount==0)
504
505 menuObjects=null;
506
507 else
508
509 {
510
511 menuObjects=new zMenuObject[menuObjectCount];
512
513
514 boolean submenu=false;
515
516 for (int i=0;i<menuObjectCount;i++)
517
518 {
519
520 MenuItem mi=menu.getItem(i);
521
522 String label=mi.getLabel();
523 if (!submenu && mi instanceof Menu) submenu=true;
524
525
526 if (!label.equals("-"))
527
528 {
529
530 Font f=mi.getFont();
531
532 FontMetrics fm=getFontMetrics(f);
533
534
535 maxwidth=Math.max(maxwidth,TickBoxSize+TickLabelGap+fm.stringWidth(label));
536
537
538 }
539
540
541 }
542
543 maxwidth+=2; // For outside lines
544
545 if (submenu) maxwidth+=8;
546
547 for (int i=0;i<menuObjectCount;i++)
548 {
549
550 MenuItem mi=menu.getItem(i);
551
552 String label=mi.getLabel();
553 int h;
554
555
556 if (label.equals("-"))
557 {
558 h=SeparatorHeight; // Height
559
560 menuObjects[i]=new zMenuSeparator(new Rectangle(xx,yy,maxwidth,h));
561
562 }
563 else
564 {
565 Font f=mi.getFont();
566 FontMetrics fm=getFontMetrics(f);
567 h=Math.max(fm.getHeight(),TickBoxSize)+4; //Height
568
569 menuObjects[i]=new zMenuText(mi,new Rectangle(xx,yy,maxwidth,h));
570
571 }
572
573 yy+=h;
574
575
576 }
577
578
579 }
580
581 pSize=new Dimension(xx+maxwidth+4,yy+4);
582
583 }
584
585
586 public Dimension getPreferredSize()
587
588 {
589
590 return pSize;
591
592 }
593
594
595 public void paint(Graphics g)
596 {
597 Dimension d=getSize();
598
599 g.setColor(SystemColor.menu);
600
601 Misc.Draw3DArea(0,0,d.width,d.height,g);
602
603 for (int i=0;i<menuObjectCount;i++)
604 menuObjects[i].paint(g,0);
605
606 }
607
608 void closeChild()
609 {
610 closeChild(child);
611 }
612
613 void closeChild(Window w)
614 {
615 if (w!=null && w == child)
616 {
617 w.setVisible(false);
618 w.dispose();
619 w=null;
620 }
621 if (child!=null)
622 {
623 child.setVisible(false);
624 child.dispose();
625 child = null;
626 }
627 }
628
629
630
631 // Required by listener interface but not used
632 public void mouseClicked(MouseEvent e)
633 {
634 }
635
636 // Required by listener interface but not used
637 public void mouseEntered(MouseEvent e)
638 {
639 }
640
641 // Required by listener interface but not used
642 public void mouseExited(MouseEvent e)
643 {
644 }
645
646 // Required by listener interface but not used
647 public void mousePressed(MouseEvent e)
648 {
649 }
650
651 public void mouseReleased(MouseEvent e)
652 {
653 if (selectedMenuObject!=null && selectedMenuObject instanceof zMenuText)
654 {
655 MenuItem menuItem=((zMenuText)selectedMenuObject).item;
656 if (menuItem.isEnabled() && !(menuItem instanceof Menu))
657 {
658 String actionCommand=menuItem.getActionCommand();
659 iToolkit.postEvent(new ActionEvent(menuItem, ActionEvent.ACTION_PERFORMED,
660 actionCommand));
661 zMenuWindow w=(zMenuWindow)getParent();
662 Frame f=(Frame)w.getParent();
663 f.requestFocus();
664 w.closeEverything();
665 }
666 }
667 }
668
669 public void mouseMoved(MouseEvent e)
670 {
671 if (!focus)
672 {
673 focus=true;
674 requestFocus();
675 }
676
677 if (selectedMenuObject==null ||
678 !selectedMenuObject.area.contains(e.getPoint()))
679 {
680 Graphics g=getGraphics();
681 if (selectedMenuObject!=null)
682 {
683 selectedMenuObject.paint(g,0);
684 selectedMenuObject=null;
685 closeChild(child);
686 }
687 for (int i=0;i<menuObjectCount;i++)
688 if (menuObjects[i].area.contains(e.getPoint()))
689 {
690 int mode=1;
691
692 selectedMenuObject=menuObjects[i];
693 if (selectedMenuObject instanceof zMenuText)
694 {
695 zMenuText mo=(zMenuText)selectedMenuObject;
696
697 if (mo.item.isEnabled())
698 {
699 zMenuWindow w=(zMenuWindow)getParent();
700 Frame f=(Frame)w.getParent();
701
702 if (mo.item instanceof Menu)
703 {
704 int xx=w.xoffset+mo.area.x+mo.area.width;
705 int yy=w.yoffset+mo.area.y;
706 Menu menu=(Menu)mo.item;
707
708 mode=-1;
709
710 zMenuWindow newChild=new zMenuWindow(f,w,menu,xx,yy);
711 newChild.pack();
712 newChild.setVisible(true);
713 closeChild(child);
714 child=newChild;
715 }
716 }
717 selectedMenuObject.paint(g,mode);
718 }
719 break;
720 }
721
722 g.dispose();
723 }
724 }
725
726 public void mouseDragged(MouseEvent e)
727 {
728 mouseMoved(e);
729 }
730
731 public boolean gotFocus()
732 {
733 if (focus)
734 return true;
735 else
736 if (child==null)
737 return false;
738 else
739 return child.gotFocus();
740
741 }
742
743 public void focusLost(FocusEvent e)
744 {
745 focus=false;
746 if (!gotFocus())
747 {
748 zMenuWindow m=(zMenuWindow)getParent();
749 if (m.ancestor!=null) m.ancestor.closeChild(m);
750 }
751 }
752
753 public void focusGained(FocusEvent e)
754 {
755 focus=true;
756
757 }
758
759}
760
761// base class for the menuObjects
762
763abstract class zMenuObject {
764 Rectangle area;
765
766 public zMenuObject()
767 {
768 }
769
770 public zMenuObject(Rectangle area)
771 {
772 this.area=area;
773 }
774
775 public abstract void paint(Graphics g,int mode);
776
777}
778
779// Standard item item class
780
781class zMenuText extends zMenuObject {
782 MenuItem item;
783
784public zMenuText(MenuItem item,Rectangle area)
785{
786 super(area);
787 this.item=item;
788}
789
790
791void drawArrow(Graphics g,int x,int y)
792{
793 for (int i=0;i<4;i++)
794 {
795 g.drawLine(x,y+i,x+3-i,y+i);
796 if (i!=0)
797 g.drawLine(x,y-i,x+3-i,y-i);
798 }
799}
800
801public void paint(Graphics g,int mode)
802{
803 Font f=item.getFont();
804 FontMetrics fm=g.getFontMetrics(f);
805 int fa=fm.getAscent();
806 boolean enabled=item.isEnabled();
807 boolean submenu=item instanceof Menu;
808 boolean checked=(item instanceof CheckboxMenuItem?
809 ((CheckboxMenuItem)item).getState():false);
810 String s=item.getLabel();
811 int xx=area.x;
812 int yy=area.y;
813
814 g.setFont(f);
815 if (enabled)
816 {
817 g.setColor(SystemColor.menu);
818 if (mode!=0)
819 Misc.fill3DRect(area,mode>0,g);
820 else
821 g.fillRect(xx,yy,area.width,area.height);
822
823 xx+=2;
824 yy+=2;
825 g.setColor(SystemColor.menuText);
826 g.translate(-mode,-mode);
827 if (checked) Misc.drawTick(g,xx,yy,zMenuDisplay.TickBoxSize);
828
829g.drawString(s,zMenuDisplay.TickBoxSize+zMenuDisplay.TickLabelGap+xx,yy+fa);
830 if (submenu)
831 drawArrow(g,area.x+area.width-6,area.y+area.height/2);
832 g.translate(+mode,+mode);
833 }
834 else
835 {
836 xx+=2;
837 yy+=2;
838 if (checked)
839 {
840 g.setColor(SystemColor.controlLtHighlight);
841 Misc.drawTick(g,xx+1,yy+1,zMenuDisplay.TickBoxSize);
842 g.setColor(SystemColor.controlShadow);
843 Misc.drawTick(g,xx,yy,zMenuDisplay.TickBoxSize);
844 }
845
846Misc.drawDisabledString(s,zMenuDisplay.TickBoxSize+zMenuDisplay.TickLabelGap+xx,yy+fa,g);
847 if (submenu)
848 {
849 g.setColor(SystemColor.controlLtHighlight);
850 drawArrow(g,area.x+area.width-6+1,area.y+area.height/2+1);
851 g.setColor(SystemColor.controlShadow);
852 drawArrow(g,area.x+area.width-6,area.y+area.height/2);
853 }
854 }
855
856
857}
858
859}
860
861// separator bar
862
863class zMenuSeparator extends zMenuObject {
864
865public zMenuSeparator(Rectangle area)
866{
867 super(area);
868}
869
870public void paint(Graphics g,int mode)
871{
872 int y=area.y+zMenuDisplay.SeparatorHeight/2-1;
873
874 g.setColor(zMenuDisplay.medium);
875 g.drawLine(area.x,y,area.x+area.width,y);
876
877 y+=1;
878
879 g.setColor(zMenuDisplay.light);
880 g.drawLine(area.x,y,area.x+area.width,y);
881
882
883}
884
885}
886
887// The interface to look backwards to parent to close ourselves
888
889interface zMenuParent {
890
891
892 // Called by child (or parent) to close and delete itself
893 public void closeChild(Window W);
894
895 // Close all the windows back to the menubar
896 public void closeEverything();
897
898}
899
900
901
902
903
904
905
906
java/pkg/awt/iOffScreenImage.java+33−0
@@ -0,0 +1,33 @@
1/*
2 * %W% - %E%
3 *
4 * Adapted from SunSoft's X11OffScreenImage.java 1.2 97/02/23
5 */
6
7package inferno.awt;
8
9import java.awt.Component;
10import java.awt.Graphics;
11import sun.awt.DrawingSurface;
12import sun.awt.DrawingSurfaceInfo;
13
14class iOffScreenImage extends iImage implements DrawingSurface {
15 /**
16 * Construct an image for offscreen rendering to be used with a
17 * given Component.
18 */
19 public iOffScreenImage(Component c, int w, int h) {
20 super(c, w, h);
21 }
22
23 public Graphics getGraphics() {
24 Graphics g = new iGraphics(this);
25 initGraphics(g);
26 return g;
27 }
28
29 // implementation of sun.awt.DrawingSurface's getDrawingSurfaceInfo()
30 public DrawingSurfaceInfo getDrawingSurfaceInfo() {
31 return new iDrawingSurfaceInfo(getImageRep());
32 }
33}
java/pkg/awt/iPopupMenuPeer.java+652−0
@@ -0,0 +1,652 @@
1package inferno.awt;
2
3import java.awt.*;
4import java.applet.*;
5import java.awt.event.*;
6import java.awt.peer.*;
7import inferno.awt.*;
8
9public class iPopupMenuPeer implements PopupMenuPeer,zPopupMenuParent {
10 PopupMenu target;
11 Window child;
12
13 public void show(Event e)
14 {
15 Object o=e.target;
16
17 if (o instanceof Component)
18 {
19 Component c=(Component)o;
20 Point pc=c.getLocationOnScreen();
21 Container p;
22
23 if (c instanceof Container)
24 p=(Container)c;
25 else
26 p=c.getParent();
27
28 if (p!=null)
29 {
30 Window w=null;
31
32 while (true)
33 {
34 if (p instanceof Frame)
35 {
36 Frame f=(Frame)p;
37
38 Point pf=f.getLocationOnScreen();
39
40 closeChild(child);
41
42 child=new zPopupMenu(f,this,target,pc.x+e.x-pf.x,pc.y+e.y-pf.y);
43 child.pack();
44 child.setVisible(true);
45
46 break;
47 }
48 else
49 if (p instanceof Applet)
50 {
51 Applet a=(Applet)p;
52
53 break;
54 }
55
56 p=p.getParent();
57
58 if (p==null) break;
59 }
60
61
62 }
63
64
65
66 }
67
68
69 }
70
71 public void delItem(int item)
72 {
73
74 }
75
76
77 public void addItem(MenuItem item)
78 {
79
80 }
81
82 public void addSeparator()
83 {
84 }
85
86 public void disable()
87 {
88
89 }
90
91 public void enable()
92 {
93
94 }
95
96 public void setEnabled(boolean state)
97 {
98
99 }
100
101 public void setLabel(String label)
102 {
103
104 }
105
106
107 public void closeChild(Window w)
108 {
109 if (child!=null && child==w)
110 {
111 child.setVisible(false);
112 child.dispose();
113 child=null;
114 }
115 }
116
117 public void closeEverything()
118 {
119 closeChild(child);
120 }
121
122 public iPopupMenuPeer(PopupMenu target) {
123 this.target = target;
124 }
125
126 public void dispose()
127 {
128 }
129
130}
131
132class zPopupMenu extends Window implements ComponentListener,zPopupMenuParent{
133 zPopupMenuDisplay menudisplay;
134 zPopupMenuParent ancestor;
135 int xoffset,yoffset;
136
137 public zPopupMenu(Frame f,zPopupMenuParent ancestor,Menu menu,int xoffset,int yoffset)
138{
139 super(f);
140 this.xoffset=xoffset;
141 this.yoffset=yoffset;
142 this.ancestor=ancestor;
143 Point p=f.getLocation();
144 p.translate(this.xoffset,this.yoffset);
145 setLocation(p);
146 f.addComponentListener(this);
147 this.menudisplay=new zPopupMenuDisplay(menu);
148 add(this.menudisplay,BorderLayout.CENTER);
149 //System.out.println("zPopupMenu Called: " + this);
150 }
151
152 public void closeChild(Window w)
153 {
154 if (menudisplay!=null)
155 {
156 if (!menudisplay.gotFocus() && ancestor!=null)
157 ancestor.closeChild(this);
158 else
159 menudisplay.closeChild(w);
160 }
161 }
162
163 public void closeEverything()
164{
165 if (ancestor!=null)
166 ancestor.closeEverything();
167}
168
169 public boolean gotFocus()
170 {
171 if (menudisplay==null)
172 return false;
173 else
174 return menudisplay.gotFocus();
175
176 }
177
178 public void componentHidden(ComponentEvent e)
179 {
180
181 }
182
183 public void componentMoved(ComponentEvent e)
184 {
185 Point p=e.getComponent().getLocation();
186 p.translate(xoffset,yoffset);
187 setLocation(p);
188 }
189
190 public void componentResized(ComponentEvent e)
191 {
192
193 }
194
195 public void componentShown(ComponentEvent e)
196 {
197
198 }
199
200 public void dispose()
201 {
202 if (menudisplay!=null)
203 {
204 menudisplay.closeChild(this);
205 }
206 super.dispose();
207 }
208
209}
210
211class zPopupMenuDisplay extends Canvas implements
212MouseListener,MouseMotionListener,
213FocusListener{
214 zPopupMenuObject menuObjects[];
215 zPopupMenuObject selectedMenuObject;
216 zPopupMenu child;
217 int menuObjectCount;
218 Dimension pSize;
219 boolean focus;
220 Menu menu;
221 static Color highlight = SystemColor.controlHighlight;
222 static Color light = SystemColor.controlLtHighlight;
223 static Color medium = SystemColor.controlShadow;
224 static Color dark = SystemColor.controlDkShadow;
225
226
227 static final int TickBoxSize=13;
228
229 static final int TickLabelGap=4;
230
231 static final int SeparatorHeight=6;
232
233
234 public zPopupMenuDisplay(Menu menu)
235
236 {
237 super();
238 setMenu(menu);
239 addMouseListener(this);
240 addMouseMotionListener(this);
241 /*addKeyListener(this);*/
242 addFocusListener(this);
243
244 }
245
246 public boolean isFocusTraversable() {
247 return false;
248 }
249
250
251 void setMenu(Menu menu)
252
253 {
254
255 int maxwidth=0;
256
257 int yy=4;
258
259 int xx=4;
260
261 this.menu=menu;
262
263
264 menuObjectCount=menu.getItemCount();
265
266
267 selectedMenuObject=null;
268
269
270 if (menuObjectCount==0)
271
272 menuObjects=null;
273
274 else
275
276 {
277
278 menuObjects=new zPopupMenuObject[menuObjectCount];
279
280
281 boolean submenu=false;
282
283 for (int i=0;i<menuObjectCount;i++)
284
285 {
286
287 MenuItem mi=menu.getItem(i);
288
289 String label=mi.getLabel();
290 if (!submenu && mi instanceof Menu) submenu=true;
291
292
293 if (!label.equals("-"))
294
295 {
296
297 Font f=mi.getFont();
298
299 FontMetrics fm=getFontMetrics(f);
300
301
302maxwidth=Math.max(maxwidth,TickBoxSize+TickLabelGap+fm.stringWidth(label));
303
304
305 }
306
307
308 }
309
310 maxwidth+=2; // For outside lines
311
312 if (submenu) maxwidth+=8;
313
314 for (int i=0;i<menuObjectCount;i++)
315 {
316
317 MenuItem mi=menu.getItem(i);
318
319 String label=mi.getLabel();
320 int h;
321
322
323 if (label.equals("-"))
324 {
325 h=SeparatorHeight; // Height
326
327 menuObjects[i]=new zPopupMenuSeparator(new Rectangle(xx,yy,maxwidth,h));
328
329 }
330 else
331 {
332 Font f=mi.getFont();
333 FontMetrics fm=getFontMetrics(f);
334 h=Math.max(fm.getHeight(),TickBoxSize)+4; //Height
335
336 menuObjects[i]=new zPopupMenuText(mi,new Rectangle(xx,yy,maxwidth,h));
337
338 }
339
340 yy+=h;
341
342
343 }
344
345
346 }
347
348 pSize=new Dimension(xx+maxwidth+4,yy+4);
349
350 }
351
352
353 public Dimension getPreferredSize()
354
355 {
356
357 return pSize;
358
359 }
360
361
362 public void paint(Graphics g)
363 {
364 Dimension d=getSize();
365
366 g.setColor(SystemColor.menu);
367
368 Misc.Draw3DArea(0,0,d.width,d.height,g);
369
370 for (int i=0;i<menuObjectCount;i++)
371 menuObjects[i].paint(g,0);
372
373 }
374
375 void closeChild()
376 {
377 closeChild(child);
378 }
379
380 void closeChild(Window w)
381 {
382 if (child!=null && child==w)
383 {
384 child.setVisible(false);
385 child.dispose();
386 child=null;
387 }
388 }
389
390
391
392
393 public void mouseClicked(MouseEvent e)
394 {
395 }
396
397 public void mouseEntered(MouseEvent e)
398 {
399 }
400
401 public void mouseExited(MouseEvent e)
402 {
403 }
404
405 public void mousePressed(MouseEvent e)
406 {
407 }
408
409 public void mouseReleased(MouseEvent e)
410 {
411 if (selectedMenuObject!=null && selectedMenuObject instanceof zPopupMenuText)
412 {
413 MenuItem menuItem=((zPopupMenuText)selectedMenuObject).item;
414 if (menuItem.isEnabled() && !(menuItem instanceof Menu))
415 {
416 String actionCommand=menuItem.getActionCommand();
417 iToolkit.postEvent(new ActionEvent(menuItem, ActionEvent.ACTION_PERFORMED,
418 actionCommand));
419 zPopupMenu w=(zPopupMenu)getParent();
420 Frame f=(Frame)w.getParent();
421 f.requestFocus();
422 w.closeEverything();
423 }
424 }
425 }
426
427 public void mouseMoved(MouseEvent e)
428 {
429 if (!focus)
430 {
431 focus=true;
432 requestFocus();
433 }
434
435 if (selectedMenuObject==null ||
436 !selectedMenuObject.area.contains(e.getPoint()))
437 {
438 Graphics g=getGraphics();
439 if (selectedMenuObject!=null)
440 {
441 selectedMenuObject.paint(g,0);
442 selectedMenuObject=null;
443 closeChild(child);
444 }
445 for (int i=0;i<menuObjectCount;i++)
446 if (menuObjects[i].area.contains(e.getPoint()))
447 {
448 int mode=1;
449
450 selectedMenuObject=menuObjects[i];
451 if (selectedMenuObject instanceof zPopupMenuText)
452 {
453 zPopupMenuText mo=(zPopupMenuText)selectedMenuObject;
454
455 if (mo.item.isEnabled())
456 {
457 zPopupMenu w=(zPopupMenu)getParent();
458 Frame f=(Frame)w.getParent();
459
460 if (mo.item instanceof Menu)
461 {
462 int xx=w.xoffset+mo.area.x+mo.area.width;
463 int yy=w.yoffset+mo.area.y;
464 Menu menu=(Menu)mo.item;
465
466 mode=-1;
467
468 zPopupMenu newChild=new zPopupMenu(f,w,menu,xx,yy);
469 newChild.pack();
470 newChild.setVisible(true);
471 closeChild(child);
472 child=newChild;
473
474 }
475 }
476 selectedMenuObject.paint(g,mode);
477 }
478 break;
479 }
480
481 g.dispose();
482 }
483 }
484
485 public void mouseDragged(MouseEvent e)
486 {
487 mouseMoved(e);
488 }
489
490 public boolean gotFocus()
491 {
492 if (focus)
493 return true;
494 else
495 if (child==null)
496 return false;
497 else
498 return child.gotFocus();
499
500 }
501
502 public void focusLost(FocusEvent e)
503 {
504 focus=false;
505 if (!gotFocus())
506 {
507 zPopupMenu m=(zPopupMenu)getParent();
508 if (m.ancestor!=null) m.ancestor.closeChild(m);
509 }
510 }
511
512 public void focusGained(FocusEvent e)
513 {
514 focus=true;
515
516 }
517
518}
519
520abstract class zPopupMenuObject {
521 Rectangle area;
522
523 public zPopupMenuObject()
524 {
525 }
526
527 public zPopupMenuObject(Rectangle area)
528 {
529 this.area=area;
530 }
531
532 public abstract void paint(Graphics g,int mode);
533
534}
535
536class zPopupMenuText extends zPopupMenuObject {
537 MenuItem item;
538
539public zPopupMenuText(MenuItem item,Rectangle area)
540{
541 super(area);
542 this.item=item;
543}
544
545
546void drawArrow(Graphics g,int x,int y)
547{
548 for (int i=0;i<4;i++)
549 {
550 g.drawLine(x,y+i,x+3-i,y+i);
551 if (i!=0)
552 g.drawLine(x,y-i,x+3-i,y-i);
553 }
554}
555
556public void paint(Graphics g,int mode)
557{
558 Font f=item.getFont();
559 FontMetrics fm=g.getFontMetrics(f);
560 int fa=fm.getAscent();
561 boolean enabled=item.isEnabled();
562 boolean submenu=item instanceof Menu;
563 boolean checked=(item instanceof CheckboxMenuItem?
564 ((CheckboxMenuItem)item).getState():false);
565 String s=item.getLabel();
566 int xx=area.x;
567 int yy=area.y;
568
569 g.setFont(f);
570 if (enabled)
571 {
572 g.setColor(SystemColor.menu);
573 if (mode!=0)
574 Misc.fill3DRect(area,mode>0,g);
575 else
576 g.fillRect(xx,yy,area.width,area.height);
577
578 xx+=2;
579 yy+=2;
580 g.setColor(SystemColor.menuText);
581 g.translate(-mode,-mode);
582 if (checked) Misc.drawTick(g,xx,yy,zPopupMenuDisplay.TickBoxSize);
583
584g.drawString(s,zPopupMenuDisplay.TickBoxSize+zPopupMenuDisplay.TickLabelGap+xx,yy+fa);
585 if (submenu)
586 drawArrow(g,area.x+area.width-6,area.y+area.height/2);
587 g.translate(+mode,+mode);
588 }
589 else
590 {
591 xx+=2;
592 yy+=2;
593 if (checked)
594 {
595 g.setColor(SystemColor.controlLtHighlight);
596 Misc.drawTick(g,xx+1,yy+1,zPopupMenuDisplay.TickBoxSize);
597 g.setColor(SystemColor.controlShadow);
598 Misc.drawTick(g,xx,yy,zPopupMenuDisplay.TickBoxSize);
599 }
600
601
602Misc.drawDisabledString(s,zPopupMenuDisplay.TickBoxSize+zPopupMenuDisplay.TickLabelGap+xx,yy+fa,g);
603 if (submenu)
604 {
605 g.setColor(SystemColor.controlLtHighlight);
606 drawArrow(g,area.x+area.width-6+1,area.y+area.height/2+1);
607 g.setColor(SystemColor.controlShadow);
608 drawArrow(g,area.x+area.width-6,area.y+area.height/2);
609 }
610 }
611
612
613}
614
615}
616
617class zPopupMenuSeparator extends zPopupMenuObject {
618
619public zPopupMenuSeparator(Rectangle area)
620{
621 super(area);
622}
623
624public void paint(Graphics g,int mode)
625{
626 int y=area.y+zPopupMenuDisplay.SeparatorHeight/2-1;
627
628 g.setColor(zPopupMenuDisplay.medium);
629 g.drawLine(area.x,y,area.x+area.width,y);
630
631 y+=1;
632
633 g.setColor(zPopupMenuDisplay.light);
634 g.drawLine(area.x,y,area.x+area.width,y);
635
636
637}
638
639}
640
641interface zPopupMenuParent {
642
643 public void closeChild(Window W);
644
645 public void closeEverything();
646
647}
648
649
650
651
652
java/pkg/awt/iToolkit.java+303−0
@@ -0,0 +1,303 @@
1/*
2 * %W% - %E%
3 */
4
5package inferno.awt;
6
7import java.util.Hashtable;
8import java.awt.*;
9import java.awt.Toolkit;
10import java.awt.image.*;
11import java.awt.peer.*;
12import java.awt.event.MouseEvent;
13import java.awt.datatransfer.Clipboard;
14import java.io.*;
15import java.net.URL;
16import java.util.Properties;
17import sun.awt.image.*;
18
19public class iToolkit extends Toolkit {
20
21 // System clipboard.
22 Clipboard clipboard;
23
24 // the system EventQueue
25 protected static EventQueue theEventQueue;
26
27 public iToolkit() {
28
29 String eqName = Toolkit.getProperty("AWT.EventQueueClass",
30 "java.awt.EventQueue");
31 try {
32 theEventQueue = (EventQueue)Class.forName(eqName).newInstance();
33 } catch (Exception e) {
34 System.err.println("Failed loading " + eqName + ": " + e);
35 theEventQueue = new EventQueue();
36 }
37 }
38
39 protected EventQueue getSystemEventQueueImpl() {
40 return theEventQueue;
41 }
42
43 public Clipboard getSystemClipboard() {
44 SecurityManager security = System.getSecurityManager();
45 if (security != null) {
46 security.checkSystemClipboardAccess();
47 }
48 if (clipboard == null) {
49 //clipboard = new WClipboard();
50 }
51 return clipboard;
52 }
53
54
55 static public void postEvent(AWTEvent event)
56 {
57 // System.out.println("PeekEvent = "+theEventQueue.peekEvent());
58 theEventQueue.postEvent(event);
59 }
60
61 public void beep()
62 {
63
64 }
65
66 public PrintJob getPrintJob(Frame frame, String doctitle, Properties props)
67 {
68 return null;
69 }
70
71 public java.awt.Image createImage(byte[] data, int offset, int length) {
72 return createImage(new ByteArrayImageSource(data, offset, length));
73 }
74
75
76
77 public java.awt.Image createImage(ImageProducer producer) {
78 return null/*new WImage(producer)*/;
79 }
80
81 public int checkImage(java.awt.Image img, int w, int h, ImageObserver o) {
82 return 0/*checkScrImage(img, w, h, o)*/;
83 }
84
85 public boolean prepareImage(java.awt.Image img, int w, int h, ImageObserver o) {
86 return false/*prepareScrImage(img, w, h, o)*/;
87 }
88
89 public java.awt.Image getImage(String filename) {
90 return null/*getImageFromHash(this, filename)*/;
91 }
92
93 public java.awt.Image getImage(URL url) {
94 return null/*getImageFromHash(this, url)*/;
95 }
96
97 public void sync()
98 {
99 }
100
101 public FontMetrics getFontMetrics(Font font) {
102 return iFontMetrics.getFontMetrics(font);
103 }
104
105 public String[] getFontList() {
106 // REMIND: "Helvetica", "TimesRoman", "Courier" and "ZapfDingbats"
107 // will go awy from this list.
108 String list[] = {"Dialog", "SansSerif", "Serif", "Monospaced",
109 "Helvetica", "TimesRoman", "Courier",
110 "DialogInput", "ZapfDingbats"};
111 return list;
112 }
113
114
115 static native ColorModel makeColorModel();
116 static ColorModel screenmodel;
117
118 static ColorModel getStaticColorModel() {
119 if (screenmodel == null) {
120 screenmodel = makeColorModel();
121 }
122 return screenmodel;
123 }
124
125 public ColorModel getColorModel() {
126 return getStaticColorModel();
127 }
128 // nwk+
129 public native void loadSystemColors(int[] systemColors);
130 // -nwk
131
132 public Dimension getScreenSize() {
133 return new Dimension(getScreenWidth(), getScreenHeight());
134 }
135
136 public int getScreenResolution()
137 {
138 return 96;
139 }
140
141 protected int getScreenWidth()
142 {
143 return 640;
144 }
145
146 protected int getScreenHeight()
147 {
148 return 480;
149 }
150
151 public FontPeer getFontPeer(String name, int style) {
152 return new inferno.awt.iFontPeer(name, style);
153 }
154
155 /*
156 * Create peer objects.
157 */
158
159 public ButtonPeer createButton(Button target) {
160 ButtonPeer peer = null;
161 //ButtonPeer peer = new WButtonPeer(target);
162 //peerMap.put(target, peer);
163 return peer;
164 }
165
166 public TextFieldPeer createTextField(TextField target) {
167 TextFieldPeer peer = null;
168 //TextFieldPeer peer = new WTextFieldPeer(target);
169 //peerMap.put(target, peer);
170 return peer;
171 }
172
173 public LabelPeer createLabel(Label target) {
174 LabelPeer peer = null;
175 //LabelPeer peer = new WLabelPeer(target);
176 //peerMap.put(target, peer);
177 return peer;
178 }
179
180 public ListPeer createList(List target) {
181 ListPeer peer = null;
182 //ListPeer peer = new WListPeer(target);
183 //peerMap.put(target, peer);
184 return peer;
185 }
186
187 public CheckboxPeer createCheckbox(Checkbox target) {
188 CheckboxPeer peer = null;
189 //CheckboxPeer peer = new WCheckboxPeer(target);
190 //peerMap.put(target, peer);
191 return peer;
192 }
193
194 public ScrollbarPeer createScrollbar(Scrollbar target) {
195 ScrollbarPeer peer = null;
196 //ScrollbarPeer peer = new WScrollbarPeer(target);
197 //peerMap.put(target, peer);
198 return peer;
199 }
200
201 public ScrollPanePeer createScrollPane(ScrollPane target) {
202 ScrollPanePeer peer = null;
203 //ScrollPanePeer peer = new WScrollPanePeer(target);
204 //peerMap.put(target, peer);
205 return peer;
206 }
207
208 public TextAreaPeer createTextArea(TextArea target) {
209 TextAreaPeer peer = null;
210 //TextAreaPeer peer = new WTextAreaPeer(target);
211 //peerMap.put(target, peer);
212 return peer;
213 }
214
215 public ChoicePeer createChoice(Choice target) {
216 ChoicePeer peer = null;
217 //ChoicePeer peer = new WChoicePeer(target);
218 //peerMap.put(target, peer);
219 return peer;
220 }
221
222 public FramePeer createFrame(Frame target) {
223// FramePeer peer = null;
224 FramePeer peer = new iFramePeer(target);
225 //peerMap.put(target, peer);
226 return peer;
227 }
228
229 public CanvasPeer createCanvas(Canvas target) {
230 CanvasPeer peer = null;
231 //CanvasPeer peer = new WCanvasPeer(target);
232 //peerMap.put(target, peer);
233 return peer;
234 }
235
236 public PanelPeer createPanel(Panel target) {
237 PanelPeer peer = null;
238 //PanelPeer peer = new WPanelPeer(target);
239 //peerMap.put(target, peer);
240 return peer;
241 }
242
243 public WindowPeer createWindow(Window target) {
244 // WindowPeer peer = null;
245 WindowPeer peer = new iWindowPeer(target);
246 //peerMap.put(target, peer);
247 return peer;
248 }
249
250 public DialogPeer createDialog(Dialog target) {
251 DialogPeer peer = null;
252 //DialogPeer peer = new WDialogPeer(target);
253 //peerMap.put(target, peer);
254 return peer;
255 }
256
257 public FileDialogPeer createFileDialog(FileDialog target) {
258 FileDialogPeer peer = null;
259 //FileDialogPeer peer = new WFileDialogPeer(target);
260 //peerMap.put(target, peer);
261 return peer;
262 }
263
264 public MenuBarPeer createMenuBar(MenuBar target) {
265 MenuBarPeer peer = new iMenuBarPeer(target);
266 //peerMap.put(target, peer);
267 return peer;
268// return null;
269 }
270
271 public MenuPeer createMenu(Menu target) {
272 MenuPeer peer = null;
273 //MenuPeer peer = new WMenuPeer(target);
274 //peerMap.put(target, peer);
275 return peer;
276 }
277
278 public PopupMenuPeer createPopupMenu(PopupMenu target) {
279 //PopupMenuPeer peer = null;
280 PopupMenuPeer peer = new iPopupMenuPeer(target);
281 //peerMap.put(target, peer);
282 return peer;
283 }
284
285 public MenuItemPeer createMenuItem(MenuItem target) {
286 MenuItemPeer peer = null;
287 //MenuItemPeer peer = new WMenuItemPeer(target);
288 //peerMap.put(target, peer);
289 return peer;
290 }
291
292 public CheckboxMenuItemPeer createCheckboxMenuItem(CheckboxMenuItem target) {
293 CheckboxMenuItemPeer peer = null;
294 //CheckboxMenuItemPeer peer = new WCheckboxMenuItemPeer(target);
295 //peerMap.put(target, peer);
296 return peer;
297 }
298
299
300}
301
302
303
java/pkg/awt/iToolkit_L.b+85−0
@@ -0,0 +1,85 @@
1implement iToolkit_L;
2
3# javal v1.5 generated file: edit with care
4
5include "jni.m";
6 jni : JNI;
7 ClassModule,
8 JString,
9 JArray,
10 JArrayI,
11 JArrayC,
12 JArrayB,
13 JArrayS,
14 JArrayJ,
15 JArrayF,
16 JArrayD,
17 JArrayZ,
18 JArrayJObject,
19 JArrayJClass,
20 JArrayJString,
21 JClass,
22 JThread,
23 JObject : import jni;
24
25#>> extra pre includes here
26
27#
28# %W% - %E%
29#
30 draw: Draw;
31 Context, Display, Image: import draw;
32
33include "java/lang/ClassLoader_L.m";
34include "awt_Color.m";
35 awt : AwtColor;
36
37sys : import jni;
38ctxt : ref Context;
39
40#<<
41
42include "iToolkit_L.m";
43
44#>> extra post includes here
45
46#<<
47
48init( jni_p : JNI )
49{
50 # save java native inteface mod instance
51 jni = jni_p;
52 #>>extra initialization here
53 sys = jni->sys;
54 ctxt = jni->getContext();
55 awt = load AwtColor AwtColor->PATH;
56 if (awt == nil) {
57 sys->print("could not load %s: %r\n", AwtColor->PATH);
58 return;
59 }
60 #<<
61}
62
63makeColorModel_rColorModel( this : ref iToolkit_obj ) : JObject
64{#>>
65 if (ctxt == nil) {
66 sys->print("iToolkit_L: Can't makeColorModel - nil context\n");
67 return nil;
68 }
69
70 junk := this;
71 ldepth := ctxt.display.image.ldepth;
72 bits := 1<<ldepth;
73 jobj := awt->makeColorModel(jni, bits);
74 return jobj;
75}#<<
76
77## nwk+
78loadSystemColors_aI_V( this : ref iToolkit_obj, p0 : JArrayI)
79{#>>
80 junk := this;
81
82 awt->loadSystemColors(jni, p0);
83 return;
84}#<<
85## -nwk
java/pkg/awt/iToolkit_L.m+19−0
@@ -0,0 +1,19 @@
1#
2# %W% - %E%
3#
4
5# javal v1.5 generated file: edit with care
6
7iToolkit_L : module
8{
9 iToolkit_obj : adt
10 {
11 cl_mod : ClassModule;
12 clipboard : JObject;
13 };
14
15 init : fn( jni_p : JNI );
16 makeColorModel_rColorModel : fn( this : ref iToolkit_obj ) : JObject;
17 loadSystemColors_aI_V : fn( this : ref iToolkit_obj, p0 : JArrayI);
18
19};
java/pkg/awt/iWindowPeer.java+411−0
@@ -0,0 +1,411 @@
1/*
2 * %W% - %E%
3 */
4
5package inferno.awt;
6
7import java.awt.*;
8import java.awt.event.*;
9import java.awt.peer.*;
10import java.awt.image.ImageProducer;
11import java.awt.image.ImageObserver;
12import java.awt.image.ColorModel;
13import java.awt.image.DirectColorModel;
14import java.util.*;
15import inferno.awt.iGraphics;
16
17public class iWindowPeer implements WindowPeer, DoubleBufferingPeer {
18 Object pCanvas; // Set inside create()
19 Window target;
20 int leftInset=0; // How much canvas is inset from window
21 int rightInset=0;
22 int topInset=0;
23 int bottomInset=0;
24 int left; // x position of left of window
25 int top; // y position of top of window
26
27 private Point oldMousePoint;
28 private boolean buttonState[];
29
30 public iWindowPeer(Window target) {
31 this.target = target;
32 oldMousePoint=new Point(-1,-1);
33 buttonState=new boolean[3];
34 for (int i=0;i<3;i++) buttonState[i]=false; //up
35 create(this);
36 Font f = target.getFont();
37 if (f == null) {
38 f = new Font("Dialog", Font.PLAIN, 12);
39 target.setFont(f);
40 setFont(f);
41 }
42 Color c = target.getBackground();
43 if (c == null) {
44 c = SystemColor.window;
45 target.setBackground(c);
46 setBackground(c);
47 }
48 c = target.getForeground();
49 if (c == null) {
50 target.setForeground(Color.black);
51 setForeground(Color.black);
52 }
53
54 }
55
56 /* implementation of java.awt.peer.DoubleBufferingPeer */
57 public boolean isDoubleBuffered() {
58 return true;
59 }
60
61 native Object getRefImage(); // Returns $Draw->Image of canvas
62 native Object getRefOffScreenImage(); // Returns off-screen buffer image
63
64 native void pReshape(int x, int y, int width, int height);
65
66 native void pHide(); // Hide window
67
68 native void pShow(iWindowPeer fp); // Show window
69
70 native int getXYLoc(int coord); // get x or y value of the global position
71
72 public native void create(iWindowPeer fp); // Create window putting canvas in pcanvas
73
74 public native void pDispose(); // Destroy window
75
76 public native void setCursor(int cursorType); // Set cursor
77
78
79 /* New 1.1 API */
80 public Point getLocationOnScreen() // Return position on screen
81 {
82 Point p = new Point();
83 p.x = getXYLoc(0);
84 p.y = getXYLoc(1);
85 return p;
86 }
87
88 public void setCursor(Cursor c)
89 {
90 if (c!=null)
91 setCursor(c.getType());
92 }
93
94 public native void toFront(); // Move window to front
95
96 public native void toBack(); // Move window to back
97
98 public Insets getInsets()
99 {
100 Insets i=new Insets(topInset,leftInset,bottomInset,rightInset);
101 return i;
102 }
103
104 public Insets insets()
105 {
106 return getInsets();
107 }
108
109 public void endValidate()
110 {
111
112 }
113
114 public void beginValidate()
115 {
116
117 }
118
119 public void setBounds(int x, int y, int width, int height) {
120 pReshape(x, y, width, height);
121 }
122
123 public void reshape(int x, int y, int width, int height) {
124 pReshape(x, y, width, height);
125 }
126
127
128 public void dispose()
129 {
130 pDispose();
131 pCanvas=null;
132 }
133
134 public void disable()
135 {
136 setEnabled(false);
137 }
138
139 public void enable()
140 {
141 setEnabled(false);
142 }
143
144 public void setEnabled(boolean b)
145 {
146
147 }
148
149 public void hide()
150 {
151 setVisible(false);
152 }
153
154 public void show()
155 {
156 setVisible(true);
157 }
158
159 public void setVisible(boolean b)
160 {
161 if (b)
162 pShow(this);
163 else
164 pHide();
165 }
166
167 public Dimension getMinimumSize() {
168 return target.getSize();
169 }
170
171 public Dimension getPreferredSize() {
172 return getMinimumSize();
173 }
174
175 public Dimension minimumSize() {
176 return getMinimumSize();
177 }
178
179 public Dimension preferredSize() {
180 return getPreferredSize();
181 }
182
183
184 public int checkImage(Image img, int w, int h, ImageObserver o) {
185 return 0;
186 }
187
188 public FontMetrics getFontMetrics(Font font) {
189 return iFontMetrics.getFontMetrics(font);
190 }
191
192 public boolean prepareImage(Image img, int w, int h, ImageObserver o) {
193 return false;
194 }
195
196
197 public Image createImage(ImageProducer producer) {
198 return null/*new Win32Image(producer)*/;
199 }
200 public Image createImage(int width, int height) {
201 return null/*new Win32Image(target, width, height)*/;
202 }
203
204 public boolean isFocusTraversable() {
205 return false;
206 }
207
208 public void requestFocus()
209 {
210 }
211
212 public void nextFocus()
213 {
214 }
215
216 public void setFont(Font f)
217 {
218
219 }
220
221 public Font getFont()
222 {
223 return null;
224 }
225
226 public void setBackground(Color c)
227 {
228
229 }
230
231 public void setForeground(Color c)
232 {
233
234 }
235
236 public Graphics getGraphics()
237 {
238 if (pCanvas == null) {
239 System.out.println("iWindowPeer:getGraphics()s: pCanvas == null, continuing!"); // jfs -remove
240 return null;
241 }
242 Rectangle bounds = target.getBounds();
243 Rectangle clip = new Rectangle(bounds.x+leftInset,
244 bounds.y+topInset,
245 bounds.width-leftInset-rightInset,
246 bounds.height-topInset-bottomInset);
247 Graphics g=new iGraphics(getRefImage(),getRefOffScreenImage(), clip,
248target);
249 g.translate(bounds.x,bounds.y);
250 return g;
251 }
252
253 public java.awt.Toolkit getToolkit() {
254 // XXX: bogus
255 return Toolkit.getDefaultToolkit();
256 }
257
258 public ColorModel getColorModel() {
259 return iToolkit.getStaticColorModel();
260 }
261
262 public void handleEvent(AWTEvent e)
263 {
264
265 }
266
267 public void print(Graphics g)
268 {
269 }
270
271 public void paint(Graphics g)
272 {
273 g.setColor(target.getForeground());
274 g.setFont(target.getFont());
275 target.paint(g);
276 }
277
278
279 public void repaint(long tm, int x, int y, int width, int height) {
280 iToolkit.postEvent(new PaintEvent((Component)target, PaintEvent.UPDATE,
281 new Rectangle(x, y, width, height)));
282
283 }
284
285 public void handleKeyEvents(int ch)
286 {
287 char keyChar = (char)ch;
288 boolean control = ch >= 0 && ch <= 31;
289 boolean lowercase = ch >= (int)'a' && ch <= (int)'z';
290 boolean uppercase = ch >= (int)'A' && ch <= (int)'Z';
291 int modifiers = control?InputEvent.CTRL_MASK:
292 uppercase?InputEvent.SHIFT_MASK:0;
293 int keyCode = control?ch+64:lowercase?ch-32:ch;
294 Date d = new Date();
295 long when = d.getTime();
296
297 iToolkit.postEvent(new KeyEvent(target,KeyEvent.KEY_PRESSED,
298 when,modifiers,keyCode,keyChar));
299
300 }
301
302private void handleMouseEvents(int m,int button,int x,int y)
303{
304 char mode=(char)m;
305 // System.out.println("Mouse event "+mode+" "+button+" "+x+" "+y);
306 switch(mode)
307 {
308 case 'd':
309 case 'r':
310 case 'm':
311 case 'p':
312 Rectangle bounds = target.getBounds();
313 int xx=x-bounds.x-leftInset;
314 int yy=y-bounds.y; // -topInset;
315
316 Point mousePoint=new Point(xx,yy);
317 //Date d = new Date();
318 //long when = d.getTime();
319 long when=0;
320 int modifier;
321
322 switch(button)
323 {
324 case 1:
325 modifier=InputEvent.BUTTON1_MASK;
326 break;
327
328 case 2:
329 modifier=InputEvent.BUTTON2_MASK;
330 break;
331
332 case 3:
333 modifier=InputEvent.BUTTON3_MASK;
334 break;
335
336 default:
337 modifier=0;
338 }
339
340 switch(mode)
341 {
342 case 'p': // Pressed
343 case 'd': // Double click
344 {
345 if (button>0 && button<=3 && buttonState[button-1]==false)
346 {
347 oldMousePoint=mousePoint;
348 buttonState[button-1]=true;
349 iToolkit.postEvent(new MouseEvent(target,MouseEvent.MOUSE_PRESSED,
350 when,modifier,xx,yy,1,false));
351
352 }
353 break;
354 }
355 case 'r': // Released
356 {
357 if (button>0 && button<=3 && buttonState[button-1]==true)
358 {
359 buttonState[button-1]=false;
360 iToolkit.postEvent(new MouseEvent(target,MouseEvent.MOUSE_RELEASED,
361 when,modifier,xx,yy,1,false));
362 if (mousePoint.equals(oldMousePoint))
363 {
364 iToolkit.postEvent(new MouseEvent(target,MouseEvent.MOUSE_CLICKED,
365 when,modifier,xx,yy,1,button==2));
366 }
367 }
368 break;
369 }
370 case 'm': // Moved
371 {
372 modifier=0;
373 if (buttonState[0]) modifier|=InputEvent.BUTTON1_MASK;
374 if (buttonState[1]) modifier|=InputEvent.BUTTON2_MASK;
375 if (buttonState[2]) modifier|=InputEvent.BUTTON3_MASK;
376 iToolkit.postEvent(new MouseEvent(target,
377 modifier==0?MouseEvent.MOUSE_MOVED:MouseEvent.MOUSE_DRAGGED,
378 when,modifier,xx,yy,1,false));
379
380 break;
381 }
382 default:
383 // System.out.println("MouseString: " + mouseString);
384 }
385 break;
386 }
387}
388
389 private void movesize(int x, int y, int width, int height)
390 {
391 Rectangle old = target.getBounds();
392 Rectangle n = new Rectangle(x, y, width, height);
393 if (!n.equals(old)){
394 target.setBounds(x, y, width, height);
395 target.repaint();
396 }
397 }
398
399 public void handleFocusGained()
400 {
401
402 }
403}
404
405
406
407
408
409
410
411
java/pkg/awt/iWindowPeer_L.b+377−0
@@ -0,0 +1,377 @@
1implement iWindowPeer_L;
2
3include "jni.m";
4 jni : JNI;
5 ClassModule,
6 JString,
7 JArray,
8 JArrayI,
9 JArrayC,
10 JArrayB,
11 JArrayS,
12 JArrayJ,
13 JArrayF,
14 JArrayD,
15 JArrayZ,
16 JArrayJObject,
17 JArrayJClass,
18 JArrayJString,
19 JClass,
20 JObject : import jni;
21
22#>> extra pre includes here
23#
24# %W% - %E%
25#
26 cast : Cast;
27 sys : Sys;
28 draw: Draw;
29 Context, Screen, Display, Rect, Font, Point, Image: import draw;
30
31include "tk.m";
32 tk: Tk;
33 Toplevel: import tk;
34
35include "wmlib.m";
36 wmlib: Wmlib;
37
38include "awt_Color.m";
39 awt : AwtColor;
40#<<
41
42include "iWindowPeer_L.m";
43
44#>> extra post includes here
45 str : String;
46 Value : import jni;
47 ctxt : ref Draw->Context;
48 cvm : ref Canvas;
49#<<
50
51init( jni_p : JNI )
52{
53 # save java native inteface mod instance
54 jni = jni_p;
55 #>>extra initialization here
56 sys = jni->sys;
57 str = load String String->PATH;
58 awt = load AwtColor AwtColor->PATH;
59 cast = jni->CastMod();
60 ctxt = jni->getContext();
61 #<<
62}
63
64getRefImage_rObject( this : ref iWindowPeer_obj) : ref Draw->Image
65{#>>
66 return this.pCanvas.image;
67}#<<
68
69getRefOffScreenImage_rObject( this : ref iWindowPeer_obj) : ref Draw->Image
70{#>>
71 return this.pCanvas.buf;
72}#<<
73
74pReshape_I_I_I_I_V( this : ref iWindowPeer_obj, p0 : int,p1 : int,p2 : int,p3 : int)
75{#>>
76 strcmd := ". configure -x " +
77 string p0 + " -y " + string p1 + " -width " + string p2 + " -height " + string p3;
78
79 tk->cmd(this.pCanvas.top, strcmd);
80 tk->cmd(this.pCanvas.top, "update");
81 this.pCanvas.image = this.pCanvas.top.image;
82}#<<
83
84pHide_V( this : ref iWindowPeer_obj)
85{#>>
86 tk->cmd(this.pCanvas.top, ". unmap");
87 this.pCanvas.image = nil;
88}#<<
89
90pShow_riWindowPeer_V( this : ref iWindowPeer_obj, p0: JObject)
91{#>>
92 tk->cmd(this.pCanvas.top, ". map");
93return;
94 args := array[0] of ref Value;
95 (val, err) := jni->CallMethod(this.target, "repaint", "()V", args);
96 if (err != jni->OK){
97 sys->print( "CallMethod Error %d: repaint\n",err);
98 }
99}#<<
100
101getXYLoc_I_I( this : ref iWindowPeer_obj, p0 : int) : int
102{#>>
103 if (p0 == 0)
104 return cvm.rect.min.x;
105 else
106 return cvm.rect.min.y;
107}#<<
108
109create_riWindowPeer_V( this : ref iWindowPeer_obj, p0 : JObject)
110{#>>
111 xval := jni->GetObjField(this.target, "x", "I");
112 yval := jni->GetObjField(this.target, "y", "I");
113 wval := jni->GetObjField(this.target, "width", "I");
114 hval := jni->GetObjField(this.target, "height", "I");
115
116 x := xval.Int();
117 y := yval.Int();
118 w := wval.Int();
119 h := hval.Int();
120
121 makewin(ctxt, x, y, w, h, this, p0);
122
123 this.topInset = 0;
124 this.leftInset = 0;
125 this.rightInset = 0;
126 this.bottomInset = 0;
127 this.left = this.pCanvas.rect.min.x;
128 this.top = this.pCanvas.rect.min.y;
129
130 tk->cmd(this.pCanvas.top, ". unmap");
131 this.pCanvas.image = nil;
132
133}#<<
134
135pDispose_V( this : ref iWindowPeer_obj)
136{#>>
137 this.pCanvas.jtd <- = "Die!";
138
139 this.pCanvas.top = nil;
140 this.pCanvas.image = nil;
141 this.pCanvas.buf = nil;
142 this.pCanvas = nil;
143}#<<
144
145setCursor_I_V( this : ref iWindowPeer_obj, p0 : int)
146{#>>
147}#<<
148
149toFront_V( this : ref iWindowPeer_obj)
150{#>>
151 this.pCanvas.image.top();
152}#<<
153
154toBack_V( this : ref iWindowPeer_obj)
155{#>>
156 this.pCanvas.image.bottom();
157}#<<
158
159#>>
160screen: ref Screen;
161display: ref Display;
162ones: ref Image;
163white: ref Image;
164
165 Event: adt
166 {
167 event: int;
168 detail: string;
169
170 Button, Key,
171 Icon, DeIcon,
172 Resize, Shutdown
173 : con iota;
174 };
175
176 Attr: adt
177 {
178 origin: Draw->Point;
179 dims: Draw->Point;
180 };
181
182 Canvas: adt
183 {
184 # interface
185 image: ref Draw->Image;
186 buf: ref Draw->Image;
187 rect: Draw->Rect;
188 events: chan of ref Event;
189 attr: ref Attr;
190 jtd : chan of string;
191 # implementation
192 ctxt : ref Draw->Context;
193 top: ref Tk->Toplevel;
194 canvas: string;
195 pid: int;
196 };
197#<<
198
199#>>
200win_cfg := array[] of {
201 "canvas .w -height 2 -width 2",
202 "pack .w -side bottom -fill both -expand 1",
203 "pack propagate . 0",
204};
205
206win_bind := array[] of {
207 "bind # <Motion> {send butt m %b %X %Y}",
208# "bind # <Leave> {send butt Leave}",
209 "bind # <ButtonPress> {focus #;send butt p %b %X %Y}",
210 "bind # <ButtonRelease> {send butt r %b %X %Y}",
211 "bind # <Double-Button> {send butt d %b %X %Y}",
212# "bind # <Enter> {send butt Enter}",
213 "bind # <KeyPress> {send key %K}",
214# "bind . <FocusIn> {send foc focus}",
215};
216
217modinit(ctxt: ref Context)
218{
219 draw = load Draw Draw->PATH;
220 tk = load Tk Tk->PATH;
221 wmlib = load Wmlib Wmlib->PATH;
222
223 screen = ctxt.screen;
224 wmlib->init();
225}
226
227makewin(ctxt: ref Context, x, y, width, height: int, this: ref iWindowPeer_obj, job: JObject)
228{
229 modinit(ctxt);
230 where := "-x " + string x + " -y " + string y;
231 t := tk->toplevel(screen, "-borderwidth 0 -relief raised "+where);
232# (t, menu) := wmlib->titlebar(screen, where, title, Wmlib->Appl);
233
234 if (width > 0 && height > 0)
235 win_cfg[0] = "canvas .w -height " + string height + " -width " + string width;
236
237 wmlib->tkcmds(t, win_cfg);
238 ones = t.image.display.ones;
239 white = t.image.display.color(Draw->White);
240 alloccanvas(t, ctxt, ".w", this, job);
241}
242
243alloccanvas(t: ref Toplevel, ctxt: ref Draw->Context, canvas: string, this :ref iWindowPeer_obj, job: JObject)
244{
245 cmd := chan of string;
246 tk->namechan(t, cmd, "cmd");
247 butt := chan of string;
248 tk->namechan(t, butt, "butt");
249
250 key := chan of string;
251 tk->namechan(t, key, "key");
252
253 tk->cmd(t, "bind . <Configure> {send cmd resize}");
254 tk->cmd(t, "bind . <Map> {send cmd map}");
255
256 for (i := 0; i < len win_bind; i++)
257 tk->cmd(t, expand(win_bind[i], canvas));
258
259 tk->cmd(t, "update");
260
261 c := ref Canvas;
262 this.pCanvas = c;
263 c = nil;
264
265 bg := Draw->White;
266 jcol := jni->GetObjField(this.target, "background", "Ljava/awt/Color;");
267 if (jcol == nil) {
268 sys->print("Cannot get background color\n");
269 } else {
270 color := jcol.Object();
271 bg = awt->getColorIndex(jni, color);
272 }
273
274 this.pCanvas.image = t.image;
275 display = t.image.display;
276 this.pCanvas.rect = canvposn(t, canvas);
277 this.pCanvas.buf = ctxt.display.newimage(ctxt.display.image.r,
278 this.pCanvas.image.ldepth , 0, bg);
279 this.pCanvas.events = chan of ref Event;
280 this.pCanvas.top = t;
281 this.pCanvas.ctxt = ctxt;
282 this.pCanvas.canvas = canvas;
283 this.pCanvas.pid = sys->pctl(0, nil);
284
285 spawn handler(cmd, butt, key, this, job);
286}
287
288handler(cmd, butt, key : chan of string, this : ref iWindowPeer_obj, job: JObject)
289{
290
291 detail: string;
292
293 jtd := chan of string;
294 this.pCanvas.jtd = jtd;
295
296 for (;;) alt {
297 detail = <- this.pCanvas.jtd =>
298 return;
299 detail = <- cmd =>
300 (n, word) := sys->tokenize(detail, " ");
301 case hd word {
302 "map" =>
303 this.pCanvas.image = this.pCanvas.top.image;
304 handleRepaint(this);
305
306 * =>
307 ;
308 }
309
310 detail = <- butt =>
311 doMouseEvent(job, detail);
312 detail = <- key =>
313 (kchar, st) := str->toint(detail, 16);
314 args := array[1] of ref Value;
315 args[0] = ref Value.TInt(kchar);
316 (val, err) := jni->CallMethod(job, "handleKeyEvents", "(I)V", args);
317 if (err != jni->OK){
318 sys->print( "CallMethod Error %d: handleKeyEvents\n",err);
319 }
320 }
321}
322expand(cmd, canvas: string): string
323{
324 s: string;
325 for (;;) {
326 (l, r) := str->splitl(cmd, "#");
327 s = s + l;
328 if (r == nil)
329 return s;
330 s = s + canvas;
331 cmd = r[1:];
332 }
333}
334
335canvposn(t: ref Toplevel, c: string): Rect
336{
337 r: Rect;
338
339 r.min.x = int tk->cmd(t, ". cget -actx") + int tk->cmd(t, ".dx get");
340 r.min.y = int tk->cmd(t, ". cget -acty") + int tk->cmd(t, ".dy get");
341 r.max.x = r.min.x + int tk->cmd(t, ". cget -actwidth") + int tk->cmd(t, ".dw get");
342 r.max.y = r.min.y + int tk->cmd(t, ". cget -actheight") + int tk->cmd(t, ".dh get");
343 return r;
344}
345
346doMouseEvent(job: JObject, detail : string)
347{
348 (n,toks) := sys->tokenize(detail," ");
349 if (n != 4) return;
350 mode := array of byte hd toks;
351 toks = tl toks;
352 button:=int hd toks;
353 toks = tl toks;
354 x:=int hd toks;
355 toks = tl toks;
356 y:=int hd toks;
357 args := array[4] of ref Value;
358 args[0] = ref Value.TInt(int mode[0]);
359 args[1] = ref Value.TInt(button);
360 args[2] = ref Value.TInt(x);
361 args[3] = ref Value.TInt(y);
362 (val, err) := jni->CallMethod(job, "handleMouseEvents", "(IIII)V", args);
363 if (err != jni->OK){
364 sys->print( "CallMethod Error %d: handleMouseEvents\n",err);
365 }
366}
367
368handleRepaint(this : ref iWindowPeer_obj)
369{
370 args := array[0] of ref Value;
371 (val, err) := jni->CallMethod(this.target, "repaint", "()V", args);
372 if (err != jni->OK){
373 sys->print( "CallMethod Error %d: repaint\n",err);
374 }
375}
376#<<
377
java/pkg/awt/iWindowPeer_L.m+36−0
@@ -0,0 +1,36 @@
1#
2# %W% - %E%
3#
4# generated file edit with care
5
6iWindowPeer_L : module
7{
8 iWindowPeer_obj : adt
9 {
10 cl_mod : ClassModule;
11 pCanvas : ref Canvas;
12 target : JObject;
13 leftInset : int;
14 rightInset : int;
15 topInset : int;
16 bottomInset : int;
17 left : int;
18 top : int;
19 oldMousePoint : JObject;
20 buttonState : JArrayZ;
21 };
22
23 init : fn( jni_p : JNI );
24 getRefImage_rObject : fn( this : ref iWindowPeer_obj) : ref Draw->Image;
25 getRefOffScreenImage_rObject : fn( this : ref iWindowPeer_obj) : ref Draw->Image;
26 pReshape_I_I_I_I_V : fn( this : ref iWindowPeer_obj, p0 : int,p1 : int,p2 : int,p3 : int);
27 pHide_V : fn( this : ref iWindowPeer_obj);
28 pShow_riWindowPeer_V : fn( this : ref iWindowPeer_obj, p0 : JObject);
29 getXYLoc_I_I : fn( this : ref iWindowPeer_obj, p0 : int) : int;
30 create_riWindowPeer_V : fn( this : ref iWindowPeer_obj, p0 : JObject);
31 pDispose_V : fn( this : ref iWindowPeer_obj);
32 setCursor_I_V : fn( this : ref iWindowPeer_obj, p0 : int);
33 toFront_V : fn( this : ref iWindowPeer_obj);
34 toBack_V : fn( this : ref iWindowPeer_obj);
35
36};
java/pkg/awt/mkfile+126−0
@@ -0,0 +1,126 @@
1<../../../../mkconfig
2
3TARG=\
4 iDrawingSurfaceInfo.dis\
5 iFontMetrics.dis\
6 iFontPeer.dis\
7 iFramePeer.dis\
8 iGraphics.dis\
9 iImage.dis\
10 iImageConsumer.dis\
11 iImageRepresentation.dis\
12 iMenuBarPeer.dis\
13 iOffScreenImage.dis\
14 iPopupMenuPeer.dis\
15 iToolkit.dis\
16 iWindowPeer.dis\
17 zMenuWindow.dis\
18 zMenuDisplay.dis\
19 zMenuBarObject.dis\
20 zMenuObject.dis\
21 zMenuParent.dis\
22 zMenuSeparator.dis\
23 zMenuText.dis\
24 zPopupMenu.dis\
25 zPopupMenuDisplay.dis\
26 zPopupMenuObject.dis\
27 zPopupMenuParent.dis\
28 zPopupMenuSeparator.dis\
29 zPopupMenuText.dis\
30# Limbo code\
31 awt_Color.dis\
32 awt_Frame.dis\
33 awt_Graphics.dis\
34# broken\
35# iDrawingSurfaceInfo_L.dis\
36 iFontMetrics_L.dis\
37 iFontPeer_L.dis\
38 iFramePeer_L.dis\
39 iGraphics_L.dis\
40 iImageRepresentation_L.dis\
41 iImage_L.dis\
42 iToolkit_L.dis\
43 iWindowPeer_L.dis\
44
45MODULES=\
46 $ROOT/java/module/classloader.m\
47 $ROOT/java/module/jni.m\
48 $ROOT/java/module/cast.m\
49 awt_Color.m\
50 awt_Frame.m\
51 awt_Graphics.m\
52 awt_Image.m\
53 iDrawingSurfaceInfo_L.m\
54 iFontMetrics_L.m\
55 iFontPeer_L.m\
56 iFramePeer_L.m\
57 iGraphics_L.m\
58 iImageRepresentation_L.m\
59 iImage_L.m\
60 iToolkit_L.m\
61 iWindowPeer_L.m\
62
63SYSMODULES=\
64 draw.m\
65 hash.m\
66 keyring.m\
67 loader.m\
68 math.m\
69 string.m\
70 sys.m\
71
72DISBIN=$ROOT/java/dis/java/inferno/awt
73
74<$ROOT/mkfiles/mkjava
75
76LIMBOINCL=\
77 $LIMBOINCL\
78 -I$ROOT/java/pkg\
79
80awt_Color.dis: awt_Color.b
81 limbo $LIMBOINCL -gw awt_Color.b
82
83awt_Frame.dis: awt_Frame.b
84 limbo $LIMBOINCL -gw awt_Frame.b
85
86awt_Graphics.dis: awt_Graphics.b
87 limbo $LIMBOINCL -gw awt_Graphics.b
88
89zMenuWindow.dis: iMenuBarPeer.class
90 j2d zMenuWindow.class
91
92zMenuDisplay.dis: iMenuBarPeer.class
93 j2d zMenuDisplay.class
94
95zMenuBarObject.dis: iMenuBarPeer.class
96 j2d zMenuBarObject.class
97
98zMenuObject.dis: iMenuBarPeer.class
99 j2d zMenuObject.class
100
101zMenuParent.dis: iMenuBarPeer.class
102 j2d zMenuParent.class
103
104zMenuSeparator.dis: iMenuBarPeer.class
105 j2d zMenuSeparator.class
106
107zMenuText.dis: iMenuBarPeer.class
108 j2d zMenuText.class
109
110zPopupMenu.dis: iPopupMenuPeer.class
111 j2d zPopupMenu.class
112
113zPopupMenuDisplay.dis: iPopupMenuPeer.class
114 j2d zPopupMenuDisplay.class
115
116zPopupMenuObject.dis: iPopupMenuPeer.class
117 j2d zPopupMenuObject.class
118
119zPopupMenuParent.dis: iPopupMenuPeer.class
120 j2d zPopupMenuParent.class
121
122zPopupMenuSeparator.dis: iPopupMenuPeer.class
123 j2d zPopupMenuSeparator.class
124
125zPopupMenuText.dis: iPopupMenuPeer.class
126 j2d zPopupMenuText.class
java/pkg/com/mkfile+7−0
@@ -0,0 +1,7 @@
1<../../../mkconfig
2
3DIRS=\
4 oracle\
5 sun\
6
7<$ROOT/mkfiles/mksubdirs
java/pkg/com/oracle/mkfile+6−0
@@ -0,0 +1,6 @@
1<../../../../mkconfig
2
3DIRS=\
4 net\
5
6<$ROOT/mkfiles/mksubdirs
java/pkg/com/oracle/net/Sdp.java+201−0
@@ -0,0 +1,201 @@
1/*
2 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26package com.oracle.net;
27
28import java.net.Socket;
29import java.net.ServerSocket;
30import java.net.SocketImpl;
31import java.net.SocketImplFactory;
32import java.net.SocketException;
33import java.nio.channels.SocketChannel;
34import java.nio.channels.ServerSocketChannel;
35import java.io.IOException;
36import java.io.FileDescriptor;
37import java.security.AccessController;
38import java.security.PrivilegedAction;
39import java.lang.reflect.Constructor;
40import java.lang.reflect.AccessibleObject;
41import java.lang.reflect.InvocationTargetException;
42
43import sun.net.sdp.SdpSupport;
44
45/**
46 * This class consists exclusively of static methods that Sockets or Channels to
47 * sockets that support the InfiniBand Sockets Direct Protocol (SDP).
48 */
49
50public final class Sdp {
51 private Sdp() { }
52
53 /**
54 * The package-privage ServerSocket(SocketImpl) constructor
55 */
56 private static final Constructor<ServerSocket> serverSocketCtor;
57 static {
58 try {
59 serverSocketCtor = (Constructor<ServerSocket>)
60 ServerSocket.class.getDeclaredConstructor(SocketImpl.class);
61 setAccessible(serverSocketCtor);
62 } catch (NoSuchMethodException e) {
63 throw new AssertionError(e);
64 }
65 }
66
67 /**
68 * The package-private SdpSocketImpl() constructor
69 */
70 private static final Constructor<SocketImpl> socketImplCtor;
71 static {
72 try {
73 Class<?> cl = Class.forName("java.net.SdpSocketImpl", true, null);
74 socketImplCtor = (Constructor<SocketImpl>)cl.getDeclaredConstructor();
75 setAccessible(socketImplCtor);
76 } catch (ClassNotFoundException e) {
77 throw new AssertionError(e);
78 } catch (NoSuchMethodException e) {
79 throw new AssertionError(e);
80 }
81 }
82
83 private static void setAccessible(final AccessibleObject o) {
84 AccessController.doPrivileged(new PrivilegedAction<Void>() {
85 public Void run() {
86 o.setAccessible(true);
87 return null;
88 }
89 });
90 }
91
92 /**
93 * SDP enabled Socket.
94 */
95 private static class SdpSocket extends Socket {
96 SdpSocket(SocketImpl impl) throws SocketException {
97 super(impl);
98 }
99 }
100
101 /**
102 * Creates a SDP enabled SocketImpl
103 */
104 private static SocketImpl createSocketImpl() {
105 try {
106 return socketImplCtor.newInstance();
107 } catch (InstantiationException x) {
108 throw new AssertionError(x);
109 } catch (IllegalAccessException x) {
110 throw new AssertionError(x);
111 } catch (InvocationTargetException x) {
112 throw new AssertionError(x);
113 }
114 }
115
116 /**
117 * Creates an unconnected and unbound SDP socket. The {@code Socket} is
118 * associated with a {@link java.net.SocketImpl} of the system-default type.
119 *
120 * @return a new Socket
121 *
122 * @throws UnsupportedOperationException
123 * If SDP is not supported
124 * @throws IOException
125 * If an I/O error occurs
126 */
127 public static Socket openSocket() throws IOException {
128 SocketImpl impl = createSocketImpl();
129 return new SdpSocket(impl);
130 }
131
132 /**
133 * Creates an unbound SDP server socket. The {@code ServerSocket} is
134 * associated with a {@link java.net.SocketImpl} of the system-default type.
135 *
136 * @return a new ServerSocket
137 *
138 * @throws UnsupportedOperationException
139 * If SDP is not supported
140 * @throws IOException
141 * If an I/O error occurs
142 */
143 public static ServerSocket openServerSocket() throws IOException {
144 // create ServerSocket via package-private constructor
145 SocketImpl impl = createSocketImpl();
146 try {
147 return serverSocketCtor.newInstance(impl);
148 } catch (IllegalAccessException x) {
149 throw new AssertionError(x);
150 } catch (InstantiationException x) {
151 throw new AssertionError(x);
152 } catch (InvocationTargetException x) {
153 Throwable cause = x.getCause();
154 if (cause instanceof IOException)
155 throw (IOException)cause;
156 if (cause instanceof RuntimeException)
157 throw (RuntimeException)cause;
158 throw new RuntimeException(x);
159 }
160 }
161
162 /**
163 * Opens a socket channel to a SDP socket.
164 *
165 * <p> The channel will be associated with the system-wide default
166 * {@link java.nio.channels.spi.SelectorProvider SelectorProvider}.
167 *
168 * @return a new SocketChannel
169 *
170 * @throws UnsupportedOperationException
171 * If SDP is not supported or not supported by the default selector
172 * provider
173 * @throws IOException
174 * If an I/O error occurs.
175 */
176 public static SocketChannel openSocketChannel() throws IOException {
177 FileDescriptor fd = SdpSupport.createSocket();
178 return sun.nio.ch.Secrets.newSocketChannel(fd);
179 }
180
181 /**
182 * Opens a socket channel to a SDP socket.
183 *
184 * <p> The channel will be associated with the system-wide default
185 * {@link java.nio.channels.spi.SelectorProvider SelectorProvider}.
186 *
187 * @return a new ServerSocketChannel
188 *
189 * @throws UnsupportedOperationException
190 * If SDP is not supported or not supported by the default selector
191 * provider
192 * @throws IOException
193 * If an I/O error occurs
194 */
195 public static ServerSocketChannel openServerSocketChannel()
196 throws IOException
197 {
198 FileDescriptor fd = SdpSupport.createSocket();
199 return sun.nio.ch.Secrets.newServerSocketChannel(fd);
200 }
201}
java/pkg/com/oracle/net/mkfile+8−0
@@ -0,0 +1,8 @@
1<../../../../../mkconfig
2
3TARG=\
4 Sdp.dis\
5
6DISBIN=$ROOT/java/dis/java/java/com/oracle/net
7
8<$ROOT/mkfiles/mkjava
java/pkg/com/sun/accessibility/internal/mkfile+6−0
@@ -0,0 +1,6 @@
1<../../../../../../mkconfig
2
3DIRS=\
4 resources\
5
6<$ROOT/mkfiles/mksubdirs
java/pkg/com/sun/accessibility/internal/resources/accessibility.properties+146−0
@@ -0,0 +1,146 @@
1#
2# This properties file is used to create a PropertyResourceBundle
3# It contains Locale specific strings used be the Accessibility package.
4#
5# When this file is read in, the strings are put into the
6# defaults table. This is an implementation detail of the current
7# workings of Accessibility. DO NOT DEPEND ON THIS.
8# This may change in future versions of Accessibility as we improve
9# localization support.
10#
11# @author Lynn Monsanto
12
13#
14# accessible roles
15#
16alert=alert
17awtcomponent=AWT component
18checkbox=check box
19colorchooser=color chooser
20columnheader=column header
21combobox=combo box
22canvas=canvas
23desktopicon=desktop icon
24desktoppane=desktop pane
25dialog=dialog
26directorypane=directory pane
27glasspane=glass pane
28filechooser=file chooser
29filler=filler
30frame=frame
31internalframe=internal frame
32label=label
33layeredpane=layered pane
34list=list
35listitem=list item
36menubar=menu bar
37menu=menu
38menuitem=menu item
39optionpane=option pane
40pagetab=page tab
41pagetablist=page tab list
42panel=panel
43passwordtext=password text
44popupmenu=popup menu
45progressbar=progress bar
46pushbutton=push button
47radiobutton=radio button
48rootpane=root pane
49rowheader=row header
50scrollbar=scroll bar
51scrollpane=scroll pane
52separator=separator
53slider=slider
54splitpane=split pane
55swingcomponent=swing component
56table=table
57text=text
58tree=tree
59togglebutton=toggle button
60toolbar=tool bar
61tooltip=tool tip
62unknown=unknown
63viewport=viewport
64window=window
65#
66# accessible relations
67#
68labelFor=label for
69labeledBy=labeled by
70memberOf=member of
71controlledBy=controlledBy
72controllerFor=controllerFor
73#
74# accessible states
75#
76active=active
77armed=armed
78busy=busy
79checked=checked
80collapsed=collapsed
81editable=editable
82expandable=expandable
83expanded=expanded
84enabled=enabled
85focusable=focusable
86focused=focused
87iconified=iconified
88modal=modal
89multiline=multiple line
90multiselectable=multiselectable
91opaque=opaque
92pressed=pressed
93resizable=resizable
94selectable=selectable
95selected=selected
96showing=showing
97singleline=single line
98transient=transient
99visible=visible
100vertical=vertical
101horizontal=horizontal
102#
103# accessible actions
104#
105toggle expand=toggle expand
106
107# new relations, roles and states for J2SE 1.5.0
108
109#
110# accessible relations
111#
112flowsTo=flows to
113flowsFrom=flows from
114subwindowOf=subwindow of
115parentWindowOf=parent window of
116embeds=embeds
117embeddedBy=embedded by
118childNodeOf=child node of
119
120#
121# accessible roles
122#
123header=header
124footer=footer
125paragraph=paragraph
126ruler=ruler
127editbar=editbar
128progressMonitor=progress monitor
129
130#
131# accessible states
132#
133managesDescendants=manages descendants
134indeterminate=indeterminate
135truncated=truncated
136
137# new for J2SE 1.6.0
138
139#
140# accessible roles
141#
142htmlcontainer=HTML container
143
144#
145# END OF MATERIAL TO LOCALIZE
146#
java/pkg/com/sun/accessibility/internal/resources/accessibility_de.properties+146−0
@@ -0,0 +1,146 @@
1#
2# This properties file is used to create a PropertyResourceBundle
3# It contains Locale specific strings used be the Accessibility package.
4#
5# When this file is read in, the strings are put into the
6# defaults table. This is an implementation detail of the current
7# workings of Accessibility. DO NOT DEPEND ON THIS.
8# This may change in future versions of Accessibility as we improve
9# localization support.
10#
11# @author Lynn Monsanto
12
13#
14# accessible roles
15#
16alert=Alert
17awtcomponent=AWT-Komponente
18checkbox=Kontrollk\u00E4stchen
19colorchooser=Farbauswahl
20columnheader=Spalten-Header
21combobox=Kombinationsfeld
22canvas=Leinwand
23desktopicon=Desktopsymbol
24desktoppane=Desktopbereich
25dialog=Dialogfeld
26directorypane=Verzeichnisbereich
27glasspane=Glass Pane
28filechooser=Dateiauswahl
29filler=F\u00FCllbereich
30frame=Rahmen
31internalframe=Innerer Rahmen
32label=Label
33layeredpane=Layered Pane
34list=Liste
35listitem=Listenelement
36menubar=Men\u00FCleiste
37menu=Men\u00FC
38menuitem=Men\u00FCpunkt
39optionpane=Optionsbereich
40pagetab=Registerkarte
41pagetablist=Registerkartenliste
42panel=Bereich
43passwordtext=Kennworttext
44popupmenu=Popup-Men\u00FC
45progressbar=Fortschrittsbalken
46pushbutton=Schaltfl\u00E4che
47radiobutton=Optionsfeld
48rootpane=Root-Bereich
49rowheader=Zeilen-Header
50scrollbar=Bildlaufleiste
51scrollpane=Bildlaufbereich
52separator=Trennzeichen
53slider=Schieberegler
54splitpane=Split Pane
55swingcomponent=Swing-Komponente
56table=Tabelle
57text=Text
58tree=Baumstruktur
59togglebutton=Umschaltfl\u00E4che
60toolbar=Symbolleiste
61tooltip=QuickInfo
62unknown=Unbekannt
63viewport=Viewport
64window=Fenster
65#
66# accessible relations
67#
68labelFor=Label f\u00FCr
69labeledBy=beschriftet von
70memberOf=Mitglied von
71controlledBy=controlledBy
72controllerFor=controllerFor
73#
74# accessible states
75#
76active=aktiv
77armed=aktiviert
78busy=ausgelastet
79checked=markiert
80collapsed=ausgeblendet
81editable=bearbeitbar
82expandable=erweiterbar
83expanded=eingeblendet
84enabled=aktiviert
85focusable=fokussierbar
86focused=fokussiert
87iconified=minimiert
88modal=modal
89multiline=mehrzeilig
90multiselectable=mehrfach ausw\u00E4hlbar
91opaque=nicht transparent
92pressed=gedr\u00FCckt
93resizable=skalierbar
94selectable=w\u00E4hlbar
95selected=ausgew\u00E4hlt
96showing=angezeigt
97singleline=einzeilig
98transient=transient
99visible=sichtbar
100vertical=vertikal
101horizontal=horizontal
102#
103# accessible actions
104#
105toggle expand=ein-/ausblenden
106
107# new relations, roles and states for J2SE 1.5.0
108
109#
110# accessible relations
111#
112flowsTo=flie\u00DFt zu
113flowsFrom=flie\u00DFt von
114subwindowOf=Unterfenster von
115parentWindowOf=\u00FCbergeordnetes Fenster von
116embeds=bettet ein
117embeddedBy=eingebettet in
118childNodeOf=untergeordneter Knoten von
119
120#
121# accessible roles
122#
123header=Header
124footer=Footer
125paragraph=Absatz
126ruler=Lineal
127editbar=Bearbeitungsleiste
128progressMonitor=Fortschrittsmonitor
129
130#
131# accessible states
132#
133managesDescendants=verwaltet untergeordnete Objekte
134indeterminate=unbestimmt
135truncated=abgeschnitten
136
137# new for J2SE 1.6.0
138
139#
140# accessible roles
141#
142htmlcontainer=HTML-Container
143
144#
145# END OF MATERIAL TO LOCALIZE
146#
java/pkg/com/sun/accessibility/internal/resources/accessibility_en.properties+142−0
@@ -0,0 +1,142 @@
1#
2# This properties file is used to create a PropertyResourceBundle
3# It contains Locale specific strings used be the Accessibility package.
4#
5# When this file is read in, the strings are put into the
6# defaults table. This is an implementation detail of the current
7# workings of Accessibility. DO NOT DEPEND ON THIS.
8# This may change in future versions of Accessibility as we improve
9# localization support.
10#
11# @author Lynn Monsanto
12
13#
14# accessible roles
15#
16alert=alert
17awtcomponent=AWT component
18checkbox=check box
19colorchooser=color chooser
20columnheader=column header
21combobox=combo box
22canvas=canvas
23desktopicon=desktop icon
24desktoppane=desktop pane
25dialog=dialog
26directorypane=directory pane
27glasspane=glass pane
28filechooser=file chooser
29filler=filler
30frame=frame
31internalframe=internal frame
32label=label
33layeredpane=layered pane
34list=list
35listitem=list item
36menubar=menu bar
37menu=menu
38menuitem=menu item
39optionpane=option pane
40pagetab=page tab
41pagetablist=page tab list
42panel=panel
43passwordtext=password text
44popupmenu=popup menu
45progressbar=progress bar
46pushbutton=push button
47radiobutton=radio button
48rootpane=root pane
49rowheader=row header
50scrollbar=scroll bar
51scrollpane=scroll pane
52separator=separator
53slider=slider
54splitpane=split pane
55swingcomponent=swing component
56table=table
57text=text
58tree=tree
59togglebutton=toggle button
60toolbar=tool bar
61tooltip=tool tip
62unknown=unknown
63viewport=viewport
64window=window
65#
66# accessible relations
67#
68labelFor=label for
69labeledBy=labeled by
70memberOf=member of
71controlledBy=controlledBy
72controllerFor=controllerFor
73#
74# accessible states
75#
76active=active
77armed=armed
78busy=busy
79checked=checked
80collapsed=collapsed
81editable=editable
82expandable=expandable
83expanded=expanded
84enabled=enabled
85focusable=focusable
86focused=focused
87iconified=iconified
88modal=modal
89multiline=multiple line
90multiselectable=multiselectable
91opaque=opaque
92pressed=pressed
93resizable=resizable
94selectable=selectable
95selected=selected
96showing=showing
97singleline=single line
98transient=transient
99visible=visible
100vertical=vertical
101horizontal=horizontal
102
103# new relations, roles and states for J2SE 1.5.0
104
105#
106# accessible relations
107#
108flowsTo=flows to
109flowsFrom=flows from
110subwindowOf=subwindow of
111parentWindowOf=parent window of
112embeds=embeds
113embeddedBy=embedded by
114childNodeOf=child node of
115
116#
117# accessible roles
118#
119header=header
120footer=footer
121paragraph=paragraph
122ruler=ruler
123editbar=editbar
124progressMonitor=progress monitor
125
126#
127# accessible states
128#
129managesDescendants=manages descendants
130indeterminate=indeterminate
131truncated=truncated
132
133# new for J2SE 1.6.0
134
135#
136# accessible roles
137#
138htmlcontainer=HTML container
139
140#
141# END OF MATERIAL TO LOCALIZE
142#
java/pkg/com/sun/accessibility/internal/resources/accessibility_es.properties+146−0
@@ -0,0 +1,146 @@
1#
2# This properties file is used to create a PropertyResourceBundle
3# It contains Locale specific strings used be the Accessibility package.
4#
5# When this file is read in, the strings are put into the
6# defaults table. This is an implementation detail of the current
7# workings of Accessibility. DO NOT DEPEND ON THIS.
8# This may change in future versions of Accessibility as we improve
9# localization support.
10#
11# @author Lynn Monsanto
12
13#
14# accessible roles
15#
16alert=alerta
17awtcomponent=componente AWT
18checkbox=casilla de control
19colorchooser=selector de color
20columnheader=cabecera de columna
21combobox=cuadro combinado
22canvas=lienzo
23desktopicon=icono de escritorio
24desktoppane=panel de escritorio
25dialog=cuadro de di\u00E1logo
26directorypane=panel de directorio
27glasspane=panel de cristal
28filechooser=selector de archivos
29filler=rellenador
30frame=marco
31internalframe=marco interno
32label=etiqueta
33layeredpane=panel en capas
34list=lista
35listitem=elemento de lista
36menubar=barra de men\u00FAs
37menu=men\u00FA
38menuitem=elemento de men\u00FA
39optionpane=panel de opciones
40pagetab=separador de p\u00E1gina
41pagetablist=lista de separadores de p\u00E1gina
42panel=panel
43passwordtext=texto de contrase\u00F1a
44popupmenu=men\u00FA emergente
45progressbar=barra de progreso
46pushbutton=bot\u00F3n
47radiobutton=bot\u00F3n de radio
48rootpane=panel ra\u00EDz
49rowheader=cabecera de filas
50scrollbar=barra de desplazamiento
51scrollpane=panel de desplazamiento
52separator=separador
53slider=deslizador
54splitpane=panel de divisi\u00F3n
55swingcomponent=componente swing
56table=tabla
57text=texto
58tree=\u00E1rbol
59togglebutton=bot\u00F3n conmutador
60toolbar=barra de herramientas
61tooltip=ayuda de burbuja
62unknown=desconocido
63viewport=viewport
64window=ventana
65#
66# accessible relations
67#
68labelFor=etiqueta para
69labeledBy=etiquetado por
70memberOf=miembro de
71controlledBy=controlledBy
72controllerFor=controllerFor
73#
74# accessible states
75#
76active=activo
77armed=armado
78busy=ocupado
79checked=activado
80collapsed=reducido
81editable=editable
82expandable=ampliable
83expanded=ampliado
84enabled=activado
85focusable=enfocable
86focused=enfocado
87iconified=convertido en icono
88modal=modal
89multiline=l\u00EDnea m\u00FAltiple
90multiselectable=multiseleccionable
91opaque=opaco
92pressed=pulsado
93resizable=redimensionable
94selectable=seleccionable
95selected=seleccionado
96showing=mostrando
97singleline=l\u00EDnea \u00FAnica
98transient=transitorio
99visible=visible
100vertical=vertical
101horizontal=horizontal
102#
103# accessible actions
104#
105toggle expand=activar/desactivar ampliaci\u00F3n
106
107# new relations, roles and states for J2SE 1.5.0
108
109#
110# accessible relations
111#
112flowsTo=llega a
113flowsFrom=procede de
114subwindowOf=ventana subordinada de
115parentWindowOf=ventana principal de
116embeds=embebe
117embeddedBy=embebido por
118childNodeOf=nodo secundario de
119
120#
121# accessible roles
122#
123header=cabecera
124footer=pie
125paragraph=p\u00E1rrafo
126ruler=regla
127editbar=barra de edici\u00F3n
128progressMonitor=monitor de progreso
129
130#
131# accessible states
132#
133managesDescendants=gestiona descendientes
134indeterminate=indeterminada
135truncated=truncado
136
137# new for J2SE 1.6.0
138
139#
140# accessible roles
141#
142htmlcontainer=Contenedor HTML
143
144#
145# END OF MATERIAL TO LOCALIZE
146#
java/pkg/com/sun/accessibility/internal/resources/accessibility_fr.properties+146−0
@@ -0,0 +1,146 @@
1#
2# This properties file is used to create a PropertyResourceBundle
3# It contains Locale specific strings used be the Accessibility package.
4#
5# When this file is read in, the strings are put into the
6# defaults table. This is an implementation detail of the current
7# workings of Accessibility. DO NOT DEPEND ON THIS.
8# This may change in future versions of Accessibility as we improve
9# localization support.
10#
11# @author Lynn Monsanto
12
13#
14# accessible roles
15#
16alert=alerte
17awtcomponent=composant AWT
18checkbox=case \u00E0 cocher
19colorchooser=s\u00E9lecteur de couleurs
20columnheader=en-t\u00EAte de colonne
21combobox=liste d\u00E9roulante
22canvas=canevas
23desktopicon=ic\u00F4ne de bureau
24desktoppane=panneau de bureau
25dialog=bo\u00EEte de dialogue
26directorypane=panneau de r\u00E9pertoires
27glasspane=panneau de grossissement
28filechooser=s\u00E9lecteur de fichiers
29filler=\u00E9l\u00E9ment de remplissage
30frame=cadre
31internalframe=cadre interne
32label=libell\u00E9
33layeredpane=panneau superpos\u00E9
34list=liste
35listitem=\u00E9l\u00E9ment de liste
36menubar=barre de menus
37menu=menu
38menuitem=option de menu
39optionpane=panneau d'options
40pagetab=onglet de page
41pagetablist=liste d'onglets de page
42panel=panneau
43passwordtext=texte de mot de passe
44popupmenu=menu contextuel
45progressbar=barre de progression
46pushbutton=bouton
47radiobutton=bouton radio
48rootpane=panneau racine
49rowheader=en-t\u00EAte de ligne
50scrollbar=barre de d\u00E9filement
51scrollpane=panneau de d\u00E9filement
52separator=s\u00E9parateur
53slider=curseur
54splitpane=panneau divis\u00E9
55swingcomponent=composant Swing
56table=tableau
57text=texte
58tree=arborescence
59togglebutton=bouton de basculement
60toolbar=barre d'outils
61tooltip=info-bulle
62unknown=inconnu
63viewport=lucarne
64window=fen\u00EAtre
65#
66# accessible relations
67#
68labelFor=libell\u00E9 de
69labeledBy=libell\u00E9 par
70memberOf=membre de
71controlledBy=contr\u00F4l\u00E9 par
72controllerFor=contr\u00F4leur pour
73#
74# accessible states
75#
76active=actif
77armed=arm\u00E9
78busy=occup\u00E9
79checked=coch\u00E9
80collapsed=r\u00E9duit
81editable=modifiable
82expandable=extensible
83expanded=d\u00E9velopp\u00E9
84enabled=activ\u00E9
85focusable=zone d'entr\u00E9e possible
86focused=avec zone d'entr\u00E9e
87iconified=r\u00E9duit \u00E0 une ic\u00F4ne
88modal=modal
89multiline=ligne multiple
90multiselectable=multis\u00E9lectionnable
91opaque=opaque
92pressed=enfonc\u00E9
93resizable=redimensionnable
94selectable=s\u00E9lectionnable
95selected=s\u00E9lectionn\u00E9
96showing=montrant
97singleline=ligne unique
98transient=non persistant
99visible=visible
100vertical=vertical
101horizontal=horizontal
102#
103# accessible actions
104#
105toggle expand=basculer le d\u00E9veloppement
106
107# new relations, roles and states for J2SE 1.5.0
108
109#
110# accessible relations
111#
112flowsTo=flux vers
113flowsFrom=flux depuis
114subwindowOf=sous-fen\u00EAtre de
115parentWindowOf=fen\u00EAtre parente de
116embeds=incorpore
117embeddedBy=incorpor\u00E9 par
118childNodeOf=noeud enfant de
119
120#
121# accessible roles
122#
123header=en-t\u00EAte
124footer=pied de page
125paragraph=paragraphe
126ruler=r\u00E8gle
127editbar=barre d'\u00E9dition
128progressMonitor=contr\u00F4le de la progression
129
130#
131# accessible states
132#
133managesDescendants=g\u00E8re les descendants
134indeterminate=ind\u00E9termin\u00E9
135truncated=tronqu\u00E9
136
137# new for J2SE 1.6.0
138
139#
140# accessible roles
141#
142htmlcontainer=conteneur HTML
143
144#
145# END OF MATERIAL TO LOCALIZE
146#
java/pkg/com/sun/accessibility/internal/resources/accessibility_it.properties+146−0
@@ -0,0 +1,146 @@
1#
2# This properties file is used to create a PropertyResourceBundle
3# It contains Locale specific strings used be the Accessibility package.
4#
5# When this file is read in, the strings are put into the
6# defaults table. This is an implementation detail of the current
7# workings of Accessibility. DO NOT DEPEND ON THIS.
8# This may change in future versions of Accessibility as we improve
9# localization support.
10#
11# @author Lynn Monsanto
12
13#
14# accessible roles
15#
16alert=avviso
17awtcomponent=componente AWT
18checkbox=casella di controllo
19colorchooser=selezione colori
20columnheader=intestazione colonna
21combobox=casella combinata
22canvas=sfondo
23desktopicon=icona desktop
24desktoppane=riquadro desktop
25dialog=finestra di dialogo
26directorypane=riquadro directory
27glasspane=riquadro trasparente
28filechooser=selezione file
29filler=utilit\u00E0 riempimento
30frame=cornice
31internalframe=cornice interna
32label=etichetta
33layeredpane=riquadro a livelli
34list=lista
35listitem=voce lista
36menubar=barra dei menu
37menu=menu
38menuitem=voce di menu
39optionpane=riquadro opzioni
40pagetab=scheda pagina
41pagetablist=lista schede pagina
42panel=pannello
43passwordtext=testo della password
44popupmenu=menu popup
45progressbar=barra di avanzamento
46pushbutton=pulsante
47radiobutton=pulsante di scelta
48rootpane=riquadro root
49rowheader=intestazione di riga
50scrollbar=barra di scorrimento
51scrollpane=riquadro scorrimento
52separator=separatore
53slider=dispositivo di scorrimento
54splitpane=riquadro doppio
55swingcomponent=componente swing
56table=tabella
57text=testo
58tree=albero
59togglebutton=interruttore
60toolbar=barra degli strumenti
61tooltip=descrizione comandi
62unknown=sconosciuto
63viewport=viewport
64window=finestra
65#
66# accessible relations
67#
68labelFor=etichetta per
69labeledBy=etichetta di
70memberOf=membro di
71controlledBy=controlledBy
72controllerFor=controllerFor
73#
74# accessible states
75#
76active=attivo
77armed=abilitato
78busy=occupato
79checked=verificato
80collapsed=compresso
81editable=modificabile
82expandable=espandibile
83expanded=espanso
84enabled=abilitato
85focusable=attivabile in primo piano
86focused=in primo piano
87iconified=ridotto a icona
88modal=modale
89multiline=a righe multiple
90multiselectable=multi-selezionabile
91opaque=nascosto
92pressed=premuto
93resizable=ridimensionabile
94selectable=selezionabile
95selected=selezionato
96showing=visualizzato
97singleline=a riga singola
98transient=transitorio
99visible=visibile
100vertical=verticale
101horizontal=orizzontale
102#
103# accessible actions
104#
105toggle expand=abilita/disabilita espansione
106
107# new relations, roles and states for J2SE 1.5.0
108
109#
110# accessible relations
111#
112flowsTo=va verso
113flowsFrom=proviene da
114subwindowOf=sottofinestra di
115parentWindowOf=finestra di livello superiore di
116embeds=incorpora
117embeddedBy=incorporato da
118childNodeOf=nodo figlio di
119
120#
121# accessible roles
122#
123header=intestazione
124footer=pi\u00E8 di pagina
125paragraph=paragrafo
126ruler=righello
127editbar=barra di modifica
128progressMonitor=stato avanzamento
129
130#
131# accessible states
132#
133managesDescendants=gestisce i discendenti
134indeterminate=indeterminato
135truncated=troncato
136
137# new for J2SE 1.6.0
138
139#
140# accessible roles
141#
142htmlcontainer=Contenitore HTML
143
144#
145# END OF MATERIAL TO LOCALIZE
146#
java/pkg/com/sun/accessibility/internal/resources/accessibility_ja.properties+146−0
@@ -0,0 +1,146 @@
1#
2# This properties file is used to create a PropertyResourceBundle
3# It contains Locale specific strings used be the Accessibility package.
4#
5# When this file is read in, the strings are put into the
6# defaults table. This is an implementation detail of the current
7# workings of Accessibility. DO NOT DEPEND ON THIS.
8# This may change in future versions of Accessibility as we improve
9# localization support.
10#
11# @author Lynn Monsanto
12
13#
14# accessible roles
15#
16alert=\u30A2\u30E9\u30FC\u30C8
17awtcomponent=AWT\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8
18checkbox=\u30C1\u30A7\u30C3\u30AF\u30FB\u30DC\u30C3\u30AF\u30B9
19colorchooser=\u30AB\u30E9\u30FC\u30FB\u30C1\u30E5\u30FC\u30B6
20columnheader=\u5217\u30D8\u30C3\u30C0\u30FC
21combobox=\u30B3\u30F3\u30DC\u30FB\u30DC\u30C3\u30AF\u30B9
22canvas=\u30AD\u30E3\u30F3\u30D0\u30B9
23desktopicon=\u30C7\u30B9\u30AF\u30C8\u30C3\u30D7\u30FB\u30A2\u30A4\u30B3\u30F3
24desktoppane=\u30C7\u30B9\u30AF\u30C8\u30C3\u30D7\u533A\u753B
25dialog=\u30C0\u30A4\u30A2\u30ED\u30B0
26directorypane=\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u533A\u753B
27glasspane=\u30AC\u30E9\u30B9\u533A\u753B
28filechooser=\u30D5\u30A1\u30A4\u30EB\u30FB\u30C1\u30E5\u30FC\u30B6
29filler=\u30D5\u30A3\u30E9\u30FC
30frame=\u30D5\u30EC\u30FC\u30E0
31internalframe=\u5185\u90E8\u30D5\u30EC\u30FC\u30E0
32label=\u30E9\u30D9\u30EB
33layeredpane=\u968E\u5C64\u5316\u3055\u308C\u305F\u533A\u753B
34list=\u30EA\u30B9\u30C8
35listitem=\u30EA\u30B9\u30C8\u9805\u76EE
36menubar=\u30E1\u30CB\u30E5\u30FC\u30FB\u30D0\u30FC
37menu=\u30E1\u30CB\u30E5\u30FC
38menuitem=\u30E1\u30CB\u30E5\u30FC\u9805\u76EE
39optionpane=\u30AA\u30D7\u30B7\u30E7\u30F3\u533A\u753B
40pagetab=\u30DA\u30FC\u30B8\u30FB\u30BF\u30D6
41pagetablist=\u30DA\u30FC\u30B8\u30FB\u30BF\u30D6\u30FB\u30EA\u30B9\u30C8
42panel=\u30D1\u30CD\u30EB
43passwordtext=\u30D1\u30B9\u30EF\u30FC\u30C9\u30FB\u30C6\u30AD\u30B9\u30C8
44popupmenu=\u30DD\u30C3\u30D7\u30A2\u30C3\u30D7\u30FB\u30E1\u30CB\u30E5\u30FC
45progressbar=\u9032\u6357\u30D0\u30FC
46pushbutton=\u30D7\u30C3\u30B7\u30E5\u30FB\u30DC\u30BF\u30F3
47radiobutton=\u30E9\u30B8\u30AA\u30FB\u30DC\u30BF\u30F3
48rootpane=\u30EB\u30FC\u30C8\u533A\u753B
49rowheader=\u884C\u30D8\u30C3\u30C0\u30FC
50scrollbar=\u30B9\u30AF\u30ED\u30FC\u30EB\u30FB\u30D0\u30FC
51scrollpane=\u30B9\u30AF\u30ED\u30FC\u30EB\u533A\u753B
52separator=\u30BB\u30D1\u30EC\u30FC\u30BF
53slider=\u30B9\u30E9\u30A4\u30C0
54splitpane=\u5206\u5272\u533A\u753B
55swingcomponent=Swing\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8
56table=\u8868
57text=\u30C6\u30AD\u30B9\u30C8
58tree=\u30C4\u30EA\u30FC
59togglebutton=\u30C8\u30B0\u30EB\u30FB\u30DC\u30BF\u30F3
60toolbar=\u30C4\u30FC\u30EB\u30D0\u30FC
61tooltip=\u30C4\u30FC\u30EB\u30C1\u30C3\u30D7
62unknown=\u4E0D\u660E
63viewport=\u30D3\u30E5\u30FC\u30DD\u30FC\u30C8
64window=\u30A6\u30A3\u30F3\u30C9\u30A6
65#
66# accessible relations
67#
68labelFor=label for
69labeledBy=labeled by
70memberOf=member of
71controlledBy=controlledBy
72controllerFor=controllerFor
73#
74# accessible states
75#
76active=\u30A2\u30AF\u30C6\u30A3\u30D6
77armed=\u4F5C\u52D5\u6E96\u5099\u5B8C\u4E86
78busy=\u30D3\u30B8\u30FC
79checked=\u30C1\u30A7\u30C3\u30AF
80collapsed=\u77ED\u7E2E
81editable=\u7DE8\u96C6\u53EF\u80FD
82expandable=\u5C55\u958B\u53EF\u80FD
83expanded=\u5C55\u958B
84enabled=\u6709\u52B9
85focusable=\u30D5\u30A9\u30FC\u30AB\u30B9\u53EF\u80FD
86focused=\u30D5\u30A9\u30FC\u30AB\u30B9
87iconified=\u30A2\u30A4\u30B3\u30F3\u5316
88modal=\u30E2\u30FC\u30C0\u30EB
89multiline=\u8907\u6570\u884C
90multiselectable=\u8907\u6570\u9078\u629E\u53EF\u80FD
91opaque=\u4E0D\u900F\u660E
92pressed=\u62BC\u4E0B
93resizable=\u30B5\u30A4\u30BA\u5909\u66F4\u53EF\u80FD
94selectable=\u9078\u629E\u53EF\u80FD
95selected=\u9078\u629E
96showing=\u8868\u793A
97singleline=\u5358\u4E00\u884C
98transient=\u4E00\u6642
99visible=\u53EF\u8996
100vertical=\u5782\u76F4
101horizontal=\u6C34\u5E73
102#
103# accessible actions
104#
105toggle expand=\u30C8\u30B0\u30EB\u5C55\u958B
106
107# new relations, roles and states for J2SE 1.5.0
108
109#
110# accessible relations
111#
112flowsTo=flows to
113flowsFrom=flows from
114subwindowOf=subwindow of
115parentWindowOf=parent window of
116embeds=\u57CB\u8FBC\u307F
117embeddedBy=embedded by
118childNodeOf=child node of
119
120#
121# accessible roles
122#
123header=\u30D8\u30C3\u30C0\u30FC
124footer=\u30D5\u30C3\u30BF\u30FC
125paragraph=\u6BB5\u843D
126ruler=\u30EB\u30FC\u30E9\u30FC
127editbar=\u7DE8\u96C6\u30D0\u30FC
128progressMonitor=\u9032\u6357\u30E2\u30CB\u30BF\u30FC
129
130#
131# accessible states
132#
133managesDescendants=\u5B50\u5B6B\u3092\u7BA1\u7406
134indeterminate=\u4E0D\u78BA\u5B9A
135truncated=\u4E0D\u5B8C\u5168
136
137# new for J2SE 1.6.0
138
139#
140# accessible roles
141#
142htmlcontainer=HTML\u30B3\u30F3\u30C6\u30CA
143
144#
145# END OF MATERIAL TO LOCALIZE
146#
java/pkg/com/sun/accessibility/internal/resources/accessibility_ko.properties+146−0
@@ -0,0 +1,146 @@
1#
2# This properties file is used to create a PropertyResourceBundle
3# It contains Locale specific strings used be the Accessibility package.
4#
5# When this file is read in, the strings are put into the
6# defaults table. This is an implementation detail of the current
7# workings of Accessibility. DO NOT DEPEND ON THIS.
8# This may change in future versions of Accessibility as we improve
9# localization support.
10#
11# @author Lynn Monsanto
12
13#
14# accessible roles
15#
16alert=\uACBD\uBCF4
17awtcomponent=AWT \uAD6C\uC131 \uC694\uC18C
18checkbox=\uCCB4\uD06C \uBC15\uC2A4
19colorchooser=\uC0C9\uC0C1 \uC120\uD0DD\uAE30
20columnheader=\uC5F4 \uBA38\uB9AC\uAE00
21combobox=\uCF64\uBCF4 \uC0C1\uC790
22canvas=\uCE94\uBC84\uC2A4
23desktopicon=\uBC14\uD0D5 \uD654\uBA74 \uC544\uC774\uCF58
24desktoppane=\uBC14\uD0D5 \uD654\uBA74 \uCC3D
25dialog=\uB300\uD654\uC0C1\uC790
26directorypane=\uB514\uB809\uD1A0\uB9AC \uCC3D
27glasspane=\uAE00\uB798\uC2A4 \uCC3D
28filechooser=\uD30C\uC77C \uC120\uD0DD\uAE30
29filler=\uD544\uB7EC
30frame=\uD504\uB808\uC784
31internalframe=\uB0B4\uBD80 \uD504\uB808\uC784
32label=\uB808\uC774\uBE14
33layeredpane=\uACC4\uCE35\uC801 \uCC3D
34list=\uBAA9\uB85D
35listitem=\uBAA9\uB85D \uD56D\uBAA9
36menubar=\uBA54\uB274 \uD45C\uC2DC\uC904
37menu=\uBA54\uB274
38menuitem=\uBA54\uB274 \uD56D\uBAA9
39optionpane=\uC635\uC158 \uCC3D
40pagetab=\uD398\uC774\uC9C0 \uD0ED
41pagetablist=\uD398\uC774\uC9C0 \uD0ED \uBAA9\uB85D
42panel=\uD328\uB110
43passwordtext=\uBE44\uBC00\uBC88\uD638 \uD14D\uC2A4\uD2B8
44popupmenu=\uD31D\uC5C5 \uBA54\uB274
45progressbar=\uC9C4\uD589 \uB9C9\uB300
46pushbutton=\uB204\uB984 \uB2E8\uCD94
47radiobutton=\uB77C\uB514\uC624 \uB2E8\uCD94
48rootpane=\uB8E8\uD2B8 \uCC3D
49rowheader=\uD589 \uBA38\uB9AC\uAE00
50scrollbar=\uC2A4\uD06C\uB864 \uB9C9\uB300
51scrollpane=\uC2A4\uD06C\uB864 \uCC3D
52separator=\uAD6C\uBD84 \uAE30\uD638
53slider=\uC2AC\uB77C\uC774\uB354
54splitpane=\uBD84\uD560 \uCC3D
55swingcomponent=\uD68C\uC804 \uAD6C\uC131 \uC694\uC18C
56table=\uD14C\uC774\uBE14
57text=\uD14D\uC2A4\uD2B8
58tree=\uD2B8\uB9AC
59togglebutton=\uD1A0\uAE00 \uB2E8\uCD94
60toolbar=\uB3C4\uAD6C \uBAA8\uC74C
61tooltip=\uB3C4\uAD6C \uC124\uBA85
62unknown=\uC54C \uC218 \uC5C6\uC74C
63viewport=\uBDF0\uD3EC\uD2B8
64window=\uCC3D
65#
66# accessible relations
67#
68labelFor=\uB808\uC774\uBE14 \uB300\uC0C1
69labeledBy=\uB808\uC774\uBE14 \uC9C0\uC815\uC790
70memberOf=\uC18C\uC18D \uADF8\uB8F9
71controlledBy=controlledBy
72controllerFor=controllerFor
73#
74# accessible states
75#
76active=\uD65C\uC131
77armed=\uD06C\uAE30
78busy=\uC0AC\uC6A9 \uC911
79checked=\uC120\uD0DD\uB428
80collapsed=\uCD95\uC18C\uB428
81editable=\uD3B8\uC9D1 \uAC00\uB2A5
82expandable=\uD655\uC7A5 \uAC00\uB2A5
83expanded=\uD655\uC7A5\uB428
84enabled=\uC0AC\uC6A9
85focusable=\uD3EC\uCEE4\uC2A4 \uAC00\uB2A5
86focused=\uD3EC\uCEE4\uC2A4\uB428
87iconified=\uC544\uC774\uCF58\uD654\uB428
88modal=\uBAA8\uB2EC
89multiline=\uBCF5\uC218 \uD589
90multiselectable=\uB2E4\uC911 \uC120\uD0DD \uAC00\uB2A5
91opaque=\uBD88\uD22C\uBA85
92pressed=\uB204\uB984
93resizable=\uD06C\uAE30 \uC870\uC815 \uAC00\uB2A5
94selectable=\uC120\uD0DD \uAC00\uB2A5
95selected=\uC120\uD0DD\uB428
96showing=\uD45C\uC2DC
97singleline=\uD55C \uC904
98transient=\uC77C\uC2DC
99visible=\uD45C\uC2DC \uAC00\uB2A5
100vertical=\uC138\uB85C
101horizontal=\uAC00\uB85C
102#
103# accessible actions
104#
105toggle \uD655\uC7A5=\uD1A0\uAE00 \uD655\uC7A5
106
107# new relations, roles and states for J2SE 1.5.0
108
109#
110# accessible relations
111#
112flowsTo=\uD750\uB984 \uB300\uC0C1
113flowsFrom=\uD750\uB984 \uCD9C\uCC98
114subwindowOf=\uD558\uC704 \uCC3D
115parentWindowOf=\uC0C1\uC704 \uCC3D
116embeds=\uD3EC\uD568
117embeddedBy=\uD3EC\uD568 \uC8FC\uCCB4
118childNodeOf=\uD558\uC704 \uB178\uB4DC
119
120#
121# accessible roles
122#
123header=\uBA38\uB9AC\uAE00
124footer=\uBC14\uB2E5\uAE00
125paragraph=\uB2E8\uB77D
126ruler=\uB208\uAE08\uC790
127editbar=\uD3B8\uC9D1 \uB3C4\uAD6C
128progressMonitor=\uC9C4\uD589 \uBAA8\uB2C8\uD130
129
130#
131# accessible states
132#
133managesDescendants=\uC885\uC18D \uD56D\uBAA9 \uAD00\uB9AC
134indeterminate=\uD655\uC815\uB418\uC9C0 \uC54A\uC74C
135truncated=\uC798\uB9BC
136
137# new for J2SE 1.6.0
138
139#
140# accessible roles
141#
142htmlcontainer=HTML \uCEE8\uD14C\uC774\uB108
143
144#
145# END OF MATERIAL TO LOCALIZE
146#
java/pkg/com/sun/accessibility/internal/resources/accessibility_pt_BR.properties+146−0
@@ -0,0 +1,146 @@
1#
2# This properties file is used to create a PropertyResourceBundle
3# It contains Locale specific strings used be the Accessibility package.
4#
5# When this file is read in, the strings are put into the
6# defaults table. This is an implementation detail of the current
7# workings of Accessibility. DO NOT DEPEND ON THIS.
8# This may change in future versions of Accessibility as we improve
9# localization support.
10#
11# @author Lynn Monsanto
12
13#
14# accessible roles
15#
16alert=alerta
17awtcomponent=componente AWT
18checkbox=caixa de sele\u00E7\u00E3o
19colorchooser=seletor de cores
20columnheader=cabe\u00E7alho da coluna
21combobox=caixa de combina\u00E7\u00E3o
22canvas=tela
23desktopicon=\u00EDcone da \u00E1rea de trabalho
24desktoppane=painel da \u00E1rea de trabalho
25dialog=caixa de di\u00E1logo
26directorypane=painel do diret\u00F3rio
27glasspane=painel transparente
28filechooser=seletor de arquivos
29filler=preenchedor
30frame=quadro
31internalframe=quadro interno
32label=r\u00F3tulo
33layeredpane=painel em camadas
34list=lista
35listitem=item da lista
36menubar=barra de menus
37menu=menu
38menuitem=item do menu
39optionpane=painel de op\u00E7\u00F5es
40pagetab=guia da p\u00E1gina
41pagetablist=lista de guias da p\u00E1gina
42panel=painel
43passwordtext=texto da senha
44popupmenu=menu pop-up
45progressbar=barra de progresso
46pushbutton=bot\u00E3o de a\u00E7\u00E3o
47radiobutton=bot\u00E3o de op\u00E7\u00E3o
48rootpane=painel base
49rowheader=cabe\u00E7alho da linha
50scrollbar=barra de rolagem
51scrollpane=painel de rolagem
52separator=separador
53slider=controle deslizante
54splitpane=painel dividido
55swingcomponent=componente swing
56table=tabela
57text=texto
58tree=\u00E1rvore
59togglebutton=bot\u00E3o de altern\u00E2ncia
60toolbar=barra de ferramentas
61tooltip=dica de ferramenta
62unknown=desconhecido
63viewport=janela de visualiza\u00E7\u00E3o
64window=janela
65#
66# accessible relations
67#
68labelFor=r\u00F3tulo de
69labeledBy=rotulado por
70memberOf=membro de
71controlledBy=controlledBy
72controllerFor=controllerFor
73#
74# accessible states
75#
76active=ativo
77armed=armado
78busy=ocupado
79checked=selecionado
80collapsed=recolhido
81editable=edit\u00E1vel
82expandable=expans\u00EDvel
83expanded=expandido
84enabled=ativado
85focusable=focaliz\u00E1vel
86focused=focalizado
87iconified=iconizado
88modal=modal
89multiline=v\u00E1rias linhas
90multiselectable=m\u00FAltipla escolha
91opaque=opaco
92pressed=pressionado
93resizable=redimension\u00E1vel
94selectable=selecion\u00E1vel
95selected=selecionado
96showing=mostrando
97singleline=linha \u00FAnica
98transient=transit\u00F3rio
99visible=vis\u00EDvel
100vertical=vertical
101horizontal=horizontal
102#
103# accessible actions
104#
105toggle expandir=alternar expans\u00E3o
106
107# new relations, roles and states for J2SE 1.5.0
108
109#
110# accessible relations
111#
112flowsTo=fluxos para
113flowsFrom=fluxos de
114subwindowOf=subjanela de
115parentWindowOf=janela pai de
116embeds=integra
117embeddedBy=integrado por
118childNodeOf=n\u00F3 filho de
119
120#
121# accessible roles
122#
123header=cabe\u00E7alho
124footer=rodap\u00E9
125paragraph=par\u00E1grafo
126ruler=r\u00E9gua
127editbar=barra de edi\u00E7\u00E3o
128progressMonitor=monitor de progresso
129
130#
131# accessible states
132#
133managesDescendants=gerencia descendentes
134indeterminate=indeterminado
135truncated=truncado
136
137# new for J2SE 1.6.0
138
139#
140# accessible roles
141#
142htmlcontainer=Container de HTML
143
144#
145# END OF MATERIAL TO LOCALIZE
146#
java/pkg/com/sun/accessibility/internal/resources/accessibility_sv.properties+146−0
@@ -0,0 +1,146 @@
1#
2# This properties file is used to create a PropertyResourceBundle
3# It contains Locale specific strings used be the Accessibility package.
4#
5# When this file is read in, the strings are put into the
6# defaults table. This is an implementation detail of the current
7# workings of Accessibility. DO NOT DEPEND ON THIS.
8# This may change in future versions of Accessibility as we improve
9# localization support.
10#
11# @author Lynn Monsanto
12
13#
14# accessible roles
15#
16alert=avisering
17awtcomponent=AWT-komponent
18checkbox=kryssruta
19colorchooser=f\u00E4rgv\u00E4ljare
20columnheader=kolumnrubrik
21combobox=kombinationsruta
22canvas=rityta
23desktopicon=skrivbordsikon
24desktoppane=skrivbordsruta
25dialog=dialogruta
26directorypane=katalogruta
27glasspane=glasruta
28filechooser=filv\u00E4ljare
29filler=utfyllnad
30frame=ram
31internalframe=intern ram
32label=etikett
33layeredpane=staplad ruta
34list=lista
35listitem=listobjekt
36menubar=menyrad
37menu=meny
38menuitem=menyalternativ
39optionpane=alternativruta
40pagetab=sidflik
41pagetablist=sidflikslista
42panel=panel
43passwordtext=l\u00F6senordstext
44popupmenu=snabbmeny
45progressbar=statusrad
46pushbutton=knapp
47radiobutton=alternativknapp
48rootpane=grundruta
49rowheader=radrubrik
50scrollbar=rullningslist
51scrollpane=rullningsruta
52separator=avskiljare
53slider=skjutreglage
54splitpane=delad ruta
55swingcomponent=swing-komponent
56table=tabell
57text=text
58tree=tr\u00E4d
59togglebutton=v\u00E4xlingsknapp
60toolbar=verktygsrad
61tooltip=knappbeskrivning
62unknown=ok\u00E4nd
63viewport=vyport
64window=f\u00F6nster
65#
66# accessible relations
67#
68labelFor=etikett f\u00F6r
69labeledBy=etikett av
70memberOf=medlem i
71controlledBy=controlledBy
72controllerFor=controllerFor
73#
74# accessible states
75#
76active=aktiv
77armed=redo
78busy=upptagen
79checked=markerad
80collapsed=komprimerad
81editable=redigerbar
82expandable=ut\u00F6kningsbar
83expanded=ut\u00F6kad
84enabled=aktiverad
85focusable=fokuseringsbar
86focused=fokuserad
87iconified=minimerad
88modal=modal
89multiline=flera rader
90multiselectable=flerval
91opaque=t\u00E4ckande
92pressed=nedtryckt
93resizable=storleks\u00E4ndringsbar
94selectable=valbar
95selected=vald
96showing=visas
97singleline=en rad
98transient=tillf\u00E4llig
99visible=synlig
100vertical=vertikal
101horizontal=horisontell
102#
103# accessible actions
104#
105toggle ut\u00F6ka=v\u00E4xla ut\u00F6ka
106
107# new relations, roles and states for J2SE 1.5.0
108
109#
110# accessible relations
111#
112flowsTo=fl\u00F6dar till
113flowsFrom=fl\u00F6dar fr\u00E5n
114subwindowOf=delf\u00F6nster av
115parentWindowOf=\u00F6verordnat f\u00F6nster f\u00F6r
116embeds=b\u00E4ddar in
117embeddedBy=b\u00E4ddas in av
118childNodeOf=underordnad nod f\u00F6r
119
120#
121# accessible roles
122#
123header=sidhuvud
124footer=sidfot
125paragraph=stycke
126ruler=linjal
127editbar=redigeringslist
128progressMonitor=f\u00F6rlopps\u00F6vervakare
129
130#
131# accessible states
132#
133managesDescendants=hanterar underordnade
134indeterminate=obest\u00E4mt
135truncated=kapad
136
137# new for J2SE 1.6.0
138
139#
140# accessible roles
141#
142htmlcontainer=HTML-container
143
144#
145# END OF MATERIAL TO LOCALIZE
146#
java/pkg/com/sun/accessibility/internal/resources/accessibility_zh_CN.properties+146−0
@@ -0,0 +1,146 @@
1#
2# This properties file is used to create a PropertyResourceBundle
3# It contains Locale specific strings used be the Accessibility package.
4#
5# When this file is read in, the strings are put into the
6# defaults table. This is an implementation detail of the current
7# workings of Accessibility. DO NOT DEPEND ON THIS.
8# This may change in future versions of Accessibility as we improve
9# localization support.
10#
11# @author Lynn Monsanto
12
13#
14# accessible roles
15#
16alert=\u9884\u8B66
17awtcomponent=AWT \u7EC4\u4EF6
18checkbox=\u590D\u9009\u6846
19colorchooser=\u989C\u8272\u9009\u62E9\u5668
20columnheader=\u5217\u6807\u9898
21combobox=\u7EC4\u5408\u6846
22canvas=\u753B\u5E03
23desktopicon=\u684C\u9762\u56FE\u6807
24desktoppane=\u684C\u9762\u7A97\u683C
25dialog=\u5BF9\u8BDD
26directorypane=\u76EE\u5F55\u7A97\u683C
27glasspane=\u73BB\u7483\u7A97\u683C
28filechooser=\u6587\u4EF6\u9009\u62E9\u5668
29filler=\u6F0F\u6597
30frame=\u5E27
31internalframe=\u5185\u90E8\u5E27
32label=\u6807\u7B7E
33layeredpane=\u5206\u5C42\u7A97\u683C
34list=\u5217\u8868
35listitem=\u5217\u8868\u9879
36menubar=\u83DC\u5355\u680F
37menu=\u83DC\u5355
38menuitem=\u83DC\u5355\u9879
39optionpane=\u9009\u9879\u7A97\u683C
40pagetab=\u9875\u6807\u7B7E
41pagetablist=\u9875\u6807\u7B7E\u5217\u8868
42panel=\u9762\u677F
43passwordtext=\u53E3\u4EE4\u6587\u672C
44popupmenu=\u5F39\u51FA\u5F0F\u83DC\u5355
45progressbar=\u8FDB\u5EA6\u680F
46pushbutton=\u6309\u94AE
47radiobutton=\u5355\u9009\u6309\u94AE
48rootpane=\u6839\u7A97\u683C
49rowheader=\u884C\u6807\u9898
50scrollbar=\u6EDA\u52A8\u6761
51scrollpane=\u6EDA\u52A8\u7A97\u683C
52separator=\u5206\u9694\u6761
53slider=\u6ED1\u5757
54splitpane=\u62C6\u5206\u7A97\u683C
55swingcomponent=\u65CB\u8F6C\u7EC4\u4EF6
56table=\u8868
57text=\u6587\u672C
58tree=\u6811
59togglebutton=\u5207\u6362\u6309\u94AE
60toolbar=\u5DE5\u5177\u680F
61tooltip=\u5DE5\u5177\u63D0\u793A
62unknown=\u672A\u77E5
63viewport=\u89C6\u7A97
64window=\u7A97\u53E3
65#
66# accessible relations
67#
68labelFor=\u6807\u7B7E\u5C5E\u4E8E
69labeledBy=\u6807\u7B7E\u5236\u4F5C\u8005
70memberOf=\u5C5E\u4E8E
71controlledBy=controlledBy
72controllerFor=controllerFor
73#
74# accessible states
75#
76active=\u6D3B\u52A8
77armed=\u5F85\u547D
78busy=\u5FD9
79checked=\u5DF2\u9009\u4E2D
80collapsed=\u5DF2\u6536\u7F29
81editable=\u53EF\u7F16\u8F91
82expandable=\u53EF\u5C55\u5F00
83expanded=\u5DF2\u5C55\u5F00
84enabled=\u542F\u7528
85focusable=\u53EF\u96C6\u4E2D
86focused=\u5DF2\u96C6\u4E2D
87iconified=\u56FE\u6807\u5F0F
88modal=\u6A21\u6001
89multiline=\u591A\u884C
90multiselectable=\u591A\u9009\u62E9
91opaque=\u4E0D\u900F\u660E
92pressed=\u5DF2\u6309\u4E0B
93resizable=\u53EF\u8C03\u6574\u5927\u5C0F
94selectable=\u53EF\u9009\u62E9
95selected=\u6240\u9009
96showing=\u6B63\u5728\u663E\u793A
97singleline=\u5355\u884C
98transient=\u77AC\u65F6
99visible=\u53EF\u89C1
100vertical=\u5782\u76F4
101horizontal=\u6C34\u5E73
102#
103# accessible actions
104#
105toggle expand=\u5207\u6362\u5C55\u5F00
106
107# new relations, roles and states for J2SE 1.5.0
108
109#
110# accessible relations
111#
112flowsTo=\u6D41\u5411
113flowsFrom=\u6D41\u81EA
114subwindowOf=\u5B50\u7A97\u53E3
115parentWindowOf=\u7236\u7A97\u53E3
116embeds=\u5D4C\u5165\u9879
117embeddedBy=\u5D4C\u5165\u8005
118childNodeOf=\u5B50\u8282\u70B9
119
120#
121# accessible roles
122#
123header=\u9875\u7709
124footer=\u9875\u811A
125paragraph=\u6BB5\u843D
126ruler=\u6807\u5C3A
127editbar=\u7F16\u8F91\u680F
128progressMonitor=\u8FDB\u5EA6\u76D1\u89C6\u5668
129
130#
131# accessible states
132#
133managesDescendants=\u7BA1\u7406\u5B50\u9879
134indeterminate=\u4E0D\u786E\u5B9A
135truncated=\u5DF2\u622A\u65AD
136
137# new for J2SE 1.6.0
138
139#
140# accessible roles
141#
142htmlcontainer=HTML \u5BB9\u5668
143
144#
145# END OF MATERIAL TO LOCALIZE
146#
java/pkg/com/sun/accessibility/internal/resources/accessibility_zh_TW.properties+146−0
@@ -0,0 +1,146 @@
1#
2# This properties file is used to create a PropertyResourceBundle
3# It contains Locale specific strings used be the Accessibility package.
4#
5# When this file is read in, the strings are put into the
6# defaults table. This is an implementation detail of the current
7# workings of Accessibility. DO NOT DEPEND ON THIS.
8# This may change in future versions of Accessibility as we improve
9# localization support.
10#
11# @author Lynn Monsanto
12
13#
14# accessible roles
15#
16alert=\u8B66\u793A
17awtcomponent=AWT \u5143\u4EF6
18checkbox=\u6838\u53D6\u65B9\u584A
19colorchooser=\u8272\u5F69\u9078\u64C7\u5668
20columnheader=\u76F4\u6B04\u6A19\u984C
21combobox=\u4E0B\u62C9\u5F0F\u6E05\u55AE\u65B9\u584A
22canvas=\u756B\u5E03
23desktopicon=\u684C\u9762\u5716\u793A
24desktoppane=\u684C\u9762\u7A97\u683C
25dialog=\u5C0D\u8A71\u65B9\u584A
26directorypane=\u76EE\u9304\u7A97\u683C
27glasspane=\u6AA2\u8996\u7A97\u683C
28filechooser=\u6A94\u6848\u9078\u64C7\u5668
29filler=\u586B\u5145\u7269
30frame=\u6846\u67B6
31internalframe=\u5167\u90E8\u6846\u67B6
32label=\u6A19\u7C64
33layeredpane=\u5206\u5C64\u7A97\u683C
34list=\u6E05\u55AE
35listitem=\u6E05\u55AE\u9805\u76EE
36menubar=\u529F\u80FD\u8868\u5217
37menu=\u529F\u80FD\u8868
38menuitem=\u529F\u80FD\u8868\u9805\u76EE
39optionpane=\u9078\u9805\u7A97\u683C
40pagetab=\u9801\u9762\u9801\u7C64
41pagetablist=\u9801\u9762\u9801\u7C64\u6E05\u55AE
42panel=\u9762\u677F
43passwordtext=\u5BC6\u78BC\u6587\u5B57
44popupmenu=\u5373\u73FE\u5F0F\u529F\u80FD\u8868
45progressbar=\u9032\u5EA6\u5217
46pushbutton=\u4E0B\u58D3\u6309\u9215
47radiobutton=\u55AE\u9078\u9215
48rootpane=root \u7A97\u683C
49rowheader=\u5217\u6A19\u984C
50scrollbar=\u6372\u8EF8
51scrollpane=\u6372\u52D5\u7A97\u683C
52separator=\u5206\u9694\u5143
53slider=\u6ED1\u52D5\u8EF8
54splitpane=\u5206\u5272\u7A97\u683C
55swingcomponent=Swing \u5143\u4EF6
56table=\u8868\u683C
57text=\u6587\u5B57
58tree=\u6A39\u72C0\u7D50\u69CB
59togglebutton=\u5207\u63DB\u6309\u9215
60toolbar=\u5DE5\u5177\u5217
61tooltip=\u5DE5\u5177\u63D0\u793A
62unknown=\u4E0D\u660E\u7684
63viewport=\u6AA2\u8996\u5340
64window=\u8996\u7A97
65#
66# accessible relations
67#
68labelFor=\u6A19\u793A\u5C0D\u8C61
69labeledBy=\u6A19\u793A\u8005
70memberOf=\u6240\u5C6C\u6210\u54E1
71controlledBy=\u63A7\u5236\u8005
72controllerFor=\u63A7\u5236\u5C0D\u8C61
73#
74# accessible states
75#
76active=\u4F5C\u7528\u4E2D
77armed=\u5DF2\u914D\u5099
78busy=\u5FD9\u788C\u4E2D
79checked=\u5DF2\u6838\u9078
80collapsed=\u5DF2\u6536\u7E2E
81editable=\u53EF\u7DE8\u8F2F
82expandable=\u53EF\u64F4\u5C55
83expanded=\u5DF2\u64F4\u5C55
84enabled=\u5DF2\u555F\u7528
85focusable=\u53EF\u805A\u7126
86focused=\u5DF2\u805A\u7126
87iconified=\u5DF2\u5716\u793A\u5316
88modal=\u6A21\u614B
89multiline=\u591A\u884C
90multiselectable=\u53EF\u591A\u91CD\u9078\u53D6
91opaque=\u4E0D\u900F\u660E
92pressed=\u5DF2\u6309\u4E0B
93resizable=\u53EF\u8ABF\u6574\u5927\u5C0F
94selectable=\u53EF\u9078\u53D6
95selected=\u5DF2\u9078\u53D6
96showing=\u986F\u793A
97singleline=\u55AE\u884C
98transient=\u66AB\u6642\u7684
99visible=\u53EF\u898B\u7684
100vertical=\u5782\u76F4
101horizontal=\u6C34\u5E73
102#
103# accessible actions
104#
105toggle expand=\u5207\u63DB\u64F4\u5C55
106
107# new relations, roles and states for J2SE 1.5.0
108
109#
110# accessible relations
111#
112flowsTo=\u6D41\u52D5\u81F3
113flowsFrom=\u6D41\u52D5\u81EA
114subwindowOf=\u5B50\u8996\u7A97
115parentWindowOf=\u7236\u7CFB\u8996\u7A97
116embeds=\u5167\u5D4C
117embeddedBy=\u5167\u5D4C\u8005
118childNodeOf=\u5B50\u7BC0\u9EDE
119
120#
121# accessible roles
122#
123header=\u9801\u9996
124footer=\u9801\u5C3E
125paragraph=\u6BB5\u843D
126ruler=\u5C3A\u898F
127editbar=\u7DE8\u8F2F\u5217
128progressMonitor=\u9032\u5EA6\u76E3\u8996\u5668
129
130#
131# accessible states
132#
133managesDescendants=\u7BA1\u7406\u5B50\u4EE3
134indeterminate=\u4E0D\u78BA\u5B9A
135truncated=\u5DF2\u622A\u65B7
136
137# new for J2SE 1.6.0
138
139#
140# accessible roles
141#
142htmlcontainer=HTML \u5BB9\u5668
143
144#
145# END OF MATERIAL TO LOCALIZE
146#
java/pkg/com/sun/accessibility/internal/resources/mkfile+2−0
@@ -0,0 +1,2 @@
1<../../../../../../../mkconfig
2
java/pkg/com/sun/accessibility/mkfile+6−0
@@ -0,0 +1,6 @@
1<../../../../../mkconfig
2
3DIRS=\
4 internal\
5
6<$ROOT/mkfiles/mksubdirs
java/pkg/com/sun/awt/AWTUtilities$1.class+0−0

Binary file not shown.

java/pkg/com/sun/awt/AWTUtilities$Translucency.class+0−0

Binary file not shown.

java/pkg/com/sun/awt/AWTUtilities.class+0−0

Binary file not shown.

java/pkg/com/sun/awt/AWTUtilities.java+462−0
@@ -0,0 +1,462 @@
1/*
2 * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26package com.sun.awt;
27
28import java.awt.*;
29
30import sun.awt.AWTAccessor;
31import sun.awt.SunToolkit;
32
33/**
34 * A collection of utility methods for AWT.
35 *
36 * The functionality provided by the static methods of the class includes:
37 * <ul>
38 * <li>Setting shapes on top-level windows
39 * <li>Setting a constant alpha value for each pixel of a top-level window
40 * <li>Making a window non-opaque, after that it paints only explicitly
41 * painted pixels on the screen, with arbitrary alpha values for every pixel.
42 * <li>Setting a 'mixing-cutout' shape for a component.
43 * </ul>
44 * <p>
45 * A "top-level window" is an instance of the {@code Window} class (or its
46 * descendant, such as {@code JFrame}).
47 * <p>
48 * Some of the mentioned features may not be supported by the native platform.
49 * To determine whether a particular feature is supported, the user must use
50 * the {@code isTranslucencySupported()} method of the class passing a desired
51 * translucency kind (a member of the {@code Translucency} enum) as an
52 * argument.
53 * <p>
54 * The per-pixel alpha feature also requires the user to create her/his
55 * windows using a translucency-capable graphics configuration.
56 * The {@code isTranslucencyCapable()} method must
57 * be used to verify whether any given GraphicsConfiguration supports
58 * the trasnlcency effects.
59 * <p>
60 * <b>WARNING</b>: This class is an implementation detail and only meant
61 * for limited use outside of the core platform. This API may change
62 * drastically between update release, and it may even be
63 * removed or be moved in some other package(s)/class(es).
64 */
65public final class AWTUtilities {
66
67 /**
68 * The AWTUtilities class should not be instantiated
69 */
70 private AWTUtilities() {
71 }
72
73 /** Kinds of translucency supported by the underlying system.
74 * @see #isTranslucencySupported
75 */
76 public static enum Translucency {
77 /**
78 * Represents support in the underlying system for windows each pixel
79 * of which is guaranteed to be either completely opaque, with
80 * an alpha value of 1.0, or completely transparent, with an alpha
81 * value of 0.0.
82 */
83 PERPIXEL_TRANSPARENT,
84
85 /**
86 * Represents support in the underlying system for windows all of
87 * the pixels of which have the same alpha value between or including
88 * 0.0 and 1.0.
89 */
90 TRANSLUCENT,
91
92 /**
93 * Represents support in the underlying system for windows that
94 * contain or might contain pixels with arbitrary alpha values
95 * between and including 0.0 and 1.0.
96 */
97 PERPIXEL_TRANSLUCENT;
98 }
99
100
101 /**
102 * Returns whether the given level of translucency is supported by
103 * the underlying system.
104 *
105 * Note that this method may sometimes return the value
106 * indicating that the particular level is supported, but
107 * the native windowing system may still not support the
108 * given level of translucency (due to the bugs in
109 * the windowing system).
110 *
111 * @param translucencyKind a kind of translucency support
112 * (either PERPIXEL_TRANSPARENT,
113 * TRANSLUCENT, or PERPIXEL_TRANSLUCENT)
114 * @return whether the given translucency kind is supported
115 */
116 public static boolean isTranslucencySupported(Translucency translucencyKind) {
117 switch (translucencyKind) {
118 case PERPIXEL_TRANSPARENT:
119 return isWindowShapingSupported();
120 case TRANSLUCENT:
121 return isWindowOpacitySupported();
122 case PERPIXEL_TRANSLUCENT:
123 return isWindowTranslucencySupported();
124 }
125 return false;
126 }
127
128
129 /**
130 * Returns whether the windowing system supports changing the opacity
131 * value of top-level windows.
132 * Note that this method may sometimes return true, but the native
133 * windowing system may still not support the concept of
134 * translucency (due to the bugs in the windowing system).
135 */
136 private static boolean isWindowOpacitySupported() {
137 Toolkit curToolkit = Toolkit.getDefaultToolkit();
138 if (!(curToolkit instanceof SunToolkit)) {
139 return false;
140 }
141 return ((SunToolkit)curToolkit).isWindowOpacitySupported();
142 }
143
144 /**
145 * Set the opacity of the window. The opacity is at the range [0..1].
146 * Note that setting the opacity level of 0 may or may not disable
147 * the mouse event handling on this window. This is
148 * a platform-dependent behavior.
149 *
150 * In order for this method to enable the translucency effect,
151 * the isTranslucencySupported() method should indicate that the
152 * TRANSLUCENT level of translucency is supported.
153 *
154 * <p>Also note that the window must not be in the full-screen mode
155 * when setting the opacity value &lt; 1.0f. Otherwise
156 * the IllegalArgumentException is thrown.
157 *
158 * @param window the window to set the opacity level to
159 * @param opacity the opacity level to set to the window
160 * @throws NullPointerException if the window argument is null
161 * @throws IllegalArgumentException if the opacity is out of
162 * the range [0..1]
163 * @throws IllegalArgumentException if the window is in full screen mode,
164 * and the opacity is less than 1.0f
165 * @throws UnsupportedOperationException if the TRANSLUCENT translucency
166 * kind is not supported
167 */
168 public static void setWindowOpacity(Window window, float opacity) {
169 if (window == null) {
170 throw new NullPointerException(
171 "The window argument should not be null.");
172 }
173
174 AWTAccessor.getWindowAccessor().setOpacity(window, opacity);
175 }
176
177 /**
178 * Get the opacity of the window. If the opacity has not
179 * yet being set, this method returns 1.0.
180 *
181 * @param window the window to get the opacity level from
182 * @throws NullPointerException if the window argument is null
183 */
184 public static float getWindowOpacity(Window window) {
185 if (window == null) {
186 throw new NullPointerException(
187 "The window argument should not be null.");
188 }
189
190 return AWTAccessor.getWindowAccessor().getOpacity(window);
191 }
192
193 /**
194 * Returns whether the windowing system supports changing the shape
195 * of top-level windows.
196 * Note that this method may sometimes return true, but the native
197 * windowing system may still not support the concept of
198 * shaping (due to the bugs in the windowing system).
199 */
200 public static boolean isWindowShapingSupported() {
201 Toolkit curToolkit = Toolkit.getDefaultToolkit();
202 if (!(curToolkit instanceof SunToolkit)) {
203 return false;
204 }
205 return ((SunToolkit)curToolkit).isWindowShapingSupported();
206 }
207
208 /**
209 * Returns an object that implements the Shape interface and represents
210 * the shape previously set with the call to the setWindowShape() method.
211 * If no shape has been set yet, or the shape has been reset to null,
212 * this method returns null.
213 *
214 * @param window the window to get the shape from
215 * @return the current shape of the window
216 * @throws NullPointerException if the window argument is null
217 */
218 public static Shape getWindowShape(Window window) {
219 if (window == null) {
220 throw new NullPointerException(
221 "The window argument should not be null.");
222 }
223 return AWTAccessor.getWindowAccessor().getShape(window);
224 }
225
226 /**
227 * Sets a shape for the given window.
228 * If the shape argument is null, this methods restores
229 * the default shape making the window rectangular.
230 * <p>Note that in order to set a shape, the window must be undecorated.
231 * If the window is decorated, this method ignores the {@code shape}
232 * argument and resets the shape to null.
233 * <p>Also note that the window must not be in the full-screen mode
234 * when setting a non-null shape. Otherwise the IllegalArgumentException
235 * is thrown.
236 * <p>Depending on the platform, the method may return without
237 * effecting the shape of the window if the window has a non-null warning
238 * string ({@link Window#getWarningString()}). In this case the passed
239 * shape object is ignored.
240 *
241 * @param window the window to set the shape to
242 * @param shape the shape to set to the window
243 * @throws NullPointerException if the window argument is null
244 * @throws IllegalArgumentException if the window is in full screen mode,
245 * and the shape is not null
246 * @throws UnsupportedOperationException if the PERPIXEL_TRANSPARENT
247 * translucency kind is not supported
248 */
249 public static void setWindowShape(Window window, Shape shape) {
250 if (window == null) {
251 throw new NullPointerException(
252 "The window argument should not be null.");
253 }
254 AWTAccessor.getWindowAccessor().setShape(window, shape);
255 }
256
257 private static boolean isWindowTranslucencySupported() {
258 /*
259 * Per-pixel alpha is supported if all the conditions are TRUE:
260 * 1. The toolkit is a sort of SunToolkit
261 * 2. The toolkit supports translucency in general
262 * (isWindowTranslucencySupported())
263 * 3. There's at least one translucency-capable
264 * GraphicsConfiguration
265 */
266
267 Toolkit curToolkit = Toolkit.getDefaultToolkit();
268 if (!(curToolkit instanceof SunToolkit)) {
269 return false;
270 }
271
272 if (!((SunToolkit)curToolkit).isWindowTranslucencySupported()) {
273 return false;
274 }
275
276 GraphicsEnvironment env =
277 GraphicsEnvironment.getLocalGraphicsEnvironment();
278
279 // If the default GC supports translucency return true.
280 // It is important to optimize the verification this way,
281 // see CR 6661196 for more details.
282 if (isTranslucencyCapable(env.getDefaultScreenDevice()
283 .getDefaultConfiguration()))
284 {
285 return true;
286 }
287
288 // ... otherwise iterate through all the GCs.
289 GraphicsDevice[] devices = env.getScreenDevices();
290
291 for (int i = 0; i < devices.length; i++) {
292 GraphicsConfiguration[] configs = devices[i].getConfigurations();
293 for (int j = 0; j < configs.length; j++) {
294 if (isTranslucencyCapable(configs[j])) {
295 return true;
296 }
297 }
298 }
299
300 return false;
301 }
302
303 /**
304 * Enables the per-pixel alpha support for the given window.
305 * Once the window becomes non-opaque (the isOpaque is set to false),
306 * the drawing sub-system is starting to respect the alpha value of each
307 * separate pixel. If a pixel gets painted with alpha color component
308 * equal to zero, it becomes visually transparent, if the alpha of the
309 * pixel is equal to 255, the pixel is fully opaque. Interim values
310 * of the alpha color component make the pixel semi-transparent (i.e.
311 * translucent).
312 * <p>Note that in order for the window to support the per-pixel alpha
313 * mode, the window must be created using the GraphicsConfiguration
314 * for which the {@link #isTranslucencyCapable}
315 * method returns true.
316 * <p>Also note that some native systems enable the per-pixel translucency
317 * mode for any window created using the translucency-compatible
318 * graphics configuration. However, it is highly recommended to always
319 * invoke the setWindowOpaque() method for these windows, at least for
320 * the sake of cross-platform compatibility reasons.
321 * <p>Also note that the window must not be in the full-screen mode
322 * when making it non-opaque. Otherwise the IllegalArgumentException
323 * is thrown.
324 * <p>If the window is a {@code Frame} or a {@code Dialog}, the window must
325 * be undecorated prior to enabling the per-pixel translucency effect (see
326 * {@link Frame#setUndecorated()} and/or {@link Dialog#setUndecorated()}).
327 * If the window becomes decorated through a subsequent call to the
328 * corresponding {@code setUndecorated()} method, the per-pixel
329 * translucency effect will be disabled and the opaque property reset to
330 * {@code true}.
331 * <p>Depending on the platform, the method may return without
332 * effecting the opaque property of the window if the window has a non-null
333 * warning string ({@link Window#getWarningString()}). In this case
334 * the passed 'isOpaque' value is ignored.
335 *
336 * @param window the window to set the shape to
337 * @param isOpaque whether the window must be opaque (true),
338 * or translucent (false)
339 * @throws NullPointerException if the window argument is null
340 * @throws IllegalArgumentException if the window uses
341 * a GraphicsConfiguration for which the
342 * {@code isTranslucencyCapable()}
343 * method returns false
344 * @throws IllegalArgumentException if the window is in full screen mode,
345 * and the isOpaque is false
346 * @throws IllegalArgumentException if the window is decorated and the
347 * isOpaque argument is {@code false}.
348 * @throws UnsupportedOperationException if the PERPIXEL_TRANSLUCENT
349 * translucency kind is not supported
350 */
351 public static void setWindowOpaque(Window window, boolean isOpaque) {
352 if (window == null) {
353 throw new NullPointerException(
354 "The window argument should not be null.");
355 }
356 if (!isOpaque && !isTranslucencySupported(Translucency.PERPIXEL_TRANSLUCENT)) {
357 throw new UnsupportedOperationException(
358 "The PERPIXEL_TRANSLUCENT translucency kind is not supported");
359 }
360 AWTAccessor.getWindowAccessor().setOpaque(window, isOpaque);
361 }
362
363 /**
364 * Returns whether the window is opaque or translucent.
365 *
366 * @param window the window to set the shape to
367 * @return whether the window is currently opaque (true)
368 * or translucent (false)
369 * @throws NullPointerException if the window argument is null
370 */
371 public static boolean isWindowOpaque(Window window) {
372 if (window == null) {
373 throw new NullPointerException(
374 "The window argument should not be null.");
375 }
376
377 return window.isOpaque();
378 }
379
380 /**
381 * Verifies whether a given GraphicsConfiguration supports
382 * the PERPIXEL_TRANSLUCENT kind of translucency.
383 * All windows that are intended to be used with the {@link #setWindowOpaque}
384 * method must be created using a GraphicsConfiguration for which this method
385 * returns true.
386 * <p>Note that some native systems enable the per-pixel translucency
387 * mode for any window created using a translucency-capable
388 * graphics configuration. However, it is highly recommended to always
389 * invoke the setWindowOpaque() method for these windows, at least
390 * for the sake of cross-platform compatibility reasons.
391 *
392 * @param gc GraphicsConfiguration
393 * @throws NullPointerException if the gc argument is null
394 * @return whether the given GraphicsConfiguration supports
395 * the translucency effects.
396 */
397 public static boolean isTranslucencyCapable(GraphicsConfiguration gc) {
398 if (gc == null) {
399 throw new NullPointerException("The gc argument should not be null");
400 }
401 /*
402 return gc.isTranslucencyCapable();
403 */
404 Toolkit curToolkit = Toolkit.getDefaultToolkit();
405 if (!(curToolkit instanceof SunToolkit)) {
406 return false;
407 }
408 return ((SunToolkit)curToolkit).isTranslucencyCapable(gc);
409 }
410
411 /**
412 * Sets a 'mixing-cutout' shape for the given component.
413 *
414 * By default a lightweight component is treated as an opaque rectangle for
415 * the purposes of the Heavyweight/Lightweight Components Mixing feature.
416 * This method enables developers to set an arbitrary shape to be cut out
417 * from heavyweight components positioned underneath the lightweight
418 * component in the z-order.
419 * <p>
420 * The {@code shape} argument may have the following values:
421 * <ul>
422 * <li>{@code null} - reverts the default cutout shape (the rectangle equal
423 * to the component's {@code getBounds()})
424 * <li><i>empty-shape</i> - does not cut out anything from heavyweight
425 * components. This makes the given lightweight component effectively
426 * transparent. Note that descendants of the lightweight component still
427 * affect the shapes of heavyweight components. An example of an
428 * <i>empty-shape</i> is {@code new Rectangle()}.
429 * <li><i>non-empty-shape</i> - the given shape will be cut out from
430 * heavyweight components.
431 * </ul>
432 * <p>
433 * The most common example when the 'mixing-cutout' shape is needed is a
434 * glass pane component. The {@link JRootPane#setGlassPane()} method
435 * automatically sets the <i>empty-shape</i> as the 'mixing-cutout' shape
436 * for the given glass pane component. If a developer needs some other
437 * 'mixing-cutout' shape for the glass pane (which is rare), this must be
438 * changed manually after installing the glass pane to the root pane.
439 * <p>
440 * Note that the 'mixing-cutout' shape neither affects painting, nor the
441 * mouse events handling for the given component. It is used exclusively
442 * for the purposes of the Heavyweight/Lightweight Components Mixing
443 * feature.
444 *
445 * @param component the component that needs non-default
446 * 'mixing-cutout' shape
447 * @param shape the new 'mixing-cutout' shape
448 * @throws NullPointerException if the component argument is {@code null}
449 */
450 public static void setComponentMixingCutoutShape(Component component,
451 Shape shape)
452 {
453 if (component == null) {
454 throw new NullPointerException(
455 "The component argument should not be null.");
456 }
457
458 AWTAccessor.getComponentAccessor().setMixingCutoutShape(component,
459 shape);
460 }
461}
462
java/pkg/com/sun/awt/SecurityWarning.java+169−0
@@ -0,0 +1,169 @@
1/*
2 * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26package com.sun.awt;
27
28import java.awt.*;
29import java.awt.geom.*;
30
31import sun.awt.AWTAccessor;
32
33
34/**
35 * Security Warning control interface.
36 *
37 * This class provides a couple of methods that help a developer relocate
38 * the AWT security warning to an appropriate position relative to the current
39 * window size. A "top-level window" is an instance of the {@code Window}
40 * class (or its descendant, such as {@code JFrame}). The security warning
41 * is applied to all windows created by an untrusted code. All such windows
42 * have a non-null "warning string" (see {@link Window#getWarningString()}).
43 * <p>
44 * <b>WARNING</b>: This class is an implementation detail and only meant
45 * for limited use outside of the core platform. This API may change
46 * drastically between update release, and it may even be
47 * removed or be moved to some other packages or classes.
48 */
49public final class SecurityWarning {
50
51 /**
52 * The SecurityWarning class should not be instantiated
53 */
54 private SecurityWarning() {
55 }
56
57 /**
58 * Gets the size of the security warning.
59 *
60 * The returned value is not valid until the peer has been created. Before
61 * invoking this method a developer must call the {@link Window#pack()},
62 * {@link Window#setVisible()}, or some other method that creates the peer.
63 *
64 * @param window the window to get the security warning size for
65 *
66 * @throws NullPointerException if the window argument is null
67 * @throws IllegalArgumentException if the window is trusted (i.e.
68 * the {@code getWarningString()} returns null)
69 */
70 public static Dimension getSize(Window window) {
71 if (window == null) {
72 throw new NullPointerException(
73 "The window argument should not be null.");
74 }
75 if (window.getWarningString() == null) {
76 throw new IllegalArgumentException(
77 "The window must have a non-null warning string.");
78 }
79 // We don't check for a non-null peer since it may be destroyed
80 // after assigning a valid value to the security warning size.
81
82 return AWTAccessor.getWindowAccessor().getSecurityWarningSize(window);
83 }
84
85 /**
86 * Sets the position of the security warning.
87 * <p>
88 * The {@code alignmentX} and {@code alignmentY} arguments specify the
89 * origin of the coordinate system used to calculate the position of the
90 * security warning. The values must be in the range [0.0f...1.0f]. The
91 * {@code 0.0f} value represents the left (top) edge of the rectangular
92 * bounds of the window. The {@code 1.0f} value represents the right
93 * (bottom) edge of the bounds. Whenever the size of the window changes,
94 * the origin of the coordinate system gets relocated accordingly. For
95 * convenience a developer may use the {@code Component.*_ALIGNMENT}
96 * constants to pass predefined values for these arguments.
97 * <p>
98 * The {@code point} argument specifies the location of the security
99 * warning in the coordinate system described above. If both {@code x} and
100 * {@code y} coordinates of the point are equal to zero, the warning will
101 * be located right in the origin of the coordinate system. On the other
102 * hand, if both {@code alignmentX} and {@code alignmentY} are equal to
103 * zero (i.e. the origin of the coordinate system is placed at the top-left
104 * corner of the window), then the {@code point} argument represents the
105 * absolute location of the security warning relative to the location of
106 * the window. The "absolute" in this case means that the position of the
107 * security warning is not effected by resizing of the window.
108 * <p>
109 * Note that the security warning managment code guarantees that:
110 * <ul>
111 * <li>The security warning cannot be located farther than two pixels from
112 * the rectangular bounds of the window (see {@link Window#getBounds}), and
113 * <li>The security warning is always visible on the screen.
114 * </ul>
115 * If either of the conditions is violated, the calculated position of the
116 * security warning is adjusted by the system to meet both these
117 * conditions.
118 * <p>
119 * The default position of the security warning is in the upper-right
120 * corner of the window, two pixels to the right from the right edge. This
121 * corresponds to the following arguments passed to this method:
122 * <ul>
123 * <li>{@code alignmentX = Component.RIGHT_ALIGNMENT}
124 * <li>{@code alignmentY = Component.TOP_ALIGNMENT}
125 * <li>{@code point = (2, 0)}
126 * </ul>
127 *
128 * @param window the window to set the position of the security warning for
129 * @param alignmentX the horizontal origin of the coordinate system
130 * @param alignmentY the vertical origin of the coordinate system
131 * @param point the position of the security warning in the specified
132 * coordinate system
133 *
134 * @throws NullPointerException if the window argument is null
135 * @throws NullPointerException if the point argument is null
136 * @throws IllegalArgumentException if the window is trusted (i.e.
137 * the {@code getWarningString()} returns null
138 * @throws IllegalArgumentException if the alignmentX or alignmentY
139 * arguments are not within the range [0.0f ... 1.0f]
140 */
141 public static void setPosition(Window window, Point2D point,
142 float alignmentX, float alignmentY)
143 {
144 if (window == null) {
145 throw new NullPointerException(
146 "The window argument should not be null.");
147 }
148 if (window.getWarningString() == null) {
149 throw new IllegalArgumentException(
150 "The window must have a non-null warning string.");
151 }
152 if (point == null) {
153 throw new NullPointerException(
154 "The point argument must not be null");
155 }
156 if (alignmentX < 0.0f || alignmentX > 1.0f) {
157 throw new IllegalArgumentException(
158 "alignmentX must be in the range [0.0f ... 1.0f].");
159 }
160 if (alignmentY < 0.0f || alignmentY > 1.0f) {
161 throw new IllegalArgumentException(
162 "alignmentY must be in the range [0.0f ... 1.0f].");
163 }
164
165 AWTAccessor.getWindowAccessor().setSecurityWarningPosition(window,
166 point, alignmentX, alignmentY);
167 }
168}
169
java/pkg/com/sun/awt/mkfile+9−0
@@ -0,0 +1,9 @@
1<../../../../../mkconfig
2
3TARG=\
4 AWTUtilities.dis\
5 SecurityWarning.dis\
6
7DISBIN=$ROOT/java/dis/java/java/com/sun/awt
8
9<$ROOT/mkfiles/mkjava
java/pkg/com/sun/beans/TypeResolver.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/TypeResolver.java+410−0
@@ -0,0 +1,410 @@
1/*
2 * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans;
26
27import java.lang.reflect.Array;
28import java.lang.reflect.GenericArrayType;
29import java.lang.reflect.ParameterizedType;
30import java.lang.reflect.Type;
31import java.lang.reflect.TypeVariable;
32import java.lang.reflect.WildcardType;
33import java.util.HashMap;
34import java.util.Map;
35
36import sun.reflect.generics.reflectiveObjects.GenericArrayTypeImpl;
37import sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl;
38
39/**
40 * This is utility class to resolve types.
41 *
42 * @since 1.7
43 *
44 * @author Eamonn McManus
45 * @author Sergey Malenkov
46 */
47public final class TypeResolver {
48 /**
49 * Replaces the given {@code type} in an inherited method
50 * with the actual type it has in the given {@code inClass}.
51 *
52 * <p>Although type parameters are not inherited by subclasses in the Java
53 * language, they <em>are</em> effectively inherited when using reflection.
54 * For example, if you declare an interface like this...</p>
55 *
56 * <pre>
57 * public interface StringToIntMap extends Map&lt;String,Integer> {}
58 * </pre>
59 *
60 * <p>...then StringToIntMap.class.getMethods() will show that it has methods
61 * like put(K,V) even though StringToIntMap has no type parameters. The K
62 * and V variables are the ones declared by Map, so
63 * {@link TypeVariable#getGenericDeclaration()} will return Map.class.</p>
64 *
65 * <p>The purpose of this method is to take a Type from a possibly-inherited
66 * method and replace it with the correct Type for the inheriting class.
67 * So given parameters of K and StringToIntMap.class in the above example,
68 * this method will return String.</p>
69 *
70 * @param inClass the base class used to resolve
71 * @param type the type to resolve
72 * @return a resolved type
73 *
74 * @see #getActualType(Class)
75 * @see #resolve(Type,Type)
76 */
77 public static Type resolveInClass(Class<?> inClass, Type type) {
78 return resolve(getActualType(inClass), type);
79 }
80
81 /**
82 * Replaces all {@code types} in the given array
83 * with the actual types they have in the given {@code inClass}.
84 *
85 * @param inClass the base class used to resolve
86 * @param types the array of types to resolve
87 * @return an array of resolved types
88 *
89 * @see #getActualType(Class)
90 * @see #resolve(Type,Type[])
91 */
92 public static Type[] resolveInClass(Class<?> inClass, Type[] types) {
93 return resolve(getActualType(inClass), types);
94 }
95
96 /**
97 * Replaces type variables of the given {@code formal} type
98 * with the types they stand for in the given {@code actual} type.
99 *
100 * <p>A ParameterizedType is a class with type parameters, and the values
101 * of those parameters. For example, Map&lt;K,V> is a generic class, and
102 * a corresponding ParameterizedType might look like
103 * Map&lt;K=String,V=Integer>. Given such a ParameterizedType, this method
104 * will replace K with String, or List&lt;K> with List&ltString;, or
105 * List&lt;? super K> with List&lt;? super String>.</p>
106 *
107 * <p>The {@code actual} argument to this method can also be a Class.
108 * In this case, either it is equivalent to a ParameterizedType with
109 * no parameters (for example, Integer.class), or it is equivalent to
110 * a "raw" ParameterizedType (for example, Map.class). In the latter
111 * case, every type parameter declared or inherited by the class is replaced
112 * by its "erasure". For a type parameter declared as &lt;T>, the erasure
113 * is Object. For a type parameter declared as &lt;T extends Number>,
114 * the erasure is Number.</p>
115 *
116 * <p>Although type parameters are not inherited by subclasses in the Java
117 * language, they <em>are</em> effectively inherited when using reflection.
118 * For example, if you declare an interface like this...</p>
119 *
120 * <pre>
121 * public interface StringToIntMap extends Map&lt;String,Integer> {}
122 * </pre>
123 *
124 * <p>...then StringToIntMap.class.getMethods() will show that it has methods
125 * like put(K,V) even though StringToIntMap has no type parameters. The K
126 * and V variables are the ones declared by Map, so
127 * {@link TypeVariable#getGenericDeclaration()} will return {@link Map Map.class}.</p>
128 *
129 * <p>For this reason, this method replaces inherited type parameters too.
130 * Therefore if this method is called with {@code actual} being
131 * StringToIntMap.class and {@code formal} being the K from Map,
132 * it will return {@link String String.class}.</p>
133 *
134 * <p>In the case where {@code actual} is a "raw" ParameterizedType, the
135 * inherited type parameters will also be replaced by their erasures.
136 * The erasure of a Class is the Class itself, so a "raw" subinterface of
137 * StringToIntMap will still show the K from Map as String.class. But
138 * in a case like this...
139 *
140 * <pre>
141 * public interface StringToIntListMap extends Map&lt;String,List&lt;Integer>> {}
142 * public interface RawStringToIntListMap extends StringToIntListMap {}
143 * </pre>
144 *
145 * <p>...the V inherited from Map will show up as List&lt;Integer> in
146 * StringToIntListMap, but as plain List in RawStringToIntListMap.</p>
147 *
148 * @param actual the type that supplies bindings for type variables
149 * @param formal the type where occurrences of the variables
150 * in {@code actual} will be replaced by the corresponding bound values
151 * @return a resolved type
152 *
153 * @see #TypeResolver(Type)
154 * @see #resolve(Type)
155 */
156 public static Type resolve(Type actual, Type formal) {
157 return new TypeResolver(actual).resolve(formal);
158 }
159
160 /**
161 * Replaces type variables of all formal types in the given array
162 * with the types they stand for in the given {@code actual} type.
163 *
164 * @param actual the type that supplies bindings for type variables
165 * @param formals the array of types to resolve
166 * @return an array of resolved types
167 *
168 * @see #TypeResolver(Type)
169 * @see #resolve(Type[])
170 */
171 public static Type[] resolve(Type actual, Type[] formals) {
172 return new TypeResolver(actual).resolve(formals);
173 }
174
175 /**
176 * Converts the given {@code type} to the corresponding class.
177 * This method implements the concept of type erasure,
178 * that is described in section 4.6 of
179 * <cite>The Java&trade; Language Specification</cite>.
180 *
181 * @param type the array of types to convert
182 * @return a corresponding class
183 */
184 public static Class<?> erase(Type type) {
185 if (type instanceof Class) {
186 return (Class<?>) type;
187 }
188 if (type instanceof ParameterizedType) {
189 ParameterizedType pt = (ParameterizedType) type;
190 return (Class<?>) pt.getRawType();
191 }
192 if (type instanceof TypeVariable) {
193 TypeVariable tv = (TypeVariable)type;
194 Type[] bounds = tv.getBounds();
195 return (0 < bounds.length)
196 ? erase(bounds[0])
197 : Object.class;
198 }
199 if (type instanceof WildcardType) {
200 WildcardType wt = (WildcardType)type;
201 Type[] bounds = wt.getUpperBounds();
202 return (0 < bounds.length)
203 ? erase(bounds[0])
204 : Object.class;
205 }
206 if (type instanceof GenericArrayType) {
207 GenericArrayType gat = (GenericArrayType)type;
208 return Array.newInstance(erase(gat.getGenericComponentType()), 0).getClass();
209 }
210 throw new IllegalArgumentException("Unknown Type kind: " + type.getClass());
211 }
212
213 /**
214 * Converts all {@code types} in the given array
215 * to the corresponding classes.
216 *
217 * @param types the array of types to convert
218 * @return an array of corresponding classes
219 *
220 * @see #erase(Type)
221 */
222 public static Class[] erase(Type[] types) {
223 int length = types.length;
224 Class[] classes = new Class[length];
225 for (int i = 0; i < length; i++) {
226 classes[i] = TypeResolver.erase(types[i]);
227 }
228 return classes;
229 }
230
231
232 private final Map<TypeVariable<?>, Type> map
233 = new HashMap<TypeVariable<?>, Type>();
234
235 /**
236 * Constructs the type resolver for the given actual type.
237 *
238 * @param actual the type that supplies bindings for type variables
239 *
240 * @see #prepare(Type)
241 */
242 private TypeResolver(Type actual) {
243 prepare(actual);
244 }
245
246 /**
247 * Fills the map from type parameters
248 * to types as seen by the given {@code type}.
249 * The method is recursive because the {@code type}
250 * inherits mappings from its parent classes and interfaces.
251 * The {@code type} can be either a {@link Class Class}
252 * or a {@link ParameterizedType ParameterizedType}.
253 * If it is a {@link Class Class}, it is either equivalent
254 * to a {@link ParameterizedType ParameterizedType} with no parameters,
255 * or it represents the erasure of a {@link ParameterizedType ParameterizedType}.
256 *
257 * @param type the next type in the hierarchy
258 */
259 private void prepare(Type type) {
260 Class<?> raw = (Class<?>)((type instanceof Class<?>)
261 ? type
262 : ((ParameterizedType)type).getRawType());
263
264 TypeVariable<?>[] formals = raw.getTypeParameters();
265
266 Type[] actuals = (type instanceof Class<?>)
267 ? formals
268 : ((ParameterizedType)type).getActualTypeArguments();
269
270 assert formals.length == actuals.length;
271 for (int i = 0; i < formals.length; i++) {
272 this.map.put(formals[i], actuals[i]);
273 }
274 Type gSuperclass = raw.getGenericSuperclass();
275 if (gSuperclass != null) {
276 prepare(gSuperclass);
277 }
278 for (Type gInterface : raw.getGenericInterfaces()) {
279 prepare(gInterface);
280 }
281 // If type is the raw version of a parameterized class, we type-erase
282 // all of its type variables, including inherited ones.
283 if (type instanceof Class<?> && formals.length > 0) {
284 for (Map.Entry<TypeVariable<?>, Type> entry : this.map.entrySet()) {
285 entry.setValue(erase(entry.getValue()));
286 }
287 }
288 }
289
290 /**
291 * Replaces the given {@code formal} type
292 * with the type it stand for in this type resolver.
293 *
294 * @param formal the array of types to resolve
295 * @return a resolved type
296 */
297 private Type resolve(Type formal) {
298 if (formal instanceof Class) {
299 return formal;
300 }
301 if (formal instanceof GenericArrayType) {
302 Type comp = ((GenericArrayType)formal).getGenericComponentType();
303 comp = resolve(comp);
304 return (comp instanceof Class)
305 ? Array.newInstance((Class<?>)comp, 0).getClass()
306 : GenericArrayTypeImpl.make(comp);
307 }
308 if (formal instanceof ParameterizedType) {
309 ParameterizedType fpt = (ParameterizedType)formal;
310 Type[] actuals = resolve(fpt.getActualTypeArguments());
311 return ParameterizedTypeImpl.make(
312 (Class<?>)fpt.getRawType(), actuals, fpt.getOwnerType());
313 }
314 if (formal instanceof WildcardType) {
315 WildcardType fwt = (WildcardType)formal;
316 Type[] upper = resolve(fwt.getUpperBounds());
317 Type[] lower = resolve(fwt.getLowerBounds());
318 return new WildcardTypeImpl(upper, lower);
319 }
320 if (!(formal instanceof TypeVariable)) {
321 throw new IllegalArgumentException("Bad Type kind: " + formal.getClass());
322 }
323 Type actual = this.map.get((TypeVariable) formal);
324 if (actual == null || actual.equals(formal)) {
325 return formal;
326 }
327 actual = fixGenericArray(actual);
328 return resolve(actual);
329 // A variable can be bound to another variable that is itself bound
330 // to something. For example, given:
331 // class Super<T> {...}
332 // class Mid<X> extends Super<T> {...}
333 // class Sub extends Mid<String>
334 // the variable T is bound to X, which is in turn bound to String.
335 // So if we have to resolve T, we need the tail recursion here.
336 }
337
338 /**
339 * Replaces all formal types in the given array
340 * with the types they stand for in this type resolver.
341 *
342 * @param formals the array of types to resolve
343 * @return an array of resolved types
344 *
345 * @see #resolve(Type)
346 */
347 private Type[] resolve(Type[] formals) {
348 int length = formals.length;
349 Type[] actuals = new Type[length];
350 for (int i = 0; i < length; i++) {
351 actuals[i] = resolve(formals[i]);
352 }
353 return actuals;
354 }
355
356 /**
357 * Replaces a {@link GenericArrayType GenericArrayType}
358 * with plain array class where it is possible.
359 * Bug <a href="http://bugs.sun.com/view_bug.do?bug_id=5041784">5041784</a>
360 * is that arrays of non-generic type sometimes show up
361 * as {@link GenericArrayType GenericArrayType} when using reflection.
362 * For example, a {@code String[]} might show up
363 * as a {@link GenericArrayType GenericArrayType}
364 * where {@link GenericArrayType#getGenericComponentType getGenericComponentType}
365 * is {@code String.class}. This violates the specification,
366 * which says that {@link GenericArrayType GenericArrayType}
367 * is used when the component type is a type variable or parameterized type.
368 * We fit the specification here.
369 *
370 * @param type the type to fix
371 * @return a corresponding type for the generic array type,
372 * or the same type as {@code type}
373 */
374 private static Type fixGenericArray(Type type) {
375 if (type instanceof GenericArrayType) {
376 Type comp = ((GenericArrayType)type).getGenericComponentType();
377 comp = fixGenericArray(comp);
378 if (comp instanceof Class) {
379 return Array.newInstance((Class<?>)comp, 0).getClass();
380 }
381 }
382 return type;
383 }
384
385 /**
386 * Replaces a {@link Class Class} with type parameters
387 * with a {@link ParameterizedType ParameterizedType}
388 * where every parameter is bound to itself.
389 * When calling {@link #resolveInClass} in the context of {@code inClass},
390 * we can't just pass {@code inClass} as the {@code actual} parameter,
391 * because if {@code inClass} has type parameters
392 * that would be interpreted as accessing the raw type,
393 * so we would get unwanted erasure.
394 * This is why we bind each parameter to itself.
395 * If {@code inClass} does have type parameters and has methods
396 * where those parameters appear in the return type or argument types,
397 * we will correctly leave those types alone.
398 *
399 * @param inClass the base class used to resolve
400 * @return a parameterized type for the class,
401 * or the same class as {@code inClass}
402 */
403 private static Type getActualType(Class<?> inClass) {
404 Type[] params = inClass.getTypeParameters();
405 return (params.length == 0)
406 ? inClass
407 : ParameterizedTypeImpl.make(
408 inClass, params, inClass.getEnclosingClass());
409 }
410}
java/pkg/com/sun/beans/WeakCache.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/WeakCache.java+91−0
@@ -0,0 +1,91 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans;
26
27import java.lang.ref.Reference;
28import java.lang.ref.WeakReference;
29
30import java.util.Map;
31import java.util.WeakHashMap;
32
33/**
34 * A hashtable-based cache with weak keys and weak values.
35 * An entry in the map will be automatically removed
36 * when its key is no longer in the ordinary use.
37 * A value will be automatically removed as well
38 * when it is no longer in the ordinary use.
39 *
40 * @since 1.7
41 *
42 * @author Sergey A. Malenkov
43 */
44public final class WeakCache<K, V> {
45 private final Map<K, Reference<V>> map = new WeakHashMap<K, Reference<V>>();
46
47 /**
48 * Returns a value to which the specified {@code key} is mapped,
49 * or {@code null} if this map contains no mapping for the {@code key}.
50 *
51 * @param key the key whose associated value is returned
52 * @return a value to which the specified {@code key} is mapped
53 */
54 public V get(K key) {
55 Reference<V> reference = this.map.get(key);
56 if (reference == null) {
57 return null;
58 }
59 V value = reference.get();
60 if (value == null) {
61 this.map.remove(key);
62 }
63 return value;
64 }
65
66 /**
67 * Associates the specified {@code value} with the specified {@code key}.
68 * Removes the mapping for the specified {@code key} from this cache
69 * if it is present and the specified {@code value} is {@code null}.
70 * If the cache previously contained a mapping for the {@code key},
71 * the old value is replaced by the specified {@code value}.
72 *
73 * @param key the key with which the specified value is associated
74 * @param value the value to be associated with the specified key
75 */
76 public void put(K key, V value) {
77 if (value != null) {
78 this.map.put(key, new WeakReference<V>(value));
79 }
80 else {
81 this.map.remove(key);
82 }
83 }
84
85 /**
86 * Removes all of the mappings from this cache.
87 */
88 public void clear() {
89 this.map.clear();
90 }
91}
java/pkg/com/sun/beans/WildcardTypeImpl.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/WildcardTypeImpl.java+161−0
@@ -0,0 +1,161 @@
1/*
2 * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans;
26
27import java.lang.reflect.Type;
28import java.lang.reflect.WildcardType;
29import java.util.Arrays;
30
31/**
32 * This class implements {@link WildcardType WildcardType} compatibly with the JDK's
33 * {@link sun.reflect.generics.reflectiveObjects.WildcardTypeImpl WildcardTypeImpl}.
34 * Unfortunately we can't use the JDK's
35 * {@link sun.reflect.generics.reflectiveObjects.WildcardTypeImpl WildcardTypeImpl} here as we do for
36 * {@link sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl ParameterizedTypeImpl} and
37 * {@link sun.reflect.generics.reflectiveObjects.GenericArrayTypeImpl GenericArrayTypeImpl},
38 * because {@link sun.reflect.generics.reflectiveObjects.WildcardTypeImpl WildcardTypeImpl}'s
39 * constructor takes parameters representing intermediate structures obtained during class-file parsing.
40 * We could reconstruct versions of those structures but it would be more trouble than it's worth.
41 *
42 * @since 1.7
43 *
44 * @author Eamonn McManus
45 * @author Sergey Malenkov
46 */
47final class WildcardTypeImpl implements WildcardType {
48 private final Type[] upperBounds;
49 private final Type[] lowerBounds;
50
51 /**
52 * Creates a wildcard type with the requested bounds.
53 * Note that the array arguments are not cloned
54 * because instances of this class are never constructed
55 * from outside the containing package.
56 *
57 * @param upperBounds the array of types representing
58 * the upper bound(s) of this type variable
59 * @param lowerBounds the array of types representing
60 * the lower bound(s) of this type variable
61 */
62 WildcardTypeImpl(Type[] upperBounds, Type[] lowerBounds) {
63 this.upperBounds = upperBounds;
64 this.lowerBounds = lowerBounds;
65 }
66
67 /**
68 * Returns an array of {@link Type Type} objects
69 * representing the upper bound(s) of this type variable.
70 * Note that if no upper bound is explicitly declared,
71 * the upper bound is {@link Object Object}.
72 *
73 * @return an array of types representing
74 * the upper bound(s) of this type variable
75 */
76 public Type[] getUpperBounds() {
77 return this.upperBounds.clone();
78 }
79
80 /**
81 * Returns an array of {@link Type Type} objects
82 * representing the lower bound(s) of this type variable.
83 * Note that if no lower bound is explicitly declared,
84 * the lower bound is the type of {@code null}.
85 * In this case, a zero length array is returned.
86 *
87 * @return an array of types representing
88 * the lower bound(s) of this type variable
89 */
90 public Type[] getLowerBounds() {
91 return this.lowerBounds.clone();
92 }
93
94 /**
95 * Indicates whether some other object is "equal to" this one.
96 * It is implemented compatibly with the JDK's
97 * {@link sun.reflect.generics.reflectiveObjects.WildcardTypeImpl WildcardTypeImpl}.
98 *
99 * @param object the reference object with which to compare
100 * @return {@code true} if this object is the same as the object argument;
101 * {@code false} otherwise
102 * @see sun.reflect.generics.reflectiveObjects.WildcardTypeImpl#equals
103 */
104 @Override
105 public boolean equals(Object object) {
106 if (object instanceof WildcardType) {
107 WildcardType type = (WildcardType) object;
108 return Arrays.equals(this.upperBounds, type.getUpperBounds())
109 && Arrays.equals(this.lowerBounds, type.getLowerBounds());
110 }
111 return false;
112 }
113
114 /**
115 * Returns a hash code value for the object.
116 * It is implemented compatibly with the JDK's
117 * {@link sun.reflect.generics.reflectiveObjects.WildcardTypeImpl WildcardTypeImpl}.
118 *
119 * @return a hash code value for this object
120 * @see sun.reflect.generics.reflectiveObjects.WildcardTypeImpl#hashCode
121 */
122 @Override
123 public int hashCode() {
124 return Arrays.hashCode(this.upperBounds)
125 ^ Arrays.hashCode(this.lowerBounds);
126 }
127
128 /**
129 * Returns a string representation of the object.
130 * It is implemented compatibly with the JDK's
131 * {@link sun.reflect.generics.reflectiveObjects.WildcardTypeImpl WildcardTypeImpl}.
132 *
133 * @return a string representation of the object
134 * @see sun.reflect.generics.reflectiveObjects.WildcardTypeImpl#toString
135 */
136 @Override
137 public String toString() {
138 StringBuilder sb;
139 Type[] bounds;
140 if (this.lowerBounds.length == 0) {
141 if (this.upperBounds.length == 0 || Object.class == this.upperBounds[0]) {
142 return "?";
143 }
144 bounds = this.upperBounds;
145 sb = new StringBuilder("? extends ");
146 }
147 else {
148 bounds = this.lowerBounds;
149 sb = new StringBuilder("? super ");
150 }
151 for (int i = 0; i < bounds.length; i++) {
152 if (i > 0) {
153 sb.append(" & ");
154 }
155 sb.append((bounds[i] instanceof Class)
156 ? ((Class) bounds[i]).getName()
157 : bounds[i].toString());
158 }
159 return sb.toString();
160 }
161}
java/pkg/com/sun/beans/decoder/AccessorElementHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/decoder/AccessorElementHandler.java+105−0
@@ -0,0 +1,105 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.decoder;
26
27/**
28 * This is base class that simplifies access to entities (fields or properties).
29 * The {@code name} attribute specifies the name of the accessible entity.
30 * The element defines getter if it contains no argument
31 * or setter if it contains one argument.
32 *
33 * @since 1.7
34 *
35 * @author Sergey A. Malenkov
36 */
37abstract class AccessorElementHandler extends ElementHandler {
38 private String name;
39 private ValueObject value;
40
41 /**
42 * Parses attributes of the element.
43 * The following atributes are supported:
44 * <dl>
45 * <dt>name
46 * <dd>the name of the accessible entity
47 * <dt>id
48 * <dd>the identifier of the variable that is intended to store the result
49 * </dl>
50 *
51 * @param name the attribute name
52 * @param value the attribute value
53 */
54 @Override
55 public void addAttribute(String name, String value) {
56 if (name.equals("name")) { // NON-NLS: the attribute name
57 this.name = value;
58 } else {
59 super.addAttribute(name, value);
60 }
61 }
62
63 /**
64 * Adds the argument that is used to set the value of this element.
65 *
66 * @param argument the value of the element that contained in this one
67 */
68 @Override
69 protected final void addArgument(Object argument) {
70 if (this.value != null) {
71 throw new IllegalStateException("Could not add argument to evaluated element");
72 }
73 setValue(this.name, argument);
74 this.value = ValueObjectImpl.VOID;
75 }
76
77 /**
78 * Returns the value of this element.
79 *
80 * @return the value of this element
81 */
82 @Override
83 protected final ValueObject getValueObject() {
84 if (this.value == null) {
85 this.value = ValueObjectImpl.create(getValue(this.name));
86 }
87 return this.value;
88 }
89
90 /**
91 * Returns the value of the entity with specified {@code name}.
92 *
93 * @param name the name of the accessible entity
94 * @return the value of the specified entity
95 */
96 protected abstract Object getValue(String name);
97
98 /**
99 * Sets the new value for the entity with specified {@code name}.
100 *
101 * @param name the name of the accessible entity
102 * @param value the new value for the specified entity
103 */
104 protected abstract void setValue(String name, Object value);
105}
java/pkg/com/sun/beans/decoder/ArrayElementHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/decoder/ArrayElementHandler.java+133−0
@@ -0,0 +1,133 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.decoder;
26
27import java.lang.reflect.Array;
28
29/**
30 * This class is intended to handle &lt;array&gt; element,
31 * that is used to array creation.
32 * The {@code length} attribute specifies the length of the array.
33 * The {@code class} attribute specifies the elements type.
34 * The {@link Object} type is used by default.
35 * For example:<pre>
36 * &lt;array length="10"/&gt;</pre>
37 * is equivalent to {@code new Component[10]} in Java code.
38 * The {@code set} and {@code get} methods,
39 * as defined in the {@link java.util.List} interface,
40 * can be used as if they could be applied to array instances.
41 * The {@code index} attribute can thus be used with arrays.
42 * For example:<pre>
43 * &lt;array length="3" class="java.lang.String"&gt;
44 * &lt;void index="1"&gt;
45 * &lt;string&gt;Hello, world&lt;/string&gt;
46 * &lt;/void&gt;
47 * &lt;/array&gt;</pre>
48 * is equivalent to the following Java code:<pre>
49 * String[] s = new String[3];
50 * s[1] = "Hello, world";</pre>
51 * It is possible to omit the {@code length} attribute and
52 * specify the values directly, without using {@code void} tags.
53 * The length of the array is equal to the number of values specified.
54 * For example:<pre>
55 * &lt;array id="array" class="int"&gt;
56 * &lt;int&gt;123&lt;/int&gt;
57 * &lt;int&gt;456&lt;/int&gt;
58 * &lt;/array&gt;</pre>
59 * is equivalent to {@code int[] array = {123, 456}} in Java code.
60 * <p>The following atributes are supported:
61 * <dl>
62 * <dt>length
63 * <dd>the array length
64 * <dt>class
65 * <dd>the type of object for instantiation
66 * <dt>id
67 * <dd>the identifier of the variable that is intended to store the result
68 * </dl>
69 *
70 * @since 1.7
71 *
72 * @author Sergey A. Malenkov
73 */
74final class ArrayElementHandler extends NewElementHandler {
75 private Integer length;
76
77 /**
78 * Parses attributes of the element.
79 * The following atributes are supported:
80 * <dl>
81 * <dt>length
82 * <dd>the array length
83 * <dt>class
84 * <dd>the type of object for instantiation
85 * <dt>id
86 * <dd>the identifier of the variable that is intended to store the result
87 * </dl>
88 *
89 * @param name the attribute name
90 * @param value the attribute value
91 */
92 @Override
93 public void addAttribute(String name, String value) {
94 if (name.equals("length")) { // NON-NLS: the attribute name
95 this.length = Integer.valueOf(value);
96 } else {
97 super.addAttribute(name, value);
98 }
99 }
100
101 /**
102 * Calculates the value of this element
103 * if the lentgh attribute is set.
104 */
105 @Override
106 public void startElement() {
107 if (this.length != null) {
108 getValueObject();
109 }
110 }
111
112 /**
113 * Creates an instance of the array.
114 *
115 * @param type the base class
116 * @param args the array of arguments
117 * @return the value of this element
118 */
119 @Override
120 protected ValueObject getValueObject(Class<?> type, Object[] args) {
121 if (type == null) {
122 type = Object.class;
123 }
124 if (this.length != null) {
125 return ValueObjectImpl.create(Array.newInstance(type, this.length));
126 }
127 Object array = Array.newInstance(type, args.length);
128 for (int i = 0; i < args.length; i++) {
129 Array.set(array, i, args[i]);
130 }
131 return ValueObjectImpl.create(array);
132 }
133}
java/pkg/com/sun/beans/decoder/BooleanElementHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/decoder/BooleanElementHandler.java+69−0
@@ -0,0 +1,69 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.decoder;
26
27/**
28 * This class is intended to handle &lt;boolean&gt; element.
29 * This element specifies {@code boolean} values.
30 * The class {@link Boolean} is used as wrapper for these values.
31 * The result value is created from text of the body of this element.
32 * The body parsing is described in the class {@link StringElementHandler}.
33 * For example:<pre>
34 * &lt;boolean&gt;true&lt;/boolean&gt;</pre>
35 * is shortcut to<pre>
36 * &lt;method name="valueOf" class="java.lang.Boolean"&gt;
37 * &lt;string&gt;true&lt;/string&gt;
38 * &lt;/method&gt;</pre>
39 * which is equivalent to {@code Boolean.valueOf("true")} in Java code.
40 * <p>The following atribute is supported:
41 * <dl>
42 * <dt>id
43 * <dd>the identifier of the variable that is intended to store the result
44 * </dl>
45 *
46 * @since 1.7
47 *
48 * @author Sergey A. Malenkov
49 */
50final class BooleanElementHandler extends StringElementHandler {
51
52 /**
53 * Creates {@code boolean} value from
54 * the text of the body of this element.
55 *
56 * @param argument the text of the body
57 * @return evaluated {@code boolean} value
58 */
59 @Override
60 public Object getValue(String argument) {
61 if (Boolean.TRUE.toString().equalsIgnoreCase(argument)) {
62 return Boolean.TRUE;
63 }
64 if (Boolean.FALSE.toString().equalsIgnoreCase(argument)) {
65 return Boolean.FALSE;
66 }
67 throw new IllegalArgumentException("Unsupported boolean argument: " + argument);
68 }
69}
java/pkg/com/sun/beans/decoder/ByteElementHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/decoder/ByteElementHandler.java+63−0
@@ -0,0 +1,63 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.decoder;
26
27/**
28 * This class is intended to handle &lt;byte&gt; element.
29 * This element specifies {@code byte} values.
30 * The class {@link Byte} is used as wrapper for these values.
31 * The result value is created from text of the body of this element.
32 * The body parsing is described in the class {@link StringElementHandler}.
33 * For example:<pre>
34 * &lt;byte&gt;127&lt;/byte&gt;</pre>
35 * is shortcut to<pre>
36 * &lt;method name="decode" class="java.lang.Byte"&gt;
37 * &lt;string&gt;127&lt;/string&gt;
38 * &lt;/method&gt;</pre>
39 * which is equivalent to {@code Byte.decode("127")} in Java code.
40 * <p>The following atribute is supported:
41 * <dl>
42 * <dt>id
43 * <dd>the identifier of the variable that is intended to store the result
44 * </dl>
45 *
46 * @since 1.7
47 *
48 * @author Sergey A. Malenkov
49 */
50final class ByteElementHandler extends StringElementHandler {
51
52 /**
53 * Creates {@code byte} value from
54 * the text of the body of this element.
55 *
56 * @param argument the text of the body
57 * @return evaluated {@code byte} value
58 */
59 @Override
60 public Object getValue(String argument) {
61 return Byte.decode(argument);
62 }
63}
java/pkg/com/sun/beans/decoder/CharElementHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/decoder/CharElementHandler.java+92−0
@@ -0,0 +1,92 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.decoder;
26
27/**
28 * This class is intended to handle &lt;char&gt; element.
29 * This element specifies {@code char} values.
30 * The class {@link Character} is used as wrapper for these values.
31 * The result value is created from text of the body of this element.
32 * The body parsing is described in the class {@link StringElementHandler}.
33 * For example:<pre>
34 * &lt;char&gt;X&lt;/char&gt;</pre>
35 * which is equivalent to {@code Character.valueOf('X')} in Java code.
36 * <p>The following atributes are supported:
37 * <dl>
38 * <dt>code
39 * <dd>this attribute specifies character code
40 * <dt>id
41 * <dd>the identifier of the variable that is intended to store the result
42 * </dl>
43 * The {@code code} attribute can be used for characters
44 * that are illegal in XML document, for example:<pre>
45 * &lt;char code="0"/&gt;</pre>
46 *
47 * @since 1.7
48 *
49 * @author Sergey A. Malenkov
50 */
51final class CharElementHandler extends StringElementHandler {
52
53 /**
54 * Parses attributes of the element.
55 * The following atributes are supported:
56 * <dl>
57 * <dt>code
58 * <dd>this attribute specifies character code
59 * <dt>id
60 * <dd>the identifier of the variable that is intended to store the result
61 * </dl>
62 *
63 * @param name the attribute name
64 * @param value the attribute value
65 */
66 @Override
67 public void addAttribute(String name, String value) {
68 if (name.equals("code")) { // NON-NLS: the attribute name
69 int code = Integer.decode(value);
70 for (char ch : Character.toChars(code)) {
71 addCharacter(ch);
72 }
73 } else {
74 super.addAttribute(name, value);
75 }
76 }
77
78 /**
79 * Creates {@code char} value from
80 * the text of the body of this element.
81 *
82 * @param argument the text of the body
83 * @return evaluated {@code char} value
84 */
85 @Override
86 public Object getValue(String argument) {
87 if (argument.length() != 1) {
88 throw new IllegalArgumentException("Wrong characters count");
89 }
90 return Character.valueOf(argument.charAt(0));
91 }
92}
java/pkg/com/sun/beans/decoder/ClassElementHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/decoder/ClassElementHandler.java+62−0
@@ -0,0 +1,62 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.decoder;
26
27/**
28 * This class is intended to handle &lt;class&gt; element.
29 * This element specifies {@link Class} values.
30 * The result value is created from text of the body of this element.
31 * The body parsing is described in the class {@link StringElementHandler}.
32 * For example:<pre>
33 * &lt;class&gt;java.lang.Class&lt;/class&gt;</pre>
34 * is shortcut to<pre>
35 * &lt;method name="forName" class="java.lang.Class"&gt;
36 * &lt;string&gt;java.lang.Class&lt;/string&gt;
37 * &lt;/method&gt;</pre>
38 * which is equivalent to {@code Class.forName("java.lang.Class")} in Java code.
39 * <p>The following atribute is supported:
40 * <dl>
41 * <dt>id
42 * <dd>the identifier of the variable that is intended to store the result
43 * </dl>
44 *
45 * @since 1.7
46 *
47 * @author Sergey A. Malenkov
48 */
49final class ClassElementHandler extends StringElementHandler {
50
51 /**
52 * Creates class by the name from
53 * the text of the body of this element.
54 *
55 * @param argument the text of the body
56 * @return evaluated {@code Class} value
57 */
58 @Override
59 public Object getValue(String argument) {
60 return getOwner().findClass(argument);
61 }
62}
java/pkg/com/sun/beans/decoder/DocumentHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/decoder/DocumentHandler.java+389−0
@@ -0,0 +1,389 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.decoder;
26
27import com.sun.beans.finder.ClassFinder;
28
29import java.beans.ExceptionListener;
30
31import java.io.IOException;
32
33import java.lang.ref.Reference;
34import java.lang.ref.WeakReference;
35
36import java.util.ArrayList;
37import java.util.HashMap;
38import java.util.List;
39import java.util.Map;
40
41import javax.xml.parsers.ParserConfigurationException;
42import javax.xml.parsers.SAXParserFactory;
43
44import org.xml.sax.Attributes;
45import org.xml.sax.InputSource;
46import org.xml.sax.SAXException;
47import org.xml.sax.helpers.DefaultHandler;
48
49/**
50 * The main class to parse JavaBeans XML archive.
51 *
52 * @since 1.7
53 *
54 * @author Sergey A. Malenkov
55 *
56 * @see ElementHandler
57 */
58public final class DocumentHandler extends DefaultHandler {
59 private final Map<String, Class<? extends ElementHandler>> handlers = new HashMap<String, Class<? extends ElementHandler>>();
60
61 private final Map<String, Object> environment = new HashMap<String, Object>();
62
63 private final List<Object> objects = new ArrayList<Object>();
64
65 private Reference<ClassLoader> loader;
66 private ExceptionListener listener;
67 private Object owner;
68
69 private ElementHandler handler;
70
71 /**
72 * Creates new instance of document handler.
73 */
74 public DocumentHandler() {
75 setElementHandler("java", JavaElementHandler.class); // NON-NLS: the element name
76 setElementHandler("null", NullElementHandler.class); // NON-NLS: the element name
77 setElementHandler("array", ArrayElementHandler.class); // NON-NLS: the element name
78 setElementHandler("class", ClassElementHandler.class); // NON-NLS: the element name
79 setElementHandler("string", StringElementHandler.class); // NON-NLS: the element name
80 setElementHandler("object", ObjectElementHandler.class); // NON-NLS: the element name
81
82 setElementHandler("void", VoidElementHandler.class); // NON-NLS: the element name
83 setElementHandler("char", CharElementHandler.class); // NON-NLS: the element name
84 setElementHandler("byte", ByteElementHandler.class); // NON-NLS: the element name
85 setElementHandler("short", ShortElementHandler.class); // NON-NLS: the element name
86 setElementHandler("int", IntElementHandler.class); // NON-NLS: the element name
87 setElementHandler("long", LongElementHandler.class); // NON-NLS: the element name
88 setElementHandler("float", FloatElementHandler.class); // NON-NLS: the element name
89 setElementHandler("double", DoubleElementHandler.class); // NON-NLS: the element name
90 setElementHandler("boolean", BooleanElementHandler.class); // NON-NLS: the element name
91
92 // some handlers for new elements
93 setElementHandler("new", NewElementHandler.class); // NON-NLS: the element name
94 setElementHandler("var", VarElementHandler.class); // NON-NLS: the element name
95 setElementHandler("true", TrueElementHandler.class); // NON-NLS: the element name
96 setElementHandler("false", FalseElementHandler.class); // NON-NLS: the element name
97 setElementHandler("field", FieldElementHandler.class); // NON-NLS: the element name
98 setElementHandler("method", MethodElementHandler.class); // NON-NLS: the element name
99 setElementHandler("property", PropertyElementHandler.class); // NON-NLS: the element name
100 }
101
102 /**
103 * Returns the class loader used to instantiate objects.
104 * If the class loader has not been explicitly set
105 * then {@code null} is returned.
106 *
107 * @return the class loader used to instantiate objects
108 */
109 public ClassLoader getClassLoader() {
110 return (this.loader != null)
111 ? this.loader.get()
112 : null;
113 }
114
115 /**
116 * Sets the class loader used to instantiate objects.
117 * If the class loader is not set
118 * then default class loader will be used.
119 *
120 * @param loader a classloader to use
121 */
122 public void setClassLoader(ClassLoader loader) {
123 this.loader = new WeakReference<ClassLoader>(loader);
124 }
125
126 /**
127 * Returns the exception listener for parsing.
128 * The exception listener is notified
129 * when handler catches recoverable exceptions.
130 * If the exception listener has not been explicitly set
131 * then default exception listener is returned.
132 *
133 * @return the exception listener for parsing
134 */
135 public ExceptionListener getExceptionListener() {
136 return this.listener;
137 }
138
139 /**
140 * Sets the exception listener for parsing.
141 * The exception listener is notified
142 * when handler catches recoverable exceptions.
143 *
144 * @param listener the exception listener for parsing
145 */
146 public void setExceptionListener(ExceptionListener listener) {
147 this.listener = listener;
148 }
149
150 /**
151 * Returns the owner of this document handler.
152 *
153 * @return the owner of this document handler
154 */
155 public Object getOwner() {
156 return this.owner;
157 }
158
159 /**
160 * Sets the owner of this document handler.
161 *
162 * @param owner the owner of this document handler
163 */
164 public void setOwner(Object owner) {
165 this.owner = owner;
166 }
167
168 /**
169 * Returns the handler for the element with specified name.
170 *
171 * @param name the name of the element
172 * @return the corresponding element handler
173 */
174 public Class<? extends ElementHandler> getElementHandler(String name) {
175 Class<? extends ElementHandler> type = this.handlers.get(name);
176 if (type == null) {
177 throw new IllegalArgumentException("Unsupported element: " + name);
178 }
179 return type;
180 }
181
182 /**
183 * Sets the handler for the element with specified name.
184 *
185 * @param name the name of the element
186 * @param handler the corresponding element handler
187 */
188 public void setElementHandler(String name, Class<? extends ElementHandler> handler) {
189 this.handlers.put(name, handler);
190 }
191
192 /**
193 * Indicates whether the variable with specified identifier is defined.
194 *
195 * @param id the identifier
196 * @return @{code true} if the variable is defined;
197 * @{code false} otherwise
198 */
199 public boolean hasVariable(String id) {
200 return this.environment.containsKey(id);
201 }
202
203 /**
204 * Returns the value of the variable with specified identifier.
205 *
206 * @param id the identifier
207 * @return the value of the variable
208 */
209 public Object getVariable(String id) {
210 if (!this.environment.containsKey(id)) {
211 throw new IllegalArgumentException("Unbound variable: " + id);
212 }
213 return this.environment.get(id);
214 }
215
216 /**
217 * Sets new value of the variable with specified identifier.
218 *
219 * @param id the identifier
220 * @param value new value of the variable
221 */
222 public void setVariable(String id, Object value) {
223 this.environment.put(id, value);
224 }
225
226 /**
227 * Returns the array of readed objects.
228 *
229 * @return the array of readed objects
230 */
231 public Object[] getObjects() {
232 return this.objects.toArray();
233 }
234
235 /**
236 * Adds the object to the list of readed objects.
237 *
238 * @param object the object that is readed from XML document
239 */
240 void addObject(Object object) {
241 this.objects.add(object);
242 }
243
244 /**
245 * Prepares this handler to read objects from XML document.
246 */
247 @Override
248 public void startDocument() {
249 this.objects.clear();
250 this.handler = null;
251 }
252
253 /**
254 * Parses opening tag of XML element
255 * using corresponding element handler.
256 *
257 * @param uri the namespace URI, or the empty string
258 * if the element has no namespace URI or
259 * if namespace processing is not being performed
260 * @param localName the local name (without prefix), or the empty string
261 * if namespace processing is not being performed
262 * @param qName the qualified name (with prefix), or the empty string
263 * if qualified names are not available
264 * @param attributes the attributes attached to the element
265 */
266 @Override
267 public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
268 ElementHandler parent = this.handler;
269 try {
270 this.handler = getElementHandler(qName).newInstance();
271 this.handler.setOwner(this);
272 this.handler.setParent(parent);
273 }
274 catch (Exception exception) {
275 throw new SAXException(exception);
276 }
277 for (int i = 0; i < attributes.getLength(); i++)
278 try {
279 String name = attributes.getQName(i);
280 String value = attributes.getValue(i);
281 this.handler.addAttribute(name, value);
282 }
283 catch (RuntimeException exception) {
284 handleException(exception);
285 }
286
287 this.handler.startElement();
288 }
289
290 /**
291 * Parses closing tag of XML element
292 * using corresponding element handler.
293 *
294 * @param uri the namespace URI, or the empty string
295 * if the element has no namespace URI or
296 * if namespace processing is not being performed
297 * @param localName the local name (without prefix), or the empty string
298 * if namespace processing is not being performed
299 * @param qName the qualified name (with prefix), or the empty string
300 * if qualified names are not available
301 */
302 @Override
303 public void endElement(String uri, String localName, String qName) {
304 try {
305 this.handler.endElement();
306 }
307 catch (RuntimeException exception) {
308 handleException(exception);
309 }
310 finally {
311 this.handler = this.handler.getParent();
312 }
313 }
314
315 /**
316 * Parses character data inside XML element.
317 *
318 * @param chars the array of characters
319 * @param start the start position in the character array
320 * @param length the number of characters to use
321 */
322 @Override
323 public void characters(char[] chars, int start, int length) {
324 if (this.handler != null) {
325 try {
326 while (0 < length--) {
327 this.handler.addCharacter(chars[start++]);
328 }
329 }
330 catch (RuntimeException exception) {
331 handleException(exception);
332 }
333 }
334 }
335
336 /**
337 * Handles an exception using current exception listener.
338 *
339 * @param exception an exception to handle
340 * @see #setExceptionListener
341 */
342 public void handleException(Exception exception) {
343 if (this.listener == null) {
344 throw new IllegalStateException(exception);
345 }
346 this.listener.exceptionThrown(exception);
347 }
348
349 /**
350 * Starts parsing of the specified input source.
351 *
352 * @param input the input source to parse
353 */
354 public void parse(InputSource input) {
355 try {
356 SAXParserFactory.newInstance().newSAXParser().parse(input, this);
357 }
358 catch (ParserConfigurationException exception) {
359 handleException(exception);
360 }
361 catch (SAXException wrapper) {
362 Exception exception = wrapper.getException();
363 if (exception == null) {
364 exception = wrapper;
365 }
366 handleException(exception);
367 }
368 catch (IOException exception) {
369 handleException(exception);
370 }
371 }
372
373 /**
374 * Resolves class by name using current class loader.
375 * This method handles exception using current exception listener.
376 *
377 * @param name the name of the class
378 * @return the object that represents the class
379 */
380 public Class<?> findClass(String name) {
381 try {
382 return ClassFinder.resolveClass(name, getClassLoader());
383 }
384 catch (ClassNotFoundException exception) {
385 handleException(exception);
386 return null;
387 }
388 }
389}
java/pkg/com/sun/beans/decoder/DoubleElementHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/decoder/DoubleElementHandler.java+63−0
@@ -0,0 +1,63 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.decoder;
26
27/**
28 * This class is intended to handle &lt;double&gt; element.
29 * This element specifies {@code double} values.
30 * The class {@link Double} is used as wrapper for these values.
31 * The result value is created from text of the body of this element.
32 * The body parsing is described in the class {@link StringElementHandler}.
33 * For example:<pre>
34 * &lt;double&gt;1.23e45&lt;/double&gt;</pre>
35 * is shortcut to<pre>
36 * &lt;method name="valueOf" class="java.lang.Double"&gt;
37 * &lt;string&gt;1.23e45&lt;/string&gt;
38 * &lt;/method&gt;</pre>
39 * which is equivalent to {@code Double.valueOf("1.23e45")} in Java code.
40 * <p>The following atribute is supported:
41 * <dl>
42 * <dt>id
43 * <dd>the identifier of the variable that is intended to store the result
44 * </dl>
45 *
46 * @since 1.7
47 *
48 * @author Sergey A. Malenkov
49 */
50final class DoubleElementHandler extends StringElementHandler {
51
52 /**
53 * Creates {@code double} value from
54 * the text of the body of this element.
55 *
56 * @param argument the text of the body
57 * @return evaluated {@code double} value
58 */
59 @Override
60 public Object getValue(String argument) {
61 return Double.valueOf(argument);
62 }
63}
java/pkg/com/sun/beans/decoder/ElementHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/decoder/ElementHandler.java+224−0
@@ -0,0 +1,224 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.decoder;
26
27/**
28 * The base class for element handlers.
29 *
30 * @since 1.7
31 *
32 * @author Sergey A. Malenkov
33 *
34 * @see DocumentHandler
35 */
36public abstract class ElementHandler {
37 private DocumentHandler owner;
38 private ElementHandler parent;
39
40 private String id;
41
42 /**
43 * Returns the document handler that creates this element handler.
44 *
45 * @return the owner document handler
46 */
47 public final DocumentHandler getOwner() {
48 return this.owner;
49 }
50
51 /**
52 * Sets the document handler that creates this element handler.
53 * The owner document handler should be set after instantiation.
54 * Such approach is used to simplify the extensibility.
55 *
56 * @param owner the owner document handler
57 * @see DocumentHandler#startElement
58 */
59 final void setOwner(DocumentHandler owner) {
60 if (owner == null) {
61 throw new IllegalArgumentException("Every element should have owner");
62 }
63 this.owner = owner;
64 }
65
66 /**
67 * Returns the element handler that contains this one.
68 *
69 * @return the parent element handler
70 */
71 public final ElementHandler getParent() {
72 return this.parent;
73 }
74
75 /**
76 * Sets the element handler that contains this one.
77 * The parent element handler should be set after instantiation.
78 * Such approach is used to simplify the extensibility.
79 *
80 * @param parent the parent element handler
81 * @see DocumentHandler#startElement
82 */
83 final void setParent(ElementHandler parent) {
84 this.parent = parent;
85 }
86
87 /**
88 * Returns the value of the variable with specified identifier.
89 *
90 * @param id the identifier
91 * @return the value of the variable
92 */
93 protected final Object getVariable(String id) {
94 if (id.equals(this.id)) {
95 ValueObject value = getValueObject();
96 if (value.isVoid()) {
97 throw new IllegalStateException("The element does not return value");
98 }
99 return value.getValue();
100 }
101 return (this.parent != null)
102 ? this.parent.getVariable(id)
103 : this.owner.getVariable(id);
104 }
105
106 /**
107 * Returns the value of the parent element.
108 *
109 * @return the value of the parent element
110 */
111 protected Object getContextBean() {
112 if (this.parent != null) {
113 ValueObject value = this.parent.getValueObject();
114 if (!value.isVoid()) {
115 return value.getValue();
116 }
117 throw new IllegalStateException("The outer element does not return value");
118 } else {
119 Object value = this.owner.getOwner();
120 if (value != null) {
121 return value;
122 }
123 throw new IllegalStateException("The topmost element does not have context");
124 }
125 }
126
127 /**
128 * Parses attributes of the element.
129 * By default, the following atribute is supported:
130 * <dl>
131 * <dt>id
132 * <dd>the identifier of the variable that is intended to store the result
133 * </dl>
134 *
135 * @param name the attribute name
136 * @param value the attribute value
137 */
138 public void addAttribute(String name, String value) {
139 if (name.equals("id")) { // NON-NLS: the attribute name
140 this.id = value;
141 } else {
142 throw new IllegalArgumentException("Unsupported attribute: " + name);
143 }
144 }
145
146 /**
147 * This method is called before parsing of the element's body.
148 * All attributes are parsed at this point.
149 * By default, do nothing.
150 */
151 public void startElement() {
152 }
153
154 /**
155 * This method is called after parsing of the element's body.
156 * By default, it calculates the value of this element.
157 * The following tasks are executing for any non-void value:
158 * <ol>
159 * <li>If the {@code id} attribute is set
160 * the value of the variable with the specified identifier
161 * is set to the value of this element.</li>
162 * <li>This element is used as an argument of parent element if it is possible.</li>
163 * </ol>
164 *
165 * @see #isArgument
166 */
167 public void endElement() {
168 // do nothing if no value returned
169 ValueObject value = getValueObject();
170 if (!value.isVoid()) {
171 if (this.id != null) {
172 this.owner.setVariable(this.id, value.getValue());
173 }
174 if (isArgument()) {
175 if (this.parent != null) {
176 this.parent.addArgument(value.getValue());
177 } else {
178 this.owner.addObject(value.getValue());
179 }
180 }
181 }
182 }
183
184 /**
185 * Adds the character that contained in this element.
186 * By default, only whitespaces are acceptable.
187 *
188 * @param ch the character
189 */
190 public void addCharacter(char ch) {
191 if ((ch != ' ') && (ch != '\n') && (ch != '\t') && (ch != '\r')) {
192 throw new IllegalStateException("Illegal character with code " + (int) ch);
193 }
194 }
195
196 /**
197 * Adds the argument that is used to calculate the value of this element.
198 * By default, no arguments are acceptable.
199 *
200 * @param argument the value of the element that contained in this one
201 */
202 protected void addArgument(Object argument) {
203 throw new IllegalStateException("Could not add argument to simple element");
204 }
205
206 /**
207 * Tests whether the value of this element can be used
208 * as an argument of the element that contained in this one.
209 *
210 * @return {@code true} if the value of this element can be used
211 * as an argument of the element that contained in this one,
212 * {@code false} otherwise
213 */
214 protected boolean isArgument() {
215 return this.id == null;
216 }
217
218 /**
219 * Returns the value of this element.
220 *
221 * @return the value of this element
222 */
223 protected abstract ValueObject getValueObject();
224}
java/pkg/com/sun/beans/decoder/FalseElementHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/decoder/FalseElementHandler.java+56−0
@@ -0,0 +1,56 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.decoder;
26
27/**
28 * This class is intended to handle &lt;false&gt; element.
29 * This element specifies {@code false} value.
30 * It should not contain body or inner elements.
31 * For example:<pre>
32 * &lt;false/&gt;</pre>
33 * is equivalent to {@code false} in Java code.
34 * <p>The following atribute is supported:
35 * <dl>
36 * <dt>id
37 * <dd>the identifier of the variable that is intended to store the result
38 * </dl>
39 *
40 * @since 1.7
41 *
42 * @author Sergey A. Malenkov
43 */
44final class FalseElementHandler extends NullElementHandler {
45
46 /**
47 * Returns {@code Boolean.FALSE}
48 * as a value of &lt;false&gt; element.
49 *
50 * @return {@code Boolean.FALSE} by default
51 */
52 @Override
53 public Object getValue() {
54 return Boolean.FALSE;
55 }
56}
java/pkg/com/sun/beans/decoder/FieldElementHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/decoder/FieldElementHandler.java+189−0
@@ -0,0 +1,189 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.decoder;
26
27import com.sun.beans.finder.FieldFinder;
28
29import java.lang.reflect.Field;
30
31/**
32 * This class is intended to handle &lt;field&gt; element.
33 * This element simplifies access to the fields.
34 * If the {@code class} attribute is specified
35 * this element accesses static field of specified class.
36 * This element defines getter if it contains no argument.
37 * It returns the value of the field in this case.
38 * For example:<pre>
39 * &lt;field name="TYPE" class="java.lang.Long"/&gt;</pre>
40 * is equivalent to {@code Long.TYPE} in Java code.
41 * This element defines setter if it contains one argument.
42 * It does not return the value of the field in this case.
43 * For example:<pre>
44 * &lt;field name="id"&gt;&lt;int&gt;0&lt;/int&gt;&lt;/field&gt;</pre>
45 * is equivalent to {@code id = 0} in Java code.
46 * <p>The following atributes are supported:
47 * <dl>
48 * <dt>name
49 * <dd>the field name
50 * <dt>class
51 * <dd>the type is used for static fields only
52 * <dt>id
53 * <dd>the identifier of the variable that is intended to store the result
54 * </dl>
55 *
56 * @since 1.7
57 *
58 * @author Sergey A. Malenkov
59 */
60final class FieldElementHandler extends AccessorElementHandler {
61 private Class<?> type;
62
63 /**
64 * Parses attributes of the element.
65 * The following atributes are supported:
66 * <dl>
67 * <dt>name
68 * <dd>the field name
69 * <dt>class
70 * <dd>the type is used for static fields only
71 * <dt>id
72 * <dd>the identifier of the variable that is intended to store the result
73 * </dl>
74 *
75 * @param name the attribute name
76 * @param value the attribute value
77 */
78 @Override
79 public void addAttribute(String name, String value) {
80 if (name.equals("class")) { // NON-NLS: the attribute name
81 this.type = getOwner().findClass(value);
82 } else {
83 super.addAttribute(name, value);
84 }
85 }
86
87 /**
88 * Tests whether the value of this element can be used
89 * as an argument of the element that contained in this one.
90 *
91 * @return {@code true} if the value of this element should be used
92 * as an argument of the element that contained in this one,
93 * {@code false} otherwise
94 */
95 @Override
96 protected boolean isArgument() {
97 return super.isArgument() && (this.type != null); // only static accessor can be used an argument
98 }
99
100 /**
101 * Returns the context of the field.
102 * The context of the static field is the class object.
103 * The context of the non-static field is the value of the parent element.
104 *
105 * @return the context of the field
106 */
107 @Override
108 protected Object getContextBean() {
109 return (this.type != null)
110 ? this.type
111 : super.getContextBean();
112 }
113
114 /**
115 * Returns the value of the field with specified {@code name}.
116 *
117 * @param name the name of the field
118 * @return the value of the specified field
119 */
120 @Override
121 protected Object getValue(String name) {
122 try {
123 return getFieldValue(getContextBean(), name);
124 }
125 catch (Exception exception) {
126 getOwner().handleException(exception);
127 }
128 return null;
129 }
130
131 /**
132 * Sets the new value for the field with specified {@code name}.
133 *
134 * @param name the name of the field
135 * @param value the new value for the specified field
136 */
137 @Override
138 protected void setValue(String name, Object value) {
139 try {
140 setFieldValue(getContextBean(), name, value);
141 }
142 catch (Exception exception) {
143 getOwner().handleException(exception);
144 }
145 }
146
147 /**
148 * Performs the search of the field with specified {@code name}
149 * in specified context and returns its value.
150 *
151 * @param bean the context bean that contains field
152 * @param name the name of the field
153 * @return the value of the field
154 * @throws IllegalAccessException if the field is not accesible
155 * @throws NoSuchFieldException if the field is not found
156 */
157 static Object getFieldValue(Object bean, String name) throws IllegalAccessException, NoSuchFieldException {
158 return findField(bean, name).get(bean);
159 }
160
161 /**
162 * Performs the search of the field with specified {@code name}
163 * in specified context and updates its value.
164 *
165 * @param bean the context bean that contains field
166 * @param name the name of the field
167 * @param value the new value for the field
168 * @throws IllegalAccessException if the field is not accesible
169 * @throws NoSuchFieldException if the field is not found
170 */
171 private static void setFieldValue(Object bean, String name, Object value) throws IllegalAccessException, NoSuchFieldException {
172 findField(bean, name).set(bean, value);
173 }
174
175 /**
176 * Performs the search of the field
177 * with specified {@code name} in specified context.
178 *
179 * @param bean the context bean that contains field
180 * @param name the name of the field
181 * @return field object that represents found field
182 * @throws NoSuchFieldException if the field is not found
183 */
184 private static Field findField(Object bean, String name) throws NoSuchFieldException {
185 return (bean instanceof Class<?>)
186 ? FieldFinder.findStaticField((Class<?>) bean, name)
187 : FieldFinder.findField(bean.getClass(), name);
188 }
189}
java/pkg/com/sun/beans/decoder/FloatElementHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/decoder/FloatElementHandler.java+63−0
@@ -0,0 +1,63 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.decoder;
26
27/**
28 * This class is intended to handle &lt;float&gt; element.
29 * This element specifies {@code float} values.
30 * The class {@link Float} is used as wrapper for these values.
31 * The result value is created from text of the body of this element.
32 * The body parsing is described in the class {@link StringElementHandler}.
33 * For example:<pre>
34 * &lt;float&gt;-1.23&lt;/float&gt;</pre>
35 * is shortcut to<pre>
36 * &lt;method name="valueOf" class="java.lang.Float"&gt;
37 * &lt;string&gt;-1.23&lt;/string&gt;
38 * &lt;/method&gt;</pre>
39 * which is equivalent to {@code Float.valueOf("-1.23")} in Java code.
40 * <p>The following atribute is supported:
41 * <dl>
42 * <dt>id
43 * <dd>the identifier of the variable that is intended to store the result
44 * </dl>
45 *
46 * @since 1.7
47 *
48 * @author Sergey A. Malenkov
49 */
50final class FloatElementHandler extends StringElementHandler {
51
52 /**
53 * Creates {@code float} value from
54 * the text of the body of this element.
55 *
56 * @param argument the text of the body
57 * @return evaluated {@code float} value
58 */
59 @Override
60 public Object getValue(String argument) {
61 return Float.valueOf(argument);
62 }
63}
java/pkg/com/sun/beans/decoder/IntElementHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/decoder/IntElementHandler.java+63−0
@@ -0,0 +1,63 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.decoder;
26
27/**
28 * This class is intended to handle &lt;int&gt; element.
29 * This element specifies {@code int} values.
30 * The class {@link Integer} is used as wrapper for these values.
31 * The result value is created from text of the body of this element.
32 * The body parsing is described in the class {@link StringElementHandler}.
33 * For example:<pre>
34 * &lt;int&gt;-1&lt;/int&gt;</pre>
35 * is shortcut to<pre>
36 * &lt;method name="decode" class="java.lang.Integer"&gt;
37 * &lt;string&gt;-1&lt;/string&gt;
38 * &lt;/method&gt;</pre>
39 * which is equivalent to {@code Integer.decode("-1")} in Java code.
40 * <p>The following atribute is supported:
41 * <dl>
42 * <dt>id
43 * <dd>the identifier of the variable that is intended to store the result
44 * </dl>
45 *
46 * @since 1.7
47 *
48 * @author Sergey A. Malenkov
49 */
50final class IntElementHandler extends StringElementHandler {
51
52 /**
53 * Creates {@code int} value from
54 * the text of the body of this element.
55 *
56 * @param argument the text of the body
57 * @return evaluated {@code int} value
58 */
59 @Override
60 public Object getValue(String argument) {
61 return Integer.decode(argument);
62 }
63}
java/pkg/com/sun/beans/decoder/JavaElementHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/decoder/JavaElementHandler.java+151−0
@@ -0,0 +1,151 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.decoder;
26
27import java.beans.XMLDecoder;
28
29/**
30 * This class is intended to handle &lt;java&gt; element.
31 * Each element that appears in the body of this element
32 * is evaluated in the context of the decoder itself.
33 * Typically this outer context is used to retrieve the owner of the decoder,
34 * which can be set before reading the archive.
35 * <p>The following atributes are supported:
36 * <dl>
37 * <dt>version
38 * <dd>the Java version (not supported)
39 * <dt>class
40 * <dd>the type of preferable parser (not supported)
41 * <dt>id
42 * <dd>the identifier of the variable that is intended to store the result
43 * </dl>
44 *
45 * @see DocumentHandler#getOwner
46 * @see DocumentHandler#setOwner
47 * @since 1.7
48 *
49 * @author Sergey A. Malenkov
50 */
51final class JavaElementHandler extends ElementHandler {
52 private Class<?> type;
53 private ValueObject value;
54
55 /**
56 * Parses attributes of the element.
57 * The following atributes are supported:
58 * <dl>
59 * <dt>version
60 * <dd>the Java version (not supported)
61 * <dt>class
62 * <dd>the type of preferable parser (not supported)
63 * <dt>id
64 * <dd>the identifier of the variable that is intended to store the result
65 * </dl>
66 *
67 * @param name the attribute name
68 * @param value the attribute value
69 */
70 @Override
71 public void addAttribute(String name, String value) {
72 if (name.equals("version")) { // NON-NLS: the attribute name
73 // unsupported attribute
74 } else if (name.equals("class")) { // NON-NLS: the attribute name
75 // check class for owner
76 this.type = getOwner().findClass(value);
77 } else {
78 super.addAttribute(name, value);
79 }
80 }
81
82 /**
83 * Adds the argument to the list of readed objects.
84 *
85 * @param argument the value of the element that contained in this one
86 */
87 @Override
88 protected void addArgument(Object argument) {
89 getOwner().addObject(argument);
90 }
91
92 /**
93 * Tests whether the value of this element can be used
94 * as an argument of the element that contained in this one.
95 *
96 * @return {@code true} if the value of this element should be used
97 * as an argument of the element that contained in this one,
98 * {@code false} otherwise
99 */
100 @Override
101 protected boolean isArgument() {
102 return false; // do not use owner as object
103 }
104
105 /**
106 * Returns the value of this element.
107 *
108 * @return the value of this element
109 */
110 @Override
111 protected ValueObject getValueObject() {
112 if (this.value == null) {
113 this.value = ValueObjectImpl.create(getValue());
114 }
115 return this.value;
116 }
117
118 /**
119 * Returns the owner of the owner document handler
120 * as a value of &lt;java&gt; element.
121 *
122 * @return the owner of the owner document handler
123 */
124 private Object getValue() {
125 Object owner = getOwner().getOwner();
126 if ((this.type == null) || isValid(owner)) {
127 return owner;
128 }
129 if (owner instanceof XMLDecoder) {
130 XMLDecoder decoder = (XMLDecoder) owner;
131 owner = decoder.getOwner();
132 if (isValid(owner)) {
133 return owner;
134 }
135 }
136 throw new IllegalStateException("Unexpected owner class: " + owner.getClass().getName());
137 }
138
139 /**
140 * Validates the owner of the &lt;java&gt; element.
141 * The owner is valid if it is {@code null} or an instance
142 * of the class specified by the {@code class} attribute.
143 *
144 * @param owner the owner of the &lt;java&gt; element
145 * @return {@code true} if the {@code owner} is valid;
146 * {@code false} otherwise
147 */
148 private boolean isValid(Object owner) {
149 return (owner == null) || this.type.isInstance(owner);
150 }
151}
java/pkg/com/sun/beans/decoder/LongElementHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/decoder/LongElementHandler.java+63−0
@@ -0,0 +1,63 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.decoder;
26
27/**
28 * This class is intended to handle &lt;long&gt; element.
29 * This element specifies {@code long} values.
30 * The class {@link Long} is used as wrapper for these values.
31 * The result value is created from text of the body of this element.
32 * The body parsing is described in the class {@link StringElementHandler}.
33 * For example:<pre>
34 * &lt;long&gt;0xFFFF&lt;/long&gt;</pre>
35 * is shortcut to<pre>
36 * &lt;method name="decode" class="java.lang.Long"&gt;
37 * &lt;string&gt;0xFFFF&lt;/string&gt;
38 * &lt;/method&gt;</pre>
39 * which is equivalent to {@code Long.decode("0xFFFF")} in Java code.
40 * <p>The following atribute is supported:
41 * <dl>
42 * <dt>id
43 * <dd>the identifier of the variable that is intended to store the result
44 * </dl>
45 *
46 * @since 1.7
47 *
48 * @author Sergey A. Malenkov
49 */
50final class LongElementHandler extends StringElementHandler {
51
52 /**
53 * Creates {@code long} value from
54 * the text of the body of this element.
55 *
56 * @param argument the text of the body
57 * @return evaluated {@code long} value
58 */
59 @Override
60 public Object getValue(String argument) {
61 return Long.decode(argument);
62 }
63}
java/pkg/com/sun/beans/decoder/MethodElementHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/decoder/MethodElementHandler.java+109−0
@@ -0,0 +1,109 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.decoder;
26
27import com.sun.beans.finder.MethodFinder;
28
29import java.lang.reflect.Method;
30
31/**
32 * This class is intended to handle &lt;method&gt; element.
33 * It describes invocation of the method.
34 * The {@code name} attribute denotes
35 * the name of the method to invoke.
36 * If the {@code class} attribute is specified
37 * this element invokes static method of specified class.
38 * The inner elements specifies the arguments of the method.
39 * For example:<pre>
40 * &lt;method name="valueOf" class="java.lang.Long"&gt;
41 * &lt;string&gt;10&lt;/string&gt;
42 * &lt;/method&gt;</pre>
43 * is equivalent to {@code Long.valueOf("10")} in Java code.
44 * <p>The following atributes are supported:
45 * <dl>
46 * <dt>name
47 * <dd>the method name
48 * <dt>class
49 * <dd>the type of object for instantiation
50 * <dt>id
51 * <dd>the identifier of the variable that is intended to store the result
52 * </dl>
53 *
54 * @since 1.7
55 *
56 * @author Sergey A. Malenkov
57 */
58final class MethodElementHandler extends NewElementHandler {
59 private String name;
60
61 /**
62 * Parses attributes of the element.
63 * The following atributes are supported:
64 * <dl>
65 * <dt>name
66 * <dd>the method name
67 * <dt>class
68 * <dd>the type of object for instantiation
69 * <dt>id
70 * <dd>the identifier of the variable that is intended to store the result
71 * </dl>
72 *
73 * @param name the attribute name
74 * @param value the attribute value
75 */
76 @Override
77 public void addAttribute(String name, String value) {
78 if (name.equals("name")) { // NON-NLS: the attribute name
79 this.name = value;
80 } else {
81 super.addAttribute(name, value);
82 }
83 }
84
85 /**
86 * Returns the result of method execution.
87 *
88 * @param type the base class
89 * @param args the array of arguments
90 * @return the value of this element
91 * @throws Exception if calculation is failed
92 */
93 @Override
94 protected ValueObject getValueObject(Class<?> type, Object[] args) throws Exception {
95 Object bean = getContextBean();
96 Class<?>[] types = getArgumentTypes(args);
97 Method method = (type != null)
98 ? MethodFinder.findStaticMethod(type, this.name, types)
99 : MethodFinder.findMethod(bean.getClass(), this.name, types);
100
101 if (method.isVarArgs()) {
102 args = getArguments(args, method.getParameterTypes());
103 }
104 Object value = method.invoke(bean, args);
105 return method.getReturnType().equals(void.class)
106 ? ValueObjectImpl.VOID
107 : ValueObjectImpl.create(value);
108 }
109}
java/pkg/com/sun/beans/decoder/NewElementHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/decoder/NewElementHandler.java+205−0
@@ -0,0 +1,205 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.decoder;
26
27import com.sun.beans.finder.ConstructorFinder;
28
29import java.lang.reflect.Array;
30import java.lang.reflect.Constructor;
31
32import java.util.ArrayList;
33import java.util.List;
34
35/**
36 * This class is intended to handle &lt;new&gt; element.
37 * It describes instantiation of the object.
38 * The {@code class} attribute denotes
39 * the name of the class to instantiate.
40 * The inner elements specifies the arguments of the constructor.
41 * For example:<pre>
42 * &lt;new class="java.lang.Long"&gt;
43 * &lt;string&gt;10&lt;/string&gt;
44 * &lt;/new&gt;</pre>
45 * is equivalent to {@code new Long("10")} in Java code.
46 * <p>The following atributes are supported:
47 * <dl>
48 * <dt>class
49 * <dd>the type of object for instantiation
50 * <dt>id
51 * <dd>the identifier of the variable that is intended to store the result
52 * </dl>
53 *
54 * @since 1.7
55 *
56 * @author Sergey A. Malenkov
57 */
58class NewElementHandler extends ElementHandler {
59 private List<Object> arguments = new ArrayList<Object>();
60 private ValueObject value = ValueObjectImpl.VOID;
61
62 private Class<?> type;
63
64 /**
65 * Parses attributes of the element.
66 * The following atributes are supported:
67 * <dl>
68 * <dt>class
69 * <dd>the type of object for instantiation
70 * <dt>id
71 * <dd>the identifier of the variable that is intended to store the result
72 * </dl>
73 *
74 * @param name the attribute name
75 * @param value the attribute value
76 */
77 @Override
78 public void addAttribute(String name, String value) {
79 if (name.equals("class")) { // NON-NLS: the attribute name
80 this.type = getOwner().findClass(value);
81 } else {
82 super.addAttribute(name, value);
83 }
84 }
85
86 /**
87 * Adds the argument to the list of arguments
88 * that is used to calculate the value of this element.
89 *
90 * @param argument the value of the element that contained in this one
91 */
92 @Override
93 protected final void addArgument(Object argument) {
94 if (this.arguments == null) {
95 throw new IllegalStateException("Could not add argument to evaluated element");
96 }
97 this.arguments.add(argument);
98 }
99
100 /**
101 * Returns the context of the method.
102 * The context of the static method is the class object.
103 * The context of the non-static method is the value of the parent element.
104 *
105 * @return the context of the method
106 */
107 @Override
108 protected final Object getContextBean() {
109 return (this.type != null)
110 ? this.type
111 : super.getContextBean();
112 }
113
114 /**
115 * Returns the value of this element.
116 *
117 * @return the value of this element
118 */
119 @Override
120 protected final ValueObject getValueObject() {
121 if (this.arguments != null) {
122 try {
123 this.value = getValueObject(this.type, this.arguments.toArray());
124 }
125 catch (Exception exception) {
126 getOwner().handleException(exception);
127 }
128 finally {
129 this.arguments = null;
130 }
131 }
132 return this.value;
133 }
134
135 /**
136 * Calculates the value of this element
137 * using the base class and the array of arguments.
138 * By default, it creates an instance of the base class.
139 * This method should be overridden in those handlers
140 * that extend behavior of this element.
141 *
142 * @param type the base class
143 * @param args the array of arguments
144 * @return the value of this element
145 * @throws Exception if calculation is failed
146 */
147 ValueObject getValueObject(Class<?> type, Object[] args) throws Exception {
148 if (type == null) {
149 throw new IllegalArgumentException("Class name is not set");
150 }
151 Class<?>[] types = getArgumentTypes(args);
152 Constructor<?> constructor = ConstructorFinder.findConstructor(type, types);
153 if (constructor.isVarArgs()) {
154 args = getArguments(args, constructor.getParameterTypes());
155 }
156 return ValueObjectImpl.create(constructor.newInstance(args));
157 }
158
159 /**
160 * Converts the array of arguments to the array of corresponding classes.
161 * If argument is {@code null} the class is {@code null} too.
162 *
163 * @param arguments the array of arguments
164 * @return the array of corresponding classes
165 */
166 static Class<?>[] getArgumentTypes(Object[] arguments) {
167 Class<?>[] types = new Class<?>[arguments.length];
168 for (int i = 0; i < arguments.length; i++) {
169 if (arguments[i] != null) {
170 types[i] = arguments[i].getClass();
171 }
172 }
173 return types;
174 }
175
176 /**
177 * Resolves variable arguments.
178 *
179 * @param arguments the array of arguments
180 * @param types the array of parameter types
181 * @return the resolved array of arguments
182 */
183 static Object[] getArguments(Object[] arguments, Class<?>[] types) {
184 int index = types.length - 1;
185 if (types.length == arguments.length) {
186 Object argument = arguments[index];
187 if (argument == null) {
188 return arguments;
189 }
190 Class<?> type = types[index];
191 if (type.isAssignableFrom(argument.getClass())) {
192 return arguments;
193 }
194 }
195 int length = arguments.length - index;
196 Class<?> type = types[index].getComponentType();
197 Object array = Array.newInstance(type, length);
198 System.arraycopy(arguments, index, array, 0, length);
199
200 Object[] args = new Object[types.length];
201 System.arraycopy(arguments, 0, args, 0, index);
202 args[index] = array;
203 return args;
204 }
205}
java/pkg/com/sun/beans/decoder/NullElementHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/decoder/NullElementHandler.java+76−0
@@ -0,0 +1,76 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.decoder;
26
27/**
28 * This class is intended to handle &lt;null&gt; element.
29 * This element specifies {@code null} value.
30 * It should not contain body or inner elements.
31 * For example:<pre>
32 * &lt;null/&gt;</pre>
33 * is equivalent to {@code null} in Java code.
34 * <p>The following atribute is supported:
35 * <dl>
36 * <dt>id
37 * <dd>the identifier of the variable that is intended to store the result
38 * </dl>
39 *
40 * @since 1.7
41 *
42 * @author Sergey A. Malenkov
43 */
44class NullElementHandler extends ElementHandler implements ValueObject {
45
46 /**
47 * Returns the value of this element.
48 *
49 * @return the value of this element
50 */
51 @Override
52 protected final ValueObject getValueObject() {
53 return this;
54 }
55
56 /**
57 * Returns {@code null}
58 * as a value of &lt;null&gt; element.
59 * This method should be overridden in those handlers
60 * that extend behavior of this element.
61 *
62 * @return {@code null} by default
63 */
64 public Object getValue() {
65 return null;
66 }
67
68 /**
69 * Returns {@code void} state of this value object.
70 *
71 * @return {@code false} always
72 */
73 public final boolean isVoid() {
74 return false;
75 }
76}
java/pkg/com/sun/beans/decoder/ObjectElementHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/decoder/ObjectElementHandler.java+168−0
@@ -0,0 +1,168 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.decoder;
26
27import java.beans.Expression;
28
29import static java.util.Locale.ENGLISH;
30
31/**
32 * This class is intended to handle &lt;object&gt; element.
33 * This element looks like &lt;void&gt; element,
34 * but its value is always used as an argument for element
35 * that contains this one.
36 * <p>The following atributes are supported:
37 * <dl>
38 * <dt>class
39 * <dd>the type is used for static methods and fields
40 * <dt>method
41 * <dd>the method name
42 * <dt>property
43 * <dd>the property name
44 * <dt>index
45 * <dd>the property index
46 * <dt>field
47 * <dd>the field name
48 * <dt>idref
49 * <dd>the identifier to refer to the variable
50 * <dt>id
51 * <dd>the identifier of the variable that is intended to store the result
52 * </dl>
53 *
54 * @since 1.7
55 *
56 * @author Sergey A. Malenkov
57 */
58class ObjectElementHandler extends NewElementHandler {
59 private String idref;
60 private String field;
61 private Integer index;
62 private String property;
63 private String method;
64
65 /**
66 * Parses attributes of the element.
67 * The following atributes are supported:
68 * <dl>
69 * <dt>class
70 * <dd>the type is used for static methods and fields
71 * <dt>method
72 * <dd>the method name
73 * <dt>property
74 * <dd>the property name
75 * <dt>index
76 * <dd>the property index
77 * <dt>field
78 * <dd>the field name
79 * <dt>idref
80 * <dd>the identifier to refer to the variable
81 * <dt>id
82 * <dd>the identifier of the variable that is intended to store the result
83 * </dl>
84 *
85 * @param name the attribute name
86 * @param value the attribute value
87 */
88 @Override
89 public final void addAttribute(String name, String value) {
90 if (name.equals("idref")) { // NON-NLS: the attribute name
91 this.idref = value;
92 } else if (name.equals("field")) { // NON-NLS: the attribute name
93 this.field = value;
94 } else if (name.equals("index")) { // NON-NLS: the attribute name
95 this.index = Integer.valueOf(value);
96 addArgument(this.index); // hack for compatibility
97 } else if (name.equals("property")) { // NON-NLS: the attribute name
98 this.property = value;
99 } else if (name.equals("method")) { // NON-NLS: the attribute name
100 this.method = value;
101 } else {
102 super.addAttribute(name, value);
103 }
104 }
105
106 /**
107 * Calculates the value of this element
108 * if the field attribute or the idref attribute is set.
109 */
110 @Override
111 public final void startElement() {
112 if ((this.field != null) || (this.idref != null)) {
113 getValueObject();
114 }
115 }
116
117 /**
118 * Tests whether the value of this element can be used
119 * as an argument of the element that contained in this one.
120 *
121 * @return {@code true} if the value of this element can be used
122 * as an argument of the element that contained in this one,
123 * {@code false} otherwise
124 */
125 @Override
126 protected boolean isArgument() {
127 return true; // hack for compatibility
128 }
129
130 /**
131 * Creates the value of this element.
132 *
133 * @param type the base class
134 * @param args the array of arguments
135 * @return the value of this element
136 * @throws Exception if calculation is failed
137 */
138 @Override
139 protected final ValueObject getValueObject(Class<?> type, Object[] args) throws Exception {
140 if (this.field != null) {
141 return ValueObjectImpl.create(FieldElementHandler.getFieldValue(getContextBean(), this.field));
142 }
143 if (this.idref != null) {
144 return ValueObjectImpl.create(getVariable(this.idref));
145 }
146 Object bean = getContextBean();
147 String name;
148 if (this.index != null) {
149 name = (args.length == 2)
150 ? PropertyElementHandler.SETTER
151 : PropertyElementHandler.GETTER;
152 } else if (this.property != null) {
153 name = (args.length == 1)
154 ? PropertyElementHandler.SETTER
155 : PropertyElementHandler.GETTER;
156
157 if (0 < this.property.length()) {
158 name += this.property.substring(0, 1).toUpperCase(ENGLISH) + this.property.substring(1);
159 }
160 } else {
161 name = (this.method != null) && (0 < this.method.length())
162 ? this.method
163 : "new"; // NON-NLS: the constructor marker
164 }
165 Expression expression = new Expression(bean, name, args);
166 return ValueObjectImpl.create(expression.getValue());
167 }
168}
java/pkg/com/sun/beans/decoder/PropertyElementHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/decoder/PropertyElementHandler.java+287−0
@@ -0,0 +1,287 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.decoder;
26
27import com.sun.beans.finder.MethodFinder;
28
29import java.beans.IndexedPropertyDescriptor;
30import java.beans.IntrospectionException;
31import java.beans.Introspector;
32import java.beans.PropertyDescriptor;
33
34import java.lang.reflect.Array;
35import java.lang.reflect.InvocationTargetException;
36import java.lang.reflect.Method;
37
38/**
39 * This class is intended to handle &lt;property&gt; element.
40 * This element simplifies access to the properties.
41 * If the {@code index} attribute is specified
42 * this element uses additional {@code int} parameter.
43 * If the {@code name} attribute is not specified
44 * this element uses method "get" as getter
45 * and method "set" as setter.
46 * This element defines getter if it contains no argument.
47 * It returns the value of the property in this case.
48 * For example:<pre>
49 * &lt;property name="object" index="10"/&gt;</pre>
50 * is shortcut to<pre>
51 * &lt;method name="getObject"&gt;
52 * &lt;int&gt;10&lt;/int&gt;
53 * &lt;/method&gt;</pre>
54 * which is equivalent to {@code getObject(10)} in Java code.
55 * This element defines setter if it contains one argument.
56 * It does not return the value of the property in this case.
57 * For example:<pre>
58 * &lt;property&gt;&lt;int&gt;0&lt;/int&gt;&lt;/property&gt;</pre>
59 * is shortcut to<pre>
60 * &lt;method name="set"&gt;
61 * &lt;int&gt;0&lt;/int&gt;
62 * &lt;/method&gt;</pre>
63 * which is equivalent to {@code set(0)} in Java code.
64 * <p>The following atributes are supported:
65 * <dl>
66 * <dt>name
67 * <dd>the property name
68 * <dt>index
69 * <dd>the property index
70 * <dt>id
71 * <dd>the identifier of the variable that is intended to store the result
72 * </dl>
73 *
74 * @since 1.7
75 *
76 * @author Sergey A. Malenkov
77 */
78final class PropertyElementHandler extends AccessorElementHandler {
79 static final String GETTER = "get"; // NON-NLS: the getter prefix
80 static final String SETTER = "set"; // NON-NLS: the setter prefix
81
82 private Integer index;
83
84 /**
85 * Parses attributes of the element.
86 * The following atributes are supported:
87 * <dl>
88 * <dt>name
89 * <dd>the property name
90 * <dt>index
91 * <dd>the property index
92 * <dt>id
93 * <dd>the identifier of the variable that is intended to store the result
94 * </dl>
95 *
96 * @param name the attribute name
97 * @param value the attribute value
98 */
99 @Override
100 public void addAttribute(String name, String value) {
101 if (name.equals("index")) { // NON-NLS: the attribute name
102 this.index = Integer.valueOf(value);
103 } else {
104 super.addAttribute(name, value);
105 }
106 }
107
108 /**
109 * Tests whether the value of this element can be used
110 * as an argument of the element that contained in this one.
111 *
112 * @return {@code true} if the value of this element should be used
113 * as an argument of the element that contained in this one,
114 * {@code false} otherwise
115 */
116 @Override
117 protected boolean isArgument() {
118 return false; // non-static accessor cannot be used an argument
119 }
120
121 /**
122 * Returns the value of the property with specified {@code name}.
123 *
124 * @param name the name of the property
125 * @return the value of the specified property
126 */
127 @Override
128 protected Object getValue(String name) {
129 try {
130 return getPropertyValue(getContextBean(), name, this.index);
131 }
132 catch (Exception exception) {
133 getOwner().handleException(exception);
134 }
135 return null;
136 }
137
138 /**
139 * Sets the new value for the property with specified {@code name}.
140 *
141 * @param name the name of the property
142 * @param value the new value for the specified property
143 */
144 @Override
145 protected void setValue(String name, Object value) {
146 try {
147 setPropertyValue(getContextBean(), name, this.index, value);
148 }
149 catch (Exception exception) {
150 getOwner().handleException(exception);
151 }
152 }
153
154 /**
155 * Performs the search of the getter for the property
156 * with specified {@code name} in specified class
157 * and returns value of the property.
158 *
159 * @param bean the context bean that contains property
160 * @param name the name of the property
161 * @param index the index of the indexed property
162 * @return the value of the property
163 * @throws IllegalAccessException if the property is not accesible
164 * @throws IntrospectionException if the bean introspection is failed
165 * @throws InvocationTargetException if the getter cannot be invoked
166 * @throws NoSuchMethodException if the getter is not found
167 */
168 private static Object getPropertyValue(Object bean, String name, Integer index) throws IllegalAccessException, IntrospectionException, InvocationTargetException, NoSuchMethodException {
169 Class<?> type = bean.getClass();
170 if (index == null) {
171 return findGetter(type, name).invoke(bean);
172 } else if (type.isArray() && (name == null)) {
173 return Array.get(bean, index);
174 } else {
175 return findGetter(type, name, int.class).invoke(bean, index);
176 }
177 }
178
179 /**
180 * Performs the search of the setter for the property
181 * with specified {@code name} in specified class
182 * and updates value of the property.
183 *
184 * @param bean the context bean that contains property
185 * @param name the name of the property
186 * @param index the index of the indexed property
187 * @param value the new value for the property
188 * @throws IllegalAccessException if the property is not accesible
189 * @throws IntrospectionException if the bean introspection is failed
190 * @throws InvocationTargetException if the setter cannot be invoked
191 * @throws NoSuchMethodException if the setter is not found
192 */
193 private static void setPropertyValue(Object bean, String name, Integer index, Object value) throws IllegalAccessException, IntrospectionException, InvocationTargetException, NoSuchMethodException {
194 Class<?> type = bean.getClass();
195 Class<?> param = (value != null)
196 ? value.getClass()
197 : null;
198
199 if (index == null) {
200 findSetter(type, name, param).invoke(bean, value);
201 } else if (type.isArray() && (name == null)) {
202 Array.set(bean, index, value);
203 } else {
204 findSetter(type, name, int.class, param).invoke(bean, index, value);
205 }
206 }
207
208 /**
209 * Performs the search of the getter for the property
210 * with specified {@code name} in specified class.
211 *
212 * @param type the class that contains method
213 * @param name the name of the property
214 * @param args the method arguments
215 * @return method object that represents found getter
216 * @throws IntrospectionException if the bean introspection is failed
217 * @throws NoSuchMethodException if method is not found
218 */
219 private static Method findGetter(Class<?> type, String name, Class<?>...args) throws IntrospectionException, NoSuchMethodException {
220 if (name == null) {
221 return MethodFinder.findInstanceMethod(type, GETTER, args);
222 }
223 PropertyDescriptor pd = getProperty(type, name);
224 if (args.length == 0) {
225 Method method = pd.getReadMethod();
226 if (method != null) {
227 return method;
228 }
229 } else if (pd instanceof IndexedPropertyDescriptor) {
230 IndexedPropertyDescriptor ipd = (IndexedPropertyDescriptor) pd;
231 Method method = ipd.getIndexedReadMethod();
232 if (method != null) {
233 return method;
234 }
235 }
236 throw new IntrospectionException("Could not find getter for the " + name + " property");
237 }
238
239 /**
240 * Performs the search of the setter for the property
241 * with specified {@code name} in specified class.
242 *
243 * @param type the class that contains method
244 * @param name the name of the property
245 * @param args the method arguments
246 * @return method object that represents found setter
247 * @throws IntrospectionException if the bean introspection is failed
248 * @throws NoSuchMethodException if method is not found
249 */
250 private static Method findSetter(Class<?> type, String name, Class<?>...args) throws IntrospectionException, NoSuchMethodException {
251 if (name == null) {
252 return MethodFinder.findInstanceMethod(type, SETTER, args);
253 }
254 PropertyDescriptor pd = getProperty(type, name);
255 if (args.length == 1) {
256 Method method = pd.getWriteMethod();
257 if (method != null) {
258 return method;
259 }
260 } else if (pd instanceof IndexedPropertyDescriptor) {
261 IndexedPropertyDescriptor ipd = (IndexedPropertyDescriptor) pd;
262 Method method = ipd.getIndexedWriteMethod();
263 if (method != null) {
264 return method;
265 }
266 }
267 throw new IntrospectionException("Could not find setter for the " + name + " property");
268 }
269
270 /**
271 * Performs the search of the descriptor for the property
272 * with specified {@code name} in specified class.
273 *
274 * @param type the class to introspect
275 * @param name the property name
276 * @return descriptor for the named property
277 * @throws IntrospectionException if property descriptor is not found
278 */
279 private static PropertyDescriptor getProperty(Class<?> type, String name) throws IntrospectionException {
280 for (PropertyDescriptor pd : Introspector.getBeanInfo(type).getPropertyDescriptors()) {
281 if (name.equals(pd.getName())) {
282 return pd;
283 }
284 }
285 throw new IntrospectionException("Could not find the " + name + " property descriptor");
286 }
287}
java/pkg/com/sun/beans/decoder/ShortElementHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/decoder/ShortElementHandler.java+63−0
@@ -0,0 +1,63 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.decoder;
26
27/**
28 * This class is intended to handle &lt;short&gt; element.
29 * This element specifies {@code short} values.
30 * The class {@link Short} is used as wrapper for these values.
31 * The result value is created from text of the body of this element.
32 * The body parsing is described in the class {@link StringElementHandler}.
33 * For example:<pre>
34 * &lt;short&gt;200&lt;/short&gt;</pre>
35 * is shortcut to<pre>
36 * &lt;method name="decode" class="java.lang.Short"&gt;
37 * &lt;string&gt;200&lt;/string&gt;
38 * &lt;/method&gt;</pre>
39 * which is equivalent to {@code Short.decode("200")} in Java code.
40 * <p>The following atribute is supported:
41 * <dl>
42 * <dt>id
43 * <dd>the identifier of the variable that is intended to store the result
44 * </dl>
45 *
46 * @since 1.7
47 *
48 * @author Sergey A. Malenkov
49 */
50final class ShortElementHandler extends StringElementHandler {
51
52 /**
53 * Creates {@code short} value from
54 * the text of the body of this element.
55 *
56 * @param argument the text of the body
57 * @return evaluated {@code short} value
58 */
59 @Override
60 public Object getValue(String argument) {
61 return Short.decode(argument);
62 }
63}
java/pkg/com/sun/beans/decoder/StringElementHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/decoder/StringElementHandler.java+116−0
@@ -0,0 +1,116 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.decoder;
26
27/**
28 * This class is intended to handle &lt;string&gt; element.
29 * This element specifies {@link String} values.
30 * The result value is created from text of the body of this element.
31 * For example:<pre>
32 * &lt;string&gt;description&lt;/string&gt;</pre>
33 * is equivalent to {@code "description"} in Java code.
34 * The value of inner element is calculated
35 * before adding to the string using {@link String#valueOf(Object)}.
36 * Note that all characters are used including whitespaces (' ', '\t', '\n', '\r').
37 * So the value of the element<pre>
38 * &lt;string&gt&lt;true&gt&lt;/string&gt;</pre>
39 * is not equal to the value of the element<pre>
40 * &lt;string&gt;
41 * &lt;true&gt;
42 * &lt;/string&gt;</pre>
43 * <p>The following atribute is supported:
44 * <dl>
45 * <dt>id
46 * <dd>the identifier of the variable that is intended to store the result
47 * </dl>
48 *
49 * @since 1.7
50 *
51 * @author Sergey A. Malenkov
52 */
53public class StringElementHandler extends ElementHandler {
54 private StringBuilder sb = new StringBuilder();
55 private ValueObject value = ValueObjectImpl.NULL;
56
57 /**
58 * Adds the character that contained in this element.
59 *
60 * @param ch the character
61 */
62 @Override
63 public final void addCharacter(char ch) {
64 if (this.sb == null) {
65 throw new IllegalStateException("Could not add chararcter to evaluated string element");
66 }
67 this.sb.append(ch);
68 }
69
70 /**
71 * Adds the string value of the argument to the string value of this element.
72 *
73 * @param argument the value of the element that contained in this one
74 */
75 @Override
76 protected final void addArgument(Object argument) {
77 if (this.sb == null) {
78 throw new IllegalStateException("Could not add argument to evaluated string element");
79 }
80 this.sb.append(argument);
81 }
82
83 /**
84 * Returns the value of this element.
85 *
86 * @return the value of this element
87 */
88 @Override
89 protected final ValueObject getValueObject() {
90 if (this.sb != null) {
91 try {
92 this.value = ValueObjectImpl.create(getValue(this.sb.toString()));
93 }
94 catch (RuntimeException exception) {
95 getOwner().handleException(exception);
96 }
97 finally {
98 this.sb = null;
99 }
100 }
101 return this.value;
102 }
103
104 /**
105 * Returns the text of the body of this element.
106 * This method evaluates value from text of the body,
107 * and should be overridden in those handlers
108 * that extend behavior of this element.
109 *
110 * @param argument the text of the body
111 * @return evaluated value
112 */
113 protected Object getValue(String argument) {
114 return argument;
115 }
116}
java/pkg/com/sun/beans/decoder/TrueElementHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/decoder/TrueElementHandler.java+56−0
@@ -0,0 +1,56 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.decoder;
26
27/**
28 * This class is intended to handle &lt;true&gt; element.
29 * This element specifies {@code true} value.
30 * It should not contain body or inner elements.
31 * For example:<pre>
32 * &lt;true/&gt;</pre>
33 * is equivalent to {@code true} in Java code.
34 * <p>The following atribute is supported:
35 * <dl>
36 * <dt>id
37 * <dd>the identifier of the variable that is intended to store the result
38 * </dl>
39 *
40 * @since 1.7
41 *
42 * @author Sergey A. Malenkov
43 */
44final class TrueElementHandler extends NullElementHandler {
45
46 /**
47 * Returns {@code Boolean.TRUE}
48 * as a value of &lt;true&gt; element.
49 *
50 * @return {@code Boolean.TRUE} by default
51 */
52 @Override
53 public Object getValue() {
54 return Boolean.TRUE;
55 }
56}
java/pkg/com/sun/beans/decoder/ValueObject.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/decoder/ValueObject.java+50−0
@@ -0,0 +1,50 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.decoder;
26
27/**
28 * This interface represents the result of method execution.
29 *
30 * @since 1.7
31 *
32 * @author Sergey A. Malenkov
33 */
34public interface ValueObject {
35
36 /**
37 * Returns the result of method execution.
38 *
39 * @return the result of method execution
40 */
41 Object getValue();
42
43 /**
44 * Returns {@code void} state of this value object.
45 *
46 * @return {@code true} if value can be ignored,
47 * {@code false} otherwise
48 */
49 boolean isVoid();
50}
java/pkg/com/sun/beans/decoder/ValueObjectImpl.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/decoder/ValueObjectImpl.java+88−0
@@ -0,0 +1,88 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.decoder;
26
27/**
28 * This utility class provides {@code static} method
29 * to create the object that contains the result of method execution.
30 *
31 * @since 1.7
32 *
33 * @author Sergey A. Malenkov
34 */
35final class ValueObjectImpl implements ValueObject {
36 static final ValueObject NULL = new ValueObjectImpl(null);
37 static final ValueObject VOID = new ValueObjectImpl();
38
39 /**
40 * Returns the object that describes returning value.
41 *
42 * @param value the result of method execution
43 * @return the object that describes value
44 */
45 static ValueObject create(Object value) {
46 return (value != null)
47 ? new ValueObjectImpl(value)
48 : NULL;
49 }
50
51 private Object value;
52 private boolean isVoid;
53
54 /**
55 * Creates the object that describes returning void value.
56 */
57 private ValueObjectImpl() {
58 this.isVoid = true;
59 }
60
61 /**
62 * Creates the object that describes returning non-void value.
63 *
64 * @param value the result of method execution
65 */
66 private ValueObjectImpl(Object value) {
67 this.value = value;
68 }
69
70 /**
71 * Returns the result of method execution.
72 *
73 * @return the result of method execution
74 */
75 public Object getValue() {
76 return this.value;
77 }
78
79 /**
80 * Returns {@code void} state of this value object.
81 *
82 * @return {@code true} if value should be ignored,
83 * {@code false} otherwise
84 */
85 public boolean isVoid() {
86 return this.isVoid;
87 }
88}
java/pkg/com/sun/beans/decoder/VarElementHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/decoder/VarElementHandler.java+82−0
@@ -0,0 +1,82 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.decoder;
26
27/**
28 * This class is intended to handle &lt;var&gt; element.
29 * This element retrieves the value of specified variable.
30 * For example:<pre>
31 * &lt;var id="id1" idref="id2"/&gt;</pre>
32 * is equivalent to {@code id1 = id2} in Java code.
33 * <p>The following atributes are supported:
34 * <dl>
35 * <dt>idref
36 * <dd>the identifier to refer to the variable
37 * <dt>id
38 * <dd>the identifier of the variable that is intended to store the result
39 * </dl>
40 *
41 * @since 1.7
42 *
43 * @author Sergey A. Malenkov
44 */
45final class VarElementHandler extends ElementHandler {
46 private ValueObject value;
47
48 /**
49 * Parses attributes of the element.
50 * The following atributes are supported:
51 * <dl>
52 * <dt>idref
53 * <dd>the identifier to refer to the variable
54 * <dt>id
55 * <dd>the identifier of the variable that is intended to store the result
56 * </dl>
57 *
58 * @param name the attribute name
59 * @param value the attribute value
60 */
61 @Override
62 public void addAttribute(String name, String value) {
63 if (name.equals("idref")) { // NON-NLS: the attribute name
64 this.value = ValueObjectImpl.create(getVariable(value));
65 } else {
66 super.addAttribute(name, value);
67 }
68 }
69
70 /**
71 * Returns the value of this element.
72 *
73 * @return the value of this element
74 */
75 @Override
76 protected ValueObject getValueObject() {
77 if (this.value == null) {
78 throw new IllegalArgumentException("Variable name is not set");
79 }
80 return this.value;
81 }
82}
java/pkg/com/sun/beans/decoder/VoidElementHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/decoder/VoidElementHandler.java+68−0
@@ -0,0 +1,68 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.decoder;
26
27/**
28 * This class is intended to handle &lt;void&gt; element.
29 * This element looks like &lt;object&gt; element,
30 * but its value is not used as an argument for element
31 * that contains this one.
32 * <p>The following atributes are supported:
33 * <dl>
34 * <dt>class
35 * <dd>the type is used for static methods and fields
36 * <dt>method
37 * <dd>the method name
38 * <dt>property
39 * <dd>the property name
40 * <dt>index
41 * <dd>the property index
42 * <dt>field
43 * <dd>the field name
44 * <dt>idref
45 * <dd>the identifier to refer to the variable
46 * <dt>id
47 * <dd>the identifier of the variable that is intended to store the result
48 * </dl>
49 *
50 * @since 1.7
51 *
52 * @author Sergey A. Malenkov
53 */
54final class VoidElementHandler extends ObjectElementHandler {
55
56 /**
57 * Tests whether the value of this element can be used
58 * as an argument of the element that contained in this one.
59 *
60 * @return {@code true} if the value of this element should be used
61 * as an argument of the element that contained in this one,
62 * {@code false} otherwise
63 */
64 @Override
65 protected boolean isArgument() {
66 return false; // hack for compatibility
67 }
68}
java/pkg/com/sun/beans/decoder/mkfile+34−0
@@ -0,0 +1,34 @@
1<../../../../../../mkconfig
2
3TARG=\
4 AccessorElementHandler.dis\
5 ArrayElementHandler.dis\
6 BooleanElementHandler.dis\
7 ByteElementHandler.dis\
8 CharElementHandler.dis\
9 ClassElementHandler.dis\
10 DocumentHandler.dis\
11 DoubleElementHandler.dis\
12 ElementHandler.dis\
13 FalseElementHandler.dis\
14 FieldElementHandler.dis\
15 FloatElementHandler.dis\
16 IntElementHandler.dis\
17 JavaElementHandler.dis\
18 LongElementHandler.dis\
19 MethodElementHandler.dis\
20 NewElementHandler.dis\
21 NullElementHandler.dis\
22 ObjectElementHandler.dis\
23 PropertyElementHandler.dis\
24 ShortElementHandler.dis\
25 StringElementHandler.dis\
26 TrueElementHandler.dis\
27 ValueObject.dis\
28 ValueObjectImpl.dis\
29 VarElementHandler.dis\
30 VoidElementHandler.dis\
31
32DISBIN=$ROOT/java/dis/java/java/com/sun/beans/decoder
33
34<$ROOT/mkfiles/mkjava
java/pkg/com/sun/beans/finder/AbstractFinder.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/finder/AbstractFinder.java+213−0
@@ -0,0 +1,213 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.finder;
26
27import java.util.HashMap;
28import java.util.Map;
29
30/**
31 * This abstract class provides functionality
32 * to find a public method or constructor
33 * with specified parameter types.
34 * It supports a variable number of parameters.
35 *
36 * @since 1.7
37 *
38 * @author Sergey A. Malenkov
39 */
40abstract class AbstractFinder<T> {
41 private final Class<?>[] args;
42
43 /**
44 * Creates finder for array of classes of arguments.
45 * If a particular element of array equals {@code null},
46 * than the appropriate pair of classes
47 * does not take into consideration.
48 *
49 * @param args array of classes of arguments
50 */
51 protected AbstractFinder(Class<?>[] args) {
52 this.args = args;
53 }
54
55 /**
56 * Returns an array of {@code Class} objects
57 * that represent the formal parameter types of the method
58 * Returns an empty array if the method takes no parameters.
59 *
60 * @param method the object that represents method
61 * @return the parameter types of the method
62 */
63 protected abstract Class<?>[] getParameters(T method);
64
65 /**
66 * Returns {@code true} if and only if the method
67 * was declared to take a variable number of arguments.
68 *
69 * @param method the object that represents method
70 * @return {@code true} if the method was declared
71 * to take a variable number of arguments;
72 * {@code false} otherwise
73 */
74 protected abstract boolean isVarArgs(T method);
75
76 /**
77 * Checks validness of the method.
78 * At least the valid method should be public.
79 *
80 * @param method the object that represents method
81 * @return {@code true} if the method is valid,
82 * {@code false} otherwise
83 */
84 protected abstract boolean isValid(T method);
85
86 /**
87 * Performs a search in the {@code methods} array.
88 * The one method is selected from the array of the valid methods.
89 * The list of parameters of the selected method shows
90 * the best correlation with the list of arguments
91 * specified at class initialization.
92 * If more than one method is both accessible and applicable
93 * to a method invocation, it is necessary to choose one
94 * to provide the descriptor for the run-time method dispatch.
95 * The most specific method should be chosen.
96 *
97 * @param methods the array of methods to search within
98 * @return the object that represents found method
99 * @throws NoSuchMethodException if no method was found or several
100 * methods meet the search criteria
101 * @see #isAssignable
102 */
103 final T find(T[] methods) throws NoSuchMethodException {
104 Map<T, Class<?>[]> map = new HashMap<T, Class<?>[]>();
105
106 T oldMethod = null;
107 Class<?>[] oldParams = null;
108 boolean ambiguous = false;
109
110 for (T newMethod : methods) {
111 if (isValid(newMethod)) {
112 Class<?>[] newParams = getParameters(newMethod);
113 if (newParams.length == this.args.length) {
114 PrimitiveWrapperMap.replacePrimitivesWithWrappers(newParams);
115 if (isAssignable(newParams, this.args)) {
116 if (oldMethod == null) {
117 oldMethod = newMethod;
118 oldParams = newParams;
119 } else {
120 boolean useNew = isAssignable(oldParams, newParams);
121 boolean useOld = isAssignable(newParams, oldParams);
122
123 if (useOld == useNew) {
124 ambiguous = true;
125 } else if (useNew) {
126 oldMethod = newMethod;
127 oldParams = newParams;
128 ambiguous = false;
129 }
130 }
131 }
132 }
133 if (isVarArgs(newMethod)) {
134 int length = newParams.length - 1;
135 if (length <= this.args.length) {
136 Class<?>[] array = new Class<?>[this.args.length];
137 System.arraycopy(newParams, 0, array, 0, length);
138 if (length < this.args.length) {
139 Class<?> type = newParams[length].getComponentType();
140 if (type.isPrimitive()) {
141 type = PrimitiveWrapperMap.getType(type.getName());
142 }
143 for (int i = length; i < this.args.length; i++) {
144 array[i] = type;
145 }
146 }
147 map.put(newMethod, array);
148 }
149 }
150 }
151 }
152 for (T newMethod : methods) {
153 Class<?>[] newParams = map.get(newMethod);
154 if (newParams != null) {
155 if (isAssignable(newParams, this.args)) {
156 if (oldMethod == null) {
157 oldMethod = newMethod;
158 oldParams = newParams;
159 } else {
160 boolean useNew = isAssignable(oldParams, newParams);
161 boolean useOld = isAssignable(newParams, oldParams);
162
163 if (useOld == useNew) {
164 if (oldParams == map.get(oldMethod)) {
165 ambiguous = true;
166 }
167 } else if (useNew) {
168 oldMethod = newMethod;
169 oldParams = newParams;
170 ambiguous = false;
171 }
172 }
173 }
174 }
175 }
176
177 if (ambiguous) {
178 throw new NoSuchMethodException("Ambiguous methods are found");
179 }
180 if (oldMethod == null) {
181 throw new NoSuchMethodException("Method is not found");
182 }
183 return oldMethod;
184 }
185
186 /**
187 * Determines if every class in {@code min} array is either the same as,
188 * or is a superclass of, the corresponding class in {@code max} array.
189 * The length of every array must equal the number of arguments.
190 * This comparison is performed in the {@link #find} method
191 * before the first call of the isAssignable method.
192 * If an argument equals {@code null}
193 * the appropriate pair of classes does not take into consideration.
194 *
195 * @param min the array of classes to be checked
196 * @param max the array of classes that is used to check
197 * @return {@code true} if all classes in {@code min} array
198 * are assignable from corresponding classes in {@code max} array,
199 * {@code false} otherwise
200 *
201 * @see Class#isAssignableFrom
202 */
203 private boolean isAssignable(Class<?>[] min, Class<?>[] max) {
204 for (int i = 0; i < this.args.length; i++) {
205 if (null != this.args[i]) {
206 if (!min[i].isAssignableFrom(max[i])) {
207 return false;
208 }
209 }
210 }
211 return true;
212 }
213}
java/pkg/com/sun/beans/finder/BeanInfoFinder.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/finder/BeanInfoFinder.java+98−0
@@ -0,0 +1,98 @@
1/*
2 * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.finder;
26
27import java.beans.BeanDescriptor;
28import java.beans.BeanInfo;
29import java.beans.MethodDescriptor;
30import java.beans.PropertyDescriptor;
31import java.lang.reflect.Method;
32
33/**
34 * This is utility class that provides functionality
35 * to find a {@link BeanInfo} for a JavaBean specified by its type.
36 *
37 * @since 1.7
38 *
39 * @author Sergey A. Malenkov
40 */
41public final class BeanInfoFinder
42 extends InstanceFinder<BeanInfo> {
43
44 private static final String DEFAULT = "sun.beans.infos";
45
46 public BeanInfoFinder() {
47 super(BeanInfo.class, true, "BeanInfo", DEFAULT);
48 }
49
50 private static boolean isValid(Class<?> type, Method method) {
51 return (method != null) && method.getDeclaringClass().isAssignableFrom(type);
52 }
53
54 @Override
55 protected BeanInfo instantiate(Class<?> type, String prefix, String name) {
56 // this optimization will only use the BeanInfo search path
57 // if is has changed from the original
58 // or trying to get the ComponentBeanInfo
59 BeanInfo info = !DEFAULT.equals(prefix) || "ComponentBeanInfo".equals(name)
60 ? super.instantiate(type, prefix, name)
61 : null;
62
63 if (info != null) {
64 // make sure that the returned BeanInfo matches the class
65 BeanDescriptor bd = info.getBeanDescriptor();
66 if (bd != null) {
67 if (type.equals(bd.getBeanClass())) {
68 return info;
69 }
70 }
71 else {
72 PropertyDescriptor[] pds = info.getPropertyDescriptors();
73 if (pds != null) {
74 for (PropertyDescriptor pd : pds) {
75 Method method = pd.getReadMethod();
76 if (method == null) {
77 method = pd.getWriteMethod();
78 }
79 if (isValid(type, method)) {
80 return info;
81 }
82 }
83 }
84 else {
85 MethodDescriptor[] mds = info.getMethodDescriptors();
86 if (mds != null) {
87 for (MethodDescriptor md : mds) {
88 if (isValid(type, md.getMethod())) {
89 return info;
90 }
91 }
92 }
93 }
94 }
95 }
96 return null;
97 }
98}
java/pkg/com/sun/beans/finder/ClassFinder.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/finder/ClassFinder.java+176−0
@@ -0,0 +1,176 @@
1/*
2 * Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.finder;
26
27/**
28 * This is utility class that provides {@code static} methods
29 * to find a class with the specified name using the specified class loader.
30 *
31 * @since 1.7
32 *
33 * @author Sergey A. Malenkov
34 */
35public final class ClassFinder {
36
37 /**
38 * Returns the {@code Class} object associated
39 * with the class or interface with the given string name,
40 * using the default class loader.
41 * <p>
42 * The {@code name} can denote an array class
43 * (see {@link Class#getName} for details).
44 *
45 * @param name fully qualified name of the desired class
46 * @return class object representing the desired class
47 *
48 * @throws ClassNotFoundException if the class cannot be located
49 * by the specified class loader
50 *
51 * @see Class#forName(String)
52 * @see Class#forName(String,boolean,ClassLoader)
53 * @see ClassLoader#getSystemClassLoader()
54 * @see Thread#getContextClassLoader()
55 */
56 public static Class<?> findClass(String name) throws ClassNotFoundException {
57 try {
58 ClassLoader loader = Thread.currentThread().getContextClassLoader();
59 if (loader == null) {
60 // can be null in IE (see 6204697)
61 loader = ClassLoader.getSystemClassLoader();
62 }
63 if (loader != null) {
64 return Class.forName(name, false, loader);
65 }
66
67 } catch (ClassNotFoundException exception) {
68 // use current class loader instead
69 } catch (SecurityException exception) {
70 // use current class loader instead
71 }
72 return Class.forName(name);
73 }
74
75 /**
76 * Returns the {@code Class} object associated with
77 * the class or interface with the given string name,
78 * using the given class loader.
79 * <p>
80 * The {@code name} can denote an array class
81 * (see {@link Class#getName} for details).
82 * <p>
83 * If the parameter {@code loader} is null,
84 * the class is loaded through the default class loader.
85 *
86 * @param name fully qualified name of the desired class
87 * @param loader class loader from which the class must be loaded
88 * @return class object representing the desired class
89 *
90 * @throws ClassNotFoundException if the class cannot be located
91 * by the specified class loader
92 *
93 * @see #findClass(String,ClassLoader)
94 * @see Class#forName(String,boolean,ClassLoader)
95 */
96 public static Class<?> findClass(String name, ClassLoader loader) throws ClassNotFoundException {
97 if (loader != null) {
98 try {
99 return Class.forName(name, false, loader);
100 } catch (ClassNotFoundException exception) {
101 // use default class loader instead
102 } catch (SecurityException exception) {
103 // use default class loader instead
104 }
105 }
106 return findClass(name);
107 }
108
109 /**
110 * Returns the {@code Class} object associated
111 * with the class or interface with the given string name,
112 * using the default class loader.
113 * <p>
114 * The {@code name} can denote an array class
115 * (see {@link Class#getName} for details).
116 * <p>
117 * This method can be used to obtain
118 * any of the {@code Class} objects
119 * representing {@code void} or primitive Java types:
120 * {@code char}, {@code byte}, {@code short},
121 * {@code int}, {@code long}, {@code float},
122 * {@code double} and {@code boolean}.
123 *
124 * @param name fully qualified name of the desired class
125 * @return class object representing the desired class
126 *
127 * @throws ClassNotFoundException if the class cannot be located
128 * by the specified class loader
129 *
130 * @see #resolveClass(String,ClassLoader)
131 */
132 public static Class<?> resolveClass(String name) throws ClassNotFoundException {
133 return resolveClass(name, null);
134 }
135
136 /**
137 * Returns the {@code Class} object associated with
138 * the class or interface with the given string name,
139 * using the given class loader.
140 * <p>
141 * The {@code name} can denote an array class
142 * (see {@link Class#getName} for details).
143 * <p>
144 * If the parameter {@code loader} is null,
145 * the class is loaded through the default class loader.
146 * <p>
147 * This method can be used to obtain
148 * any of the {@code Class} objects
149 * representing {@code void} or primitive Java types:
150 * {@code char}, {@code byte}, {@code short},
151 * {@code int}, {@code long}, {@code float},
152 * {@code double} and {@code boolean}.
153 *
154 * @param name fully qualified name of the desired class
155 * @param loader class loader from which the class must be loaded
156 * @return class object representing the desired class
157 *
158 * @throws ClassNotFoundException if the class cannot be located
159 * by the specified class loader
160 *
161 * @see #findClass(String,ClassLoader)
162 * @see PrimitiveTypeMap#getType(String)
163 */
164 public static Class<?> resolveClass(String name, ClassLoader loader) throws ClassNotFoundException {
165 Class<?> type = PrimitiveTypeMap.getType(name);
166 return (type == null)
167 ? findClass(name, loader)
168 : type;
169 }
170
171 /**
172 * Disable instantiation.
173 */
174 private ClassFinder() {
175 }
176}
java/pkg/com/sun/beans/finder/ConstructorFinder.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/finder/ConstructorFinder.java+127−0
@@ -0,0 +1,127 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.finder;
26
27import com.sun.beans.WeakCache;
28
29import java.lang.reflect.Constructor;
30import java.lang.reflect.Modifier;
31
32/**
33 * This utility class provides {@code static} methods
34 * to find a public constructor with specified parameter types
35 * in specified class.
36 *
37 * @since 1.7
38 *
39 * @author Sergey A. Malenkov
40 */
41public final class ConstructorFinder extends AbstractFinder<Constructor<?>> {
42 private static final WeakCache<Signature, Constructor<?>> CACHE = new WeakCache<Signature, Constructor<?>>();
43
44 /**
45 * Finds public constructor
46 * that is declared in public class.
47 *
48 * @param type the class that can have constructor
49 * @param args parameter types that is used to find constructor
50 * @return object that represents found constructor
51 * @throws NoSuchMethodException if constructor could not be found
52 * or some constructors are found
53 */
54 public static Constructor<?> findConstructor(Class<?> type, Class<?>...args) throws NoSuchMethodException {
55 if (type.isPrimitive()) {
56 throw new NoSuchMethodException("Primitive wrapper does not contain constructors");
57 }
58 if (type.isInterface()) {
59 throw new NoSuchMethodException("Interface does not contain constructors");
60 }
61 if (Modifier.isAbstract(type.getModifiers())) {
62 throw new NoSuchMethodException("Abstract class cannot be instantiated");
63 }
64 if (!Modifier.isPublic(type.getModifiers())) {
65 throw new NoSuchMethodException("Class is not accessible");
66 }
67 PrimitiveWrapperMap.replacePrimitivesWithWrappers(args);
68 Signature signature = new Signature(type, args);
69
70 Constructor<?> constructor = CACHE.get(signature);
71 if (constructor != null) {
72 return constructor;
73 }
74 constructor = new ConstructorFinder(args).find(type.getConstructors());
75 CACHE.put(signature, constructor);
76 return constructor;
77 }
78
79 /**
80 * Creates constructor finder with specified array of parameter types.
81 *
82 * @param args the array of parameter types
83 */
84 private ConstructorFinder(Class<?>[] args) {
85 super(args);
86 }
87
88 /**
89 * Returns an array of {@code Class} objects
90 * that represent the formal parameter types of the constructor
91 * Returns an empty array if the constructor takes no parameters.
92 *
93 * @param constructor the object that represents constructor
94 * @return the parameter types of the constructor
95 */
96 @Override
97 protected Class<?>[] getParameters(Constructor<?> constructor) {
98 return constructor.getParameterTypes();
99 }
100
101 /**
102 * Returns {@code true} if and only if the constructor
103 * was declared to take a variable number of arguments.
104 *
105 * @param constructor the object that represents constructor
106 * @return {@code true} if the constructor was declared
107 * to take a variable number of arguments;
108 * {@code false} otherwise
109 */
110 @Override
111 protected boolean isVarArgs(Constructor<?> constructor) {
112 return constructor.isVarArgs();
113 }
114
115 /**
116 * Checks validness of the constructor.
117 * The valid constructor should be public.
118 *
119 * @param constructor the object that represents constructor
120 * @return {@code true} if the constructor is valid,
121 * {@code false} otherwise
122 */
123 @Override
124 protected boolean isValid(Constructor<?> constructor) {
125 return Modifier.isPublic(constructor.getModifiers());
126 }
127}
java/pkg/com/sun/beans/finder/FieldFinder.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/finder/FieldFinder.java+106−0
@@ -0,0 +1,106 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.finder;
26
27import java.lang.reflect.Field;
28import java.lang.reflect.Modifier;
29
30/**
31 * This utility class provides {@code static} methods
32 * to find a public field with specified name
33 * in specified class.
34 *
35 * @since 1.7
36 *
37 * @author Sergey A. Malenkov
38 */
39public final class FieldFinder {
40
41 /**
42 * Finds public field (static or non-static)
43 * that is declared in public class.
44 *
45 * @param type the class that can have field
46 * @param name the name of field to find
47 * @return object that represents found field
48 * @throws NoSuchFieldException if field is not found
49 * @see Class#getField
50 */
51 public static Field findField(Class<?> type, String name) throws NoSuchFieldException {
52 if (name == null) {
53 throw new IllegalArgumentException("Field name is not set");
54 }
55 Field field = type.getField(name);
56 if (!Modifier.isPublic(field.getModifiers())) {
57 throw new NoSuchFieldException("Field '" + name + "' is not public");
58 }
59 if (!Modifier.isPublic(field.getDeclaringClass().getModifiers())) {
60 throw new NoSuchFieldException("Field '" + name + "' is not accessible");
61 }
62 return field;
63 }
64
65 /**
66 * Finds public non-static field
67 * that is declared in public class.
68 *
69 * @param type the class that can have field
70 * @param name the name of field to find
71 * @return object that represents found field
72 * @throws NoSuchFieldException if field is not found
73 * @see Class#getField
74 */
75 public static Field findInstanceField(Class<?> type, String name) throws NoSuchFieldException {
76 Field field = findField(type, name);
77 if (Modifier.isStatic(field.getModifiers())) {
78 throw new NoSuchFieldException("Field '" + name + "' is static");
79 }
80 return field;
81 }
82
83 /**
84 * Finds public static field
85 * that is declared in public class.
86 *
87 * @param type the class that can have field
88 * @param name the name of field to find
89 * @return object that represents found field
90 * @throws NoSuchFieldException if field is not found
91 * @see Class#getField
92 */
93 public static Field findStaticField(Class<?> type, String name) throws NoSuchFieldException {
94 Field field = findField(type, name);
95 if (!Modifier.isStatic(field.getModifiers())) {
96 throw new NoSuchFieldException("Field '" + name + "' is not static");
97 }
98 return field;
99 }
100
101 /**
102 * Disable instantiation.
103 */
104 private FieldFinder() {
105 }
106}
java/pkg/com/sun/beans/finder/InstanceFinder.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/finder/InstanceFinder.java+109−0
@@ -0,0 +1,109 @@
1/*
2 * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.finder;
26
27/**
28 * This is utility class that provides basic functionality
29 * to find an auxiliary class for a JavaBean specified by its type.
30 *
31 * @since 1.7
32 *
33 * @author Sergey A. Malenkov
34 */
35class InstanceFinder<T> {
36
37 private static final String[] EMPTY = { };
38
39 private final Class<? extends T> type;
40 private final boolean allow;
41 private final String suffix;
42 private volatile String[] packages;
43
44 InstanceFinder(Class<? extends T> type, boolean allow, String suffix, String... packages) {
45 this.type = type;
46 this.allow = allow;
47 this.suffix = suffix;
48 this.packages = packages.clone();
49 }
50
51 public String[] getPackages() {
52 return this.packages.clone();
53 }
54
55 public void setPackages(String... packages) {
56 this.packages = (packages != null) && (packages.length > 0)
57 ? packages.clone()
58 : EMPTY;
59 }
60
61 public T find(Class<?> type) {
62 if (type == null) {
63 return null;
64 }
65 String name = type.getName() + this.suffix;
66 T object = instantiate(type, name);
67 if (object != null) {
68 return object;
69 }
70 if (this.allow) {
71 object = instantiate(type, null);
72 if (object != null) {
73 return object;
74 }
75 }
76 int index = name.lastIndexOf('.') + 1;
77 if (index > 0) {
78 name = name.substring(index);
79 }
80 for (String prefix : this.packages) {
81 object = instantiate(type, prefix, name);
82 if (object != null) {
83 return object;
84 }
85 }
86 return null;
87 }
88
89 protected T instantiate(Class<?> type, String name) {
90 if (type != null) {
91 try {
92 if (name != null) {
93 type = ClassFinder.findClass(name, type.getClassLoader());
94 }
95 if (this.type.isAssignableFrom(type)) {
96 return (T) type.newInstance();
97 }
98 }
99 catch (Exception exception) {
100 // ignore any exceptions
101 }
102 }
103 return null;
104 }
105
106 protected T instantiate(Class<?> type, String prefix, String name) {
107 return instantiate(type, prefix + '.' + name);
108 }
109}
java/pkg/com/sun/beans/finder/MethodFinder.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/finder/MethodFinder.java+231−0
@@ -0,0 +1,231 @@
1/*
2 * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.finder;
26
27import com.sun.beans.TypeResolver;
28import com.sun.beans.WeakCache;
29
30import java.lang.reflect.Method;
31import java.lang.reflect.Modifier;
32import java.lang.reflect.ParameterizedType;
33import java.lang.reflect.Type;
34import java.util.Arrays;
35
36/**
37 * This utility class provides {@code static} methods
38 * to find a public method with specified name and parameter types
39 * in specified class.
40 *
41 * @since 1.7
42 *
43 * @author Sergey A. Malenkov
44 */
45public final class MethodFinder extends AbstractFinder<Method> {
46 private static final WeakCache<Signature, Method> CACHE = new WeakCache<Signature, Method>();
47
48 /**
49 * Finds public method (static or non-static)
50 * that is accessible from public class.
51 *
52 * @param type the class that can have method
53 * @param name the name of method to find
54 * @param args parameter types that is used to find method
55 * @return object that represents found method
56 * @throws NoSuchMethodException if method could not be found
57 * or some methods are found
58 */
59 public static Method findMethod(Class<?> type, String name, Class<?>...args) throws NoSuchMethodException {
60 if (name == null) {
61 throw new IllegalArgumentException("Method name is not set");
62 }
63 PrimitiveWrapperMap.replacePrimitivesWithWrappers(args);
64 Signature signature = new Signature(type, name, args);
65
66 Method method = CACHE.get(signature);
67 if (method != null) {
68 return method;
69 }
70 method = findAccessibleMethod(new MethodFinder(name, args).find(type.getMethods()));
71 CACHE.put(signature, method);
72 return method;
73 }
74
75 /**
76 * Finds public non-static method
77 * that is accessible from public class.
78 *
79 * @param type the class that can have method
80 * @param name the name of method to find
81 * @param args parameter types that is used to find method
82 * @return object that represents found method
83 * @throws NoSuchMethodException if method could not be found
84 * or some methods are found
85 */
86 public static Method findInstanceMethod(Class<?> type, String name, Class<?>... args) throws NoSuchMethodException {
87 Method method = findMethod(type, name, args);
88 if (Modifier.isStatic(method.getModifiers())) {
89 throw new NoSuchMethodException("Method '" + name + "' is static");
90 }
91 return method;
92 }
93
94 /**
95 * Finds public static method
96 * that is accessible from public class.
97 *
98 * @param type the class that can have method
99 * @param name the name of method to find
100 * @param args parameter types that is used to find method
101 * @return object that represents found method
102 * @throws NoSuchMethodException if method could not be found
103 * or some methods are found
104 */
105 public static Method findStaticMethod(Class<?> type, String name, Class<?>...args) throws NoSuchMethodException {
106 Method method = findMethod(type, name, args);
107 if (!Modifier.isStatic(method.getModifiers())) {
108 throw new NoSuchMethodException("Method '" + name + "' is not static");
109 }
110 return method;
111 }
112
113 /**
114 * Finds method that is accessible from public class or interface through class hierarchy.
115 *
116 * @param method object that represents found method
117 * @return object that represents accessible method
118 * @throws NoSuchMethodException if method is not accessible or is not found
119 * in specified superclass or interface
120 */
121 public static Method findAccessibleMethod(Method method) throws NoSuchMethodException {
122 Class<?> type = method.getDeclaringClass();
123 if (Modifier.isPublic(type.getModifiers())) {
124 return method;
125 }
126 if (Modifier.isStatic(method.getModifiers())) {
127 throw new NoSuchMethodException("Method '" + method.getName() + "' is not accessible");
128 }
129 for (Type generic : type.getGenericInterfaces()) {
130 try {
131 return findAccessibleMethod(method, generic);
132 }
133 catch (NoSuchMethodException exception) {
134 // try to find in superclass or another interface
135 }
136 }
137 return findAccessibleMethod(method, type.getGenericSuperclass());
138 }
139
140 /**
141 * Finds method that accessible from specified class.
142 *
143 * @param method object that represents found method
144 * @param generic generic type that is used to find accessible method
145 * @return object that represents accessible method
146 * @throws NoSuchMethodException if method is not accessible or is not found
147 * in specified superclass or interface
148 */
149 private static Method findAccessibleMethod(Method method, Type generic) throws NoSuchMethodException {
150 String name = method.getName();
151 Class<?>[] params = method.getParameterTypes();
152 if (generic instanceof Class) {
153 Class<?> type = (Class<?>) generic;
154 return findAccessibleMethod(type.getMethod(name, params));
155 }
156 if (generic instanceof ParameterizedType) {
157 ParameterizedType pt = (ParameterizedType) generic;
158 Class<?> type = (Class<?>) pt.getRawType();
159 for (Method m : type.getMethods()) {
160 if (m.getName().equals(name)) {
161 Class<?>[] pts = m.getParameterTypes();
162 if (pts.length == params.length) {
163 if (Arrays.equals(params, pts)) {
164 return findAccessibleMethod(m);
165 }
166 Type[] gpts = m.getGenericParameterTypes();
167 if (Arrays.equals(params, TypeResolver.erase(TypeResolver.resolve(pt, gpts)))) {
168 return findAccessibleMethod(m);
169 }
170 }
171 }
172 }
173 }
174 throw new NoSuchMethodException("Method '" + name + "' is not accessible");
175 }
176
177
178 private final String name;
179
180 /**
181 * Creates method finder with specified array of parameter types.
182 *
183 * @param name the name of method to find
184 * @param args the array of parameter types
185 */
186 private MethodFinder(String name, Class<?>[] args) {
187 super(args);
188 this.name = name;
189 }
190
191 /**
192 * Returns an array of {@code Class} objects
193 * that represent the formal parameter types of the method
194 * Returns an empty array if the method takes no parameters.
195 *
196 * @param method the object that represents method
197 * @return the parameter types of the method
198 */
199 @Override
200 protected Class<?>[] getParameters(Method method) {
201 return method.getParameterTypes();
202 }
203
204 /**
205 * Returns {@code true} if and only if the method
206 * was declared to take a variable number of arguments.
207 *
208 * @param method the object that represents method
209 * @return {@code true} if the method was declared
210 * to take a variable number of arguments;
211 * {@code false} otherwise
212 */
213 @Override
214 protected boolean isVarArgs(Method method) {
215 return method.isVarArgs();
216 }
217
218 /**
219 * Checks validness of the method.
220 * The valid method should be public and
221 * should have the specified name.
222 *
223 * @param method the object that represents method
224 * @return {@code true} if the method is valid,
225 * {@code false} otherwise
226 */
227 @Override
228 protected boolean isValid(Method method) {
229 return Modifier.isPublic(method.getModifiers()) && method.getName().equals(this.name);
230 }
231}
java/pkg/com/sun/beans/finder/PersistenceDelegateFinder.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/finder/PersistenceDelegateFinder.java+68−0
@@ -0,0 +1,68 @@
1/*
2 * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.finder;
26
27import java.beans.PersistenceDelegate;
28import java.util.HashMap;
29import java.util.Map;
30
31/**
32 * This is utility class that provides functionality
33 * to find a {@link PersistenceDelegate} for a JavaBean specified by its type.
34 *
35 * @since 1.7
36 *
37 * @author Sergey A. Malenkov
38 */
39public final class PersistenceDelegateFinder
40 extends InstanceFinder<PersistenceDelegate> {
41
42 private final Map<Class<?>, PersistenceDelegate> registry;
43
44 public PersistenceDelegateFinder() {
45 super(PersistenceDelegate.class, true, "PersistenceDelegate");
46 this.registry = new HashMap<Class<?>, PersistenceDelegate>();
47 }
48
49 public void register(Class<?> type, PersistenceDelegate delegate) {
50 synchronized (this.registry) {
51 if (delegate != null) {
52 this.registry.put(type, delegate);
53 }
54 else {
55 this.registry.remove(type);
56 }
57 }
58 }
59
60 @Override
61 public PersistenceDelegate find(Class<?> type) {
62 PersistenceDelegate delegate;
63 synchronized (this.registry) {
64 delegate = this.registry.get(type);
65 }
66 return (delegate != null) ? delegate : super.find(type);
67 }
68}
java/pkg/com/sun/beans/finder/PrimitiveTypeMap.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/finder/PrimitiveTypeMap.java+70−0
@@ -0,0 +1,70 @@
1/*
2 * Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.finder;
26
27import java.util.HashMap;
28import java.util.Map;
29
30/**
31 * This utility class associates
32 * name of primitive type with appropriate class.
33 *
34 * @since 1.7
35 *
36 * @author Sergey A. Malenkov
37 */
38final class PrimitiveTypeMap {
39
40 /**
41 * Returns primitive type class by its name.
42 *
43 * @param name the name of primitive type
44 * @return found primitive type class,
45 * or {@code null} if not found
46 */
47 static Class<?> getType(String name) {
48 return map.get(name);
49 }
50
51 private static final Map<String, Class<?>> map = new HashMap<String, Class<?>>(9);
52
53 static {
54 map.put(boolean.class.getName(), boolean.class);
55 map.put(char.class.getName(), char.class);
56 map.put(byte.class.getName(), byte.class);
57 map.put(short.class.getName(), short.class);
58 map.put(int.class.getName(), int.class);
59 map.put(long.class.getName(), long.class);
60 map.put(float.class.getName(), float.class);
61 map.put(double.class.getName(), double.class);
62 map.put(void.class.getName(), void.class);
63 }
64
65 /**
66 * Disable instantiation.
67 */
68 private PrimitiveTypeMap() {
69 }
70}
java/pkg/com/sun/beans/finder/PrimitiveWrapperMap.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/finder/PrimitiveWrapperMap.java+86−0
@@ -0,0 +1,86 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.finder;
26
27import java.util.HashMap;
28import java.util.Map;
29
30/**
31 * This utility class associates
32 * name of primitive type with appropriate wrapper.
33 *
34 * @since 1.7
35 *
36 * @author Sergey A. Malenkov
37 */
38public final class PrimitiveWrapperMap {
39
40 /**
41 * Replaces all primitive types in specified array with wrappers.
42 *
43 * @param types array of classes where all primitive types
44 * will be replaced by appropriate wrappers
45 */
46 static void replacePrimitivesWithWrappers(Class<?>[] types) {
47 for (int i = 0; i < types.length; i++) {
48 if (types[i] != null) {
49 if (types[i].isPrimitive()) {
50 types[i] = getType(types[i].getName());
51 }
52 }
53 }
54 }
55
56 /**
57 * Returns wrapper for primitive type by its name.
58 *
59 * @param name the name of primitive type
60 * @return found wrapper for primitive type,
61 * or {@code null} if not found
62 */
63 public static Class<?> getType(String name) {
64 return map.get(name);
65 }
66
67 private static final Map<String, Class<?>> map = new HashMap<String, Class<?>>(9);
68
69 static {
70 map.put(Boolean.TYPE.getName(), Boolean.class);
71 map.put(Character.TYPE.getName(), Character.class);
72 map.put(Byte.TYPE.getName(), Byte.class);
73 map.put(Short.TYPE.getName(), Short.class);
74 map.put(Integer.TYPE.getName(), Integer.class);
75 map.put(Long.TYPE.getName(), Long.class);
76 map.put(Float.TYPE.getName(), Float.class);
77 map.put(Double.TYPE.getName(), Double.class);
78 map.put(Void.TYPE.getName(), Void.class);
79 }
80
81 /**
82 * Disable instantiation.
83 */
84 private PrimitiveWrapperMap() {
85 }
86}
java/pkg/com/sun/beans/finder/PropertyEditorFinder.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/finder/PropertyEditorFinder.java+87−0
@@ -0,0 +1,87 @@
1/*
2 * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.finder;
26
27import com.sun.beans.WeakCache;
28
29import java.beans.PropertyEditor;
30
31import sun.beans.editors.BooleanEditor;
32import sun.beans.editors.ByteEditor;
33import sun.beans.editors.DoubleEditor;
34import sun.beans.editors.EnumEditor;
35import sun.beans.editors.FloatEditor;
36import sun.beans.editors.IntegerEditor;
37import sun.beans.editors.LongEditor;
38import sun.beans.editors.ShortEditor;
39
40/**
41 * This is utility class that provides functionality
42 * to find a {@link PropertyEditor} for a JavaBean specified by its type.
43 *
44 * @since 1.7
45 *
46 * @author Sergey A. Malenkov
47 */
48public final class PropertyEditorFinder
49 extends InstanceFinder<PropertyEditor> {
50
51 private final WeakCache<Class<?>, Class<?>> registry;
52
53 public PropertyEditorFinder() {
54 super(PropertyEditor.class, false, "Editor", "sun.beans.editors");
55
56 this.registry = new WeakCache<Class<?>, Class<?>>();
57 this.registry.put(Byte.TYPE, ByteEditor.class);
58 this.registry.put(Short.TYPE, ShortEditor.class);
59 this.registry.put(Integer.TYPE, IntegerEditor.class);
60 this.registry.put(Long.TYPE, LongEditor.class);
61 this.registry.put(Boolean.TYPE, BooleanEditor.class);
62 this.registry.put(Float.TYPE, FloatEditor.class);
63 this.registry.put(Double.TYPE, DoubleEditor.class);
64 }
65
66 public void register(Class<?> type, Class<?> editor) {
67 synchronized (this.registry) {
68 this.registry.put(type, editor);
69 }
70 }
71
72 @Override
73 public PropertyEditor find(Class<?> type) {
74 Class<?> predefined;
75 synchronized (this.registry) {
76 predefined = this.registry.get(type);
77 }
78 PropertyEditor editor = instantiate(predefined, null);
79 if (editor == null) {
80 editor = super.find(type);
81 if ((editor == null) && (null != type.getEnumConstants())) {
82 editor = new EnumEditor(type);
83 }
84 }
85 return editor;
86 }
87}
java/pkg/com/sun/beans/finder/Signature.class+0−0

Binary file not shown.

java/pkg/com/sun/beans/finder/Signature.java+169−0
@@ -0,0 +1,169 @@
1/*
2 * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package com.sun.beans.finder;
26
27/**
28 * This class is designed to be a key of a cache
29 * of constructors or methods.
30 *
31 * @since 1.7
32 *
33 * @author Sergey A. Malenkov
34 */
35final class Signature {
36 private final Class<?> type;
37 private final String name;
38 private final Class<?>[] args;
39
40 private volatile int code;
41
42 /**
43 * Constructs signature for constructor.
44 *
45 * @param type the class that contains constructor
46 * @param args the types of constructor's parameters
47 */
48 Signature(Class<?> type, Class<?>[] args) {
49 this(type, null, args);
50 }
51
52 /**
53 * Constructs signature for method.
54 *
55 * @param type the class that contains method
56 * @param name the name of the method
57 * @param args the types of method's parameters
58 */
59 Signature(Class<?> type, String name, Class<?>[] args) {
60 this.type = type;
61 this.name = name;
62 this.args = args;
63 }
64
65 /**
66 * Indicates whether some other object is "equal to" this one.
67 *
68 * @param object the reference object with which to compare
69 * @return {@code true} if this object is the same as the
70 * {@code object} argument, {@code false} otherwise
71 * @see #hashCode()
72 */
73 @Override
74 public boolean equals(Object object) {
75 if (this == object) {
76 return true;
77 }
78 if (object instanceof Signature) {
79 Signature signature = (Signature) object;
80 return isEqual(signature.type, this.type)
81 && isEqual(signature.name, this.name)
82 && isEqual(signature.args, this.args);
83 }
84 return false;
85 }
86
87 /**
88 * Indicates whether some object is "equal to" another one.
89 * This method supports {@code null} values.
90 *
91 * @param obj1 the first reference object that will compared
92 * @param obj2 the second reference object that will compared
93 * @return {@code true} if first object is the same as the second object,
94 * {@code false} otherwise
95 */
96 private static boolean isEqual(Object obj1, Object obj2) {
97 return (obj1 == null)
98 ? obj2 == null
99 : obj1.equals(obj2);
100 }
101
102 /**
103 * Indicates whether some array is "equal to" another one.
104 * This method supports {@code null} values.
105 *
106 * @param args1 the first reference array that will compared
107 * @param args2 the second reference array that will compared
108 * @return {@code true} if first array is the same as the second array,
109 * {@code false} otherwise
110 */
111 private static boolean isEqual(Class<?>[] args1, Class<?>[] args2) {
112 if ((args1 == null) || (args2 == null)) {
113 return args1 == args2;
114 }
115 if (args1.length != args2.length) {
116 return false;
117 }
118 for (int i = 0; i < args1.length; i++) {
119 if (!isEqual(args1[i], args2[i])) {
120 return false;
121 }
122 }
123 return true;
124 }
125
126 /**
127 * Returns a hash code value for the object.
128 * This method is supported for the benefit of hashtables
129 * such as {@link java.util.HashMap} or {@link java.util.HashSet}.
130 * Hash code computed using algorithm
131 * suggested in Effective Java, Item 8.
132 *
133 * @return a hash code value for this object
134 * @see #equals(Object)
135 */
136 @Override
137 public int hashCode() {
138 if (this.code == 0) {
139 int code = 17;
140 code = addHashCode(code, this.type);
141 code = addHashCode(code, this.name);
142
143 if (this.args != null) {
144 for (Class<?> arg : this.args) {
145 code = addHashCode(code, arg);
146 }
147 }
148 this.code = code;
149 }
150 return this.code;
151 }
152
153 /**
154 * Adds hash code value if specified object.
155 * This is a part of the algorithm
156 * suggested in Effective Java, Item 8.
157 *
158 * @param code current hash code value
159 * @param object object that updates hash code value
160 * @return updated hash code value
161 * @see #hashCode()
162 */
163 private static int addHashCode(int code, Object object) {
164 code *= 37;
165 return (object != null)
166 ? code + object.hashCode()
167 : code;
168 }
169}
java/pkg/com/sun/beans/finder/mkfile+19−0
@@ -0,0 +1,19 @@
1<../../../../../../mkconfig
2
3TARG=\
4 AbstractFinder.dis\
5 BeanInfoFinder.dis\
6 ClassFinder.dis\
7 ConstructorFinder.dis\
8 FieldFinder.dis\
9 InstanceFinder.dis\
10 MethodFinder.dis\
11 PersistenceDelegateFinder.dis\
12 PrimitiveTypeMap.dis\
13 PrimitiveWrapperMap.dis\
14 PropertyEditorFinder.dis\
15 Signature.dis\
16
17DISBIN=$ROOT/java/dis/java/java/com/sun/beans/finder
18
19<$ROOT/mkfiles/mkjava
java/pkg/com/sun/beans/mkfile+15−0
@@ -0,0 +1,15 @@
1<../../../../../mkconfig
2
3DIRS=\
4 decoder\
5 finder\
6
7TARG=\
8 TypeResolver.dis\
9 WeakCache.dis\
10 WildcardTypeImpl.dis\
11
12DISBIN=$ROOT/java/dis/java/java/com/sun/beans
13
14<$ROOT/mkfiles/mkjava
15<$ROOT/mkfiles/mksubdirs
java/pkg/com/sun/crypto/mkfile+6−0
@@ -0,0 +1,6 @@
1<../../../../../mkconfig
2
3DIRS=\
4 provider\
5
6<$ROOT/mkfiles/mksubdirs
java/pkg/com/sun/crypto/provider/AESCipher.java+427−0
@@ -0,0 +1,427 @@
1/*
2 * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26package com.sun.crypto.provider;
27
28import java.security.*;
29import java.security.spec.*;
30import javax.crypto.*;
31import javax.crypto.spec.*;
32import javax.crypto.BadPaddingException;
33
34/**
35 * This class implements the AES algorithm in its various modes
36 * (<code>ECB</code>, <code>CFB</code>, <code>OFB</code>, <code>CBC</code>,
37 * <code>PCBC</code>) and padding schemes (<code>PKCS5Padding</code>,
38 * <code>NoPadding</code>, <code>ISO10126Padding</code>).
39 *
40 * @author Valerie Peng
41 *
42 *
43 * @see AESCrypt
44 * @see CipherBlockChaining
45 * @see ElectronicCodeBook
46 * @see CipherFeedback
47 * @see OutputFeedback
48 */
49
50public final class AESCipher extends CipherSpi {
51 /*
52 * internal CipherCore object which does the real work.
53 */
54 private CipherCore core = null;
55
56 /**
57 * Creates an instance of AES cipher with default ECB mode and
58 * PKCS5Padding.
59 */
60 public AESCipher() {
61 core = new CipherCore(new AESCrypt(), AESConstants.AES_BLOCK_SIZE);
62 }
63
64 /**
65 * Sets the mode of this cipher.
66 *
67 * @param mode the cipher mode
68 *
69 * @exception NoSuchAlgorithmException if the requested cipher mode does
70 * not exist
71 */
72 protected void engineSetMode(String mode)
73 throws NoSuchAlgorithmException {
74 core.setMode(mode);
75 }
76
77 /**
78 * Sets the padding mechanism of this cipher.
79 *
80 * @param padding the padding mechanism
81 *
82 * @exception NoSuchPaddingException if the requested padding mechanism
83 * does not exist
84 */
85 protected void engineSetPadding(String paddingScheme)
86 throws NoSuchPaddingException {
87 core.setPadding(paddingScheme);
88 }
89
90 /**
91 * Returns the block size (in bytes).
92 *
93 * @return the block size (in bytes), or 0 if the underlying algorithm is
94 * not a block cipher
95 */
96 protected int engineGetBlockSize() {
97 return AESConstants.AES_BLOCK_SIZE;
98 }
99
100 /**
101 * Returns the length in bytes that an output buffer would need to be in
102 * order to hold the result of the next <code>update</code> or
103 * <code>doFinal</code> operation, given the input length
104 * <code>inputLen</code> (in bytes).
105 *
106 * <p>This call takes into account any unprocessed (buffered) data from a
107 * previous <code>update</code> call, and padding.
108 *
109 * <p>The actual output length of the next <code>update</code> or
110 * <code>doFinal</code> call may be smaller than the length returned by
111 * this method.
112 *
113 * @param inputLen the input length (in bytes)
114 *
115 * @return the required output buffer size (in bytes)
116 */
117 protected int engineGetOutputSize(int inputLen) {
118 return core.getOutputSize(inputLen);
119 }
120
121 /**
122 * Returns the initialization vector (IV) in a new buffer.
123 *
124 * <p>This is useful in the case where a random IV has been created
125 * (see <a href = "#init">init</a>),
126 * or in the context of password-based encryption or
127 * decryption, where the IV is derived from a user-provided password.
128 *
129 * @return the initialization vector in a new buffer, or null if the
130 * underlying algorithm does not use an IV, or if the IV has not yet
131 * been set.
132 */
133 protected byte[] engineGetIV() {
134 return core.getIV();
135 }
136
137 /**
138 * Returns the parameters used with this cipher.
139 *
140 * <p>The returned parameters may be the same that were used to initialize
141 * this cipher, or may contain the default set of parameters or a set of
142 * randomly generated parameters used by the underlying cipher
143 * implementation (provided that the underlying cipher implementation
144 * uses a default set of parameters or creates new parameters if it needs
145 * parameters but was not initialized with any).
146 *
147 * @return the parameters used with this cipher, or null if this cipher
148 * does not use any parameters.
149 */
150 protected AlgorithmParameters engineGetParameters() {
151 return core.getParameters("AES");
152 }
153
154 /**
155 * Initializes this cipher with a key and a source of randomness.
156 *
157 * <p>The cipher is initialized for one of the following four operations:
158 * encryption, decryption, key wrapping or key unwrapping, depending on
159 * the value of <code>opmode</code>.
160 *
161 * <p>If this cipher requires an initialization vector (IV), it will get
162 * it from <code>random</code>.
163 * This behaviour should only be used in encryption or key wrapping
164 * mode, however.
165 * When initializing a cipher that requires an IV for decryption or
166 * key unwrapping, the IV
167 * (same IV that was used for encryption or key wrapping) must be provided
168 * explicitly as a
169 * parameter, in order to get the correct result.
170 *
171 * <p>This method also cleans existing buffer and other related state
172 * information.
173 *
174 * @param opmode the operation mode of this cipher (this is one of
175 * the following:
176 * <code>ENCRYPT_MODE</code>, <code>DECRYPT_MODE</code>,
177 * <code>WRAP_MODE</code> or <code>UNWRAP_MODE</code>)
178 * @param key the secret key
179 * @param random the source of randomness
180 *
181 * @exception InvalidKeyException if the given key is inappropriate for
182 * initializing this cipher
183 */
184 protected void engineInit(int opmode, Key key, SecureRandom random)
185 throws InvalidKeyException {
186 core.init(opmode, key, random);
187 }
188
189 /**
190 * Initializes this cipher with a key, a set of
191 * algorithm parameters, and a source of randomness.
192 *
193 * <p>The cipher is initialized for one of the following four operations:
194 * encryption, decryption, key wrapping or key unwrapping, depending on
195 * the value of <code>opmode</code>.
196 *
197 * <p>If this cipher (including its underlying feedback or padding scheme)
198 * requires any random bytes, it will get them from <code>random</code>.
199 *
200 * @param opmode the operation mode of this cipher (this is one of
201 * the following:
202 * <code>ENCRYPT_MODE</code>, <code>DECRYPT_MODE</code>,
203 * <code>WRAP_MODE</code> or <code>UNWRAP_MODE</code>)
204 * @param key the encryption key
205 * @param params the algorithm parameters
206 * @param random the source of randomness
207 *
208 * @exception InvalidKeyException if the given key is inappropriate for
209 * initializing this cipher
210 * @exception InvalidAlgorithmParameterException if the given algorithm
211 * parameters are inappropriate for this cipher
212 */
213 protected void engineInit(int opmode, Key key,
214 AlgorithmParameterSpec params,
215 SecureRandom random)
216 throws InvalidKeyException, InvalidAlgorithmParameterException {
217 core.init(opmode, key, params, random);
218 }
219
220 protected void engineInit(int opmode, Key key,
221 AlgorithmParameters params,
222 SecureRandom random)
223 throws InvalidKeyException, InvalidAlgorithmParameterException {
224 core.init(opmode, key, params, random);
225 }
226
227 /**
228 * Continues a multiple-part encryption or decryption operation
229 * (depending on how this cipher was initialized), processing another data
230 * part.
231 *
232 * <p>The first <code>inputLen</code> bytes in the <code>input</code>
233 * buffer, starting at <code>inputOffset</code>, are processed, and the
234 * result is stored in a new buffer.
235 *
236 * @param input the input buffer
237 * @param inputOffset the offset in <code>input</code> where the input
238 * starts
239 * @param inputLen the input length
240 *
241 * @return the new buffer with the result
242 *
243 * @exception IllegalStateException if this cipher is in a wrong state
244 * (e.g., has not been initialized)
245 */
246 protected byte[] engineUpdate(byte[] input, int inputOffset,
247 int inputLen) {
248 return core.update(input, inputOffset, inputLen);
249 }
250
251 /**
252 * Continues a multiple-part encryption or decryption operation
253 * (depending on how this cipher was initialized), processing another data
254 * part.
255 *
256 * <p>The first <code>inputLen</code> bytes in the <code>input</code>
257 * buffer, starting at <code>inputOffset</code>, are processed, and the
258 * result is stored in the <code>output</code> buffer, starting at
259 * <code>outputOffset</code>.
260 *
261 * @param input the input buffer
262 * @param inputOffset the offset in <code>input</code> where the input
263 * starts
264 * @param inputLen the input length
265 * @param output the buffer for the result
266 * @param outputOffset the offset in <code>output</code> where the result
267 * is stored
268 *
269 * @return the number of bytes stored in <code>output</code>
270 *
271 * @exception ShortBufferException if the given output buffer is too small
272 * to hold the result
273 */
274 protected int engineUpdate(byte[] input, int inputOffset, int inputLen,
275 byte[] output, int outputOffset)
276 throws ShortBufferException {
277 return core.update(input, inputOffset, inputLen, output,
278 outputOffset);
279 }
280
281 /**
282 * Encrypts or decrypts data in a single-part operation,
283 * or finishes a multiple-part operation.
284 * The data is encrypted or decrypted, depending on how this cipher was
285 * initialized.
286 *
287 * <p>The first <code>inputLen</code> bytes in the <code>input</code>
288 * buffer, starting at <code>inputOffset</code>, and any input bytes that
289 * may have been buffered during a previous <code>update</code> operation,
290 * are processed, with padding (if requested) being applied.
291 * The result is stored in a new buffer.
292 *
293 * <p>The cipher is reset to its initial state (uninitialized) after this
294 * call.
295 *
296 * @param input the input buffer
297 * @param inputOffset the offset in <code>input</code> where the input
298 * starts
299 * @param inputLen the input length
300 *
301 * @return the new buffer with the result
302 *
303 * @exception IllegalBlockSizeException if this cipher is a block cipher,
304 * no padding has been requested (only in encryption mode), and the total
305 * input length of the data processed by this cipher is not a multiple of
306 * block size
307 * @exception BadPaddingException if this cipher is in decryption mode,
308 * and (un)padding has been requested, but the decrypted data is not
309 * bounded by the appropriate padding bytes
310 */
311 protected byte[] engineDoFinal(byte[] input, int inputOffset, int inputLen)
312 throws IllegalBlockSizeException, BadPaddingException {
313 return core.doFinal(input, inputOffset, inputLen);
314 }
315
316 /**
317 * Encrypts or decrypts data in a single-part operation,
318 * or finishes a multiple-part operation.
319 * The data is encrypted or decrypted, depending on how this cipher was
320 * initialized.
321 *
322 * <p>The first <code>inputLen</code> bytes in the <code>input</code>
323 * buffer, starting at <code>inputOffset</code>, and any input bytes that
324 * may have been buffered during a previous <code>update</code> operation,
325 * are processed, with padding (if requested) being applied.
326 * The result is stored in the <code>output</code> buffer, starting at
327 * <code>outputOffset</code>.
328 *
329 * <p>The cipher is reset to its initial state (uninitialized) after this
330 * call.
331 *
332 * @param input the input buffer
333 * @param inputOffset the offset in <code>input</code> where the input
334 * starts
335 * @param inputLen the input length
336 * @param output the buffer for the result
337 * @param outputOffset the offset in <code>output</code> where the result
338 * is stored
339 *
340 * @return the number of bytes stored in <code>output</code>
341 *
342 * @exception IllegalBlockSizeException if this cipher is a block cipher,
343 * no padding has been requested (only in encryption mode), and the total
344 * input length of the data processed by this cipher is not a multiple of
345 * block size
346 * @exception ShortBufferException if the given output buffer is too small
347 * to hold the result
348 * @exception BadPaddingException if this cipher is in decryption mode,
349 * and (un)padding has been requested, but the decrypted data is not
350 * bounded by the appropriate padding bytes
351 */
352 protected int engineDoFinal(byte[] input, int inputOffset, int inputLen,
353 byte[] output, int outputOffset)
354 throws IllegalBlockSizeException, ShortBufferException,
355 BadPaddingException {
356 return core.doFinal(input, inputOffset, inputLen, output,
357 outputOffset);
358 }
359
360 /**
361 * Returns the key size of the given key object.
362 *
363 * @param key the key object.
364 *
365 * @return the key size of the given key object.
366 *
367 * @exception InvalidKeyException if <code>key</code> is invalid.
368 */
369 protected int engineGetKeySize(Key key) throws InvalidKeyException {
370 byte[] encoded = key.getEncoded();
371 if (!AESCrypt.isKeySizeValid(encoded.length)) {
372 throw new InvalidKeyException("Invalid AES key length: " +
373 encoded.length + " bytes");
374 }
375 return encoded.length * 8;
376 }
377
378 /**
379 * Wrap a key.
380 *
381 * @param key the key to be wrapped.
382 *
383 * @return the wrapped key.
384 *
385 * @exception IllegalBlockSizeException if this cipher is a block
386 * cipher, no padding has been requested, and the length of the
387 * encoding of the key to be wrapped is not a
388 * multiple of the block size.
389 *
390 * @exception InvalidKeyException if it is impossible or unsafe to
391 * wrap the key with this cipher (e.g., a hardware protected key is
392 * being passed to a software only cipher).
393 */
394 protected byte[] engineWrap(Key key)
395 throws IllegalBlockSizeException, InvalidKeyException {
396 return core.wrap(key);
397 }
398
399 /**
400 * Unwrap a previously wrapped key.
401 *
402 * @param wrappedKey the key to be unwrapped.
403 *
404 * @param wrappedKeyAlgorithm the algorithm the wrapped key is for.
405 *
406 * @param wrappedKeyType the type of the wrapped key.
407 * This is one of <code>Cipher.SECRET_KEY</code>,
408 * <code>Cipher.PRIVATE_KEY</code>, or <code>Cipher.PUBLIC_KEY</code>.
409 *
410 * @return the unwrapped key.
411 *
412 * @exception NoSuchAlgorithmException if no installed providers
413 * can create keys of type <code>wrappedKeyType</code> for the
414 * <code>wrappedKeyAlgorithm</code>.
415 *
416 * @exception InvalidKeyException if <code>wrappedKey</code> does not
417 * represent a wrapped key of type <code>wrappedKeyType</code> for
418 * the <code>wrappedKeyAlgorithm</code>.
419 */
420 protected Key engineUnwrap(byte[] wrappedKey,
421 String wrappedKeyAlgorithm,
422 int wrappedKeyType)
423 throws InvalidKeyException, NoSuchAlgorithmException {
424 return core.unwrap(wrappedKey, wrappedKeyAlgorithm,
425 wrappedKeyType);
426 }
427}
java/pkg/com/sun/crypto/provider/AESConstants.java+46−0
@@ -0,0 +1,46 @@
1/*
2 * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26package com.sun.crypto.provider;
27
28/**
29 * This class defines the constants used by the AES implementation.
30 *
31 * @author Valerie Peng
32 *
33 *
34 * @see AESCipher
35 */
36
37interface AESConstants {
38
39 // AES block size in bytes.
40 int AES_BLOCK_SIZE = 16;
41
42 // Valid AES key sizes in bytes.
43 // NOTE: The values need to be listed in an *increasing* order
44 // since DHKeyAgreement depends on this fact.
45 int[] AES_KEYSIZES = { 16, 24, 32 };
46}
java/pkg/com/sun/crypto/provider/AESCrypt.java+659−0
@@ -0,0 +1,659 @@
1/*
2 * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26/* $Id: Rijndael.java,v 1.6 2000/02/10 01:31:41 gelderen Exp $
27 *
28 * Copyright (C) 1995-2000 The Cryptix Foundation Limited.
29 * All rights reserved.
30 *
31 * Use, modification, copying and distribution of this softwareas is subject
32 * the terms and conditions of the Cryptix General Licence. You should have
33 * received a copy of the Cryptix General Licence along with this library;
34 * if not, you can download a copy from http://www.cryptix.org/ .
35 */
36
37package com.sun.crypto.provider;
38
39import java.security.InvalidKeyException;
40
41/**
42 * Rijndael --pronounced Reindaal-- is a symmetric cipher with a 128-bit
43 * block size and variable key-size (128-, 192- and 256-bit).
44 * <p>
45 * Rijndael was designed by <a href="mailto:rijmen@esat.kuleuven.ac.be">Vincent
46 * Rijmen</a> and <a href="mailto:Joan.Daemen@village.uunet.be">Joan Daemen</a>.
47 */
48final class AESCrypt extends SymmetricCipher implements AESConstants
49{
50 private boolean ROUNDS_12 = false;
51 private boolean ROUNDS_14 = false;
52
53 /** Session and Sub keys */
54 private Object[] sessionK = null;
55 private int[] K = null;
56
57 /** (ROUNDS-1) * 4 */
58 private int limit = 0;
59
60 AESCrypt() {
61 // empty
62 }
63
64 /**
65 * Returns this cipher's block size.
66 *
67 * @return this cipher's block size
68 */
69 int getBlockSize() {
70 return AES_BLOCK_SIZE;
71 }
72
73 void init(boolean decrypting, String algorithm, byte[] key)
74 throws InvalidKeyException {
75 if (!algorithm.equalsIgnoreCase("AES")
76 && !algorithm.equalsIgnoreCase("Rijndael")) {
77 throw new InvalidKeyException
78 ("Wrong algorithm: AES or Rijndael required");
79 }
80 if (!isKeySizeValid(key.length)) {
81 throw new InvalidKeyException("Invalid AES key length: " +
82 key.length + " bytes");
83 }
84
85 // generate session key and reset sub key.
86 sessionK = makeKey(key);
87 setSubKey(decrypting);
88 }
89
90 private void setSubKey(boolean decrypting) {
91 int[][] Kd = (int[][]) sessionK[decrypting ? 1 : 0];
92 int rounds = Kd.length;
93 this.K = new int[rounds*4];
94 for(int i=0; i<rounds; i++) {
95 for(int j=0; j<4; j++) {
96 K[i*4 + j] = Kd[i][j];
97 }
98 }
99
100 if (decrypting) {
101 int j0 = K[K.length-4];
102 int j1 = K[K.length-3];
103 int j2 = K[K.length-2];
104 int j3 = K[K.length-1];
105
106 for (int i=this.K.length-1; i>3; i--) {
107 this.K[i] = this.K[i-4];
108 }
109 K[0] = j0;
110 K[1] = j1;
111 K[2] = j2;
112 K[3] = j3;
113 }
114
115 ROUNDS_12 = (rounds>=13);
116 ROUNDS_14 = (rounds==15);
117
118 rounds--;
119 limit=rounds*4;
120 }
121
122 private static int[]
123 alog = new int[256],
124 log = new int[256];
125
126 private static final byte[]
127 S = new byte[256],
128 Si = new byte[256];
129
130 private static final int[]
131 T1 = new int[256],
132 T2 = new int[256],
133 T3 = new int[256],
134 T4 = new int[256],
135 T5 = new int[256],
136 T6 = new int[256],
137 T7 = new int[256],
138 T8 = new int[256];
139
140 private static final int[]
141 U1 = new int[256],
142 U2 = new int[256],
143 U3 = new int[256],
144 U4 = new int[256];
145
146 private static final byte[] rcon = new byte[30];
147
148
149 // Static code - to intialise S-boxes and T-boxes
150 static
151 {
152 int ROOT = 0x11B;
153 int i, j = 0;
154
155 //
156 // produce log and alog tables, needed for multiplying in the
157 // field GF(2^m) (generator = 3)
158 //
159 alog[0] = 1;
160 for (i = 1; i < 256; i++)
161 {
162 j = (alog[i-1] << 1) ^ alog[i-1];
163 if ((j & 0x100) != 0) {
164 j ^= ROOT;
165 }
166 alog[i] = j;
167 }
168 for (i = 1; i < 255; i++) {
169 log[alog[i]] = i;
170 }
171 byte[][] A = new byte[][]
172 {
173 {1, 1, 1, 1, 1, 0, 0, 0},
174 {0, 1, 1, 1, 1, 1, 0, 0},
175 {0, 0, 1, 1, 1, 1, 1, 0},
176 {0, 0, 0, 1, 1, 1, 1, 1},
177 {1, 0, 0, 0, 1, 1, 1, 1},
178 {1, 1, 0, 0, 0, 1, 1, 1},
179 {1, 1, 1, 0, 0, 0, 1, 1},
180 {1, 1, 1, 1, 0, 0, 0, 1}
181 };
182 byte[] B = new byte[] { 0, 1, 1, 0, 0, 0, 1, 1};
183
184 //
185 // substitution box based on F^{-1}(x)
186 //
187 int t;
188 byte[][] box = new byte[256][8];
189 box[1][7] = 1;
190 for (i = 2; i < 256; i++) {
191 j = alog[255 - log[i]];
192 for (t = 0; t < 8; t++) {
193 box[i][t] = (byte)((j >>> (7 - t)) & 0x01);
194 }
195 }
196 //
197 // affine transform: box[i] <- B + A*box[i]
198 //
199 byte[][] cox = new byte[256][8];
200 for (i = 0; i < 256; i++) {
201 for (t = 0; t < 8; t++) {
202 cox[i][t] = B[t];
203 for (j = 0; j < 8; j++) {
204 cox[i][t] ^= A[t][j] * box[i][j];
205 }
206 }
207 }
208 //
209 // S-boxes and inverse S-boxes
210 //
211 for (i = 0; i < 256; i++) {
212 S[i] = (byte)(cox[i][0] << 7);
213 for (t = 1; t < 8; t++) {
214 S[i] ^= cox[i][t] << (7-t);
215 }
216 Si[S[i] & 0xFF] = (byte) i;
217 }
218 //
219 // T-boxes
220 //
221 byte[][] G = new byte[][] {
222 {2, 1, 1, 3},
223 {3, 2, 1, 1},
224 {1, 3, 2, 1},
225 {1, 1, 3, 2}
226 };
227 byte[][] AA = new byte[4][8];
228 for (i = 0; i < 4; i++) {
229 for (j = 0; j < 4; j++) AA[i][j] = G[i][j];
230 AA[i][i+4] = 1;
231 }
232 byte pivot, tmp;
233 byte[][] iG = new byte[4][4];
234 for (i = 0; i < 4; i++) {
235 pivot = AA[i][i];
236 if (pivot == 0) {
237 t = i + 1;
238 while ((AA[t][i] == 0) && (t < 4)) {
239 t++;
240 }
241 if (t == 4) {
242 throw new RuntimeException("G matrix is not invertible");
243 }
244 else {
245 for (j = 0; j < 8; j++) {
246 tmp = AA[i][j];
247 AA[i][j] = AA[t][j];
248 AA[t][j] = (byte) tmp;
249 }
250 pivot = AA[i][i];
251 }
252 }
253 for (j = 0; j < 8; j++) {
254 if (AA[i][j] != 0) {
255 AA[i][j] = (byte)
256 alog[(255 + log[AA[i][j] & 0xFF] - log[pivot & 0xFF])
257 % 255];
258 }
259 }
260 for (t = 0; t < 4; t++) {
261 if (i != t) {
262 for (j = i+1; j < 8; j++) {
263 AA[t][j] ^= mul(AA[i][j], AA[t][i]);
264 }
265 AA[t][i] = 0;
266 }
267 }
268 }
269 for (i = 0; i < 4; i++) {
270 for (j = 0; j < 4; j++) {
271 iG[i][j] = AA[i][j + 4];
272 }
273 }
274
275 int s;
276 for (t = 0; t < 256; t++) {
277 s = S[t];
278 T1[t] = mul4(s, G[0]);
279 T2[t] = mul4(s, G[1]);
280 T3[t] = mul4(s, G[2]);
281 T4[t] = mul4(s, G[3]);
282
283 s = Si[t];
284 T5[t] = mul4(s, iG[0]);
285 T6[t] = mul4(s, iG[1]);
286 T7[t] = mul4(s, iG[2]);
287 T8[t] = mul4(s, iG[3]);
288
289 U1[t] = mul4(t, iG[0]);
290 U2[t] = mul4(t, iG[1]);
291 U3[t] = mul4(t, iG[2]);
292 U4[t] = mul4(t, iG[3]);
293 }
294 //
295 // round constants
296 //
297 rcon[0] = 1;
298 int r = 1;
299 for (t = 1; t < 30; t++) {
300 r = mul(2, r);
301 rcon[t] = (byte) r;
302 }
303 log = null;
304 alog = null;
305 }
306
307 // multiply two elements of GF(2^m)
308 private static final int mul (int a, int b) {
309 return (a != 0 && b != 0) ?
310 alog[(log[a & 0xFF] + log[b & 0xFF]) % 255] :
311 0;
312 }
313
314 // convenience method used in generating Transposition boxes
315 private static final int mul4 (int a, byte[] b) {
316 if (a == 0) return 0;
317 a = log[a & 0xFF];
318 int a0 = (b[0] != 0) ? alog[(a + log[b[0] & 0xFF]) % 255] & 0xFF : 0;
319 int a1 = (b[1] != 0) ? alog[(a + log[b[1] & 0xFF]) % 255] & 0xFF : 0;
320 int a2 = (b[2] != 0) ? alog[(a + log[b[2] & 0xFF]) % 255] & 0xFF : 0;
321 int a3 = (b[3] != 0) ? alog[(a + log[b[3] & 0xFF]) % 255] & 0xFF : 0;
322 return a0 << 24 | a1 << 16 | a2 << 8 | a3;
323 }
324
325 // check if the specified length (in bytes) is a valid keysize for AES
326 static final boolean isKeySizeValid(int len) {
327 for (int i = 0; i < AES_KEYSIZES.length; i++) {
328 if (len == AES_KEYSIZES[i]) {
329 return true;
330 }
331 }
332 return false;
333 }
334
335 /**
336 * Encrypt exactly one block of plaintext.
337 */
338 void encryptBlock(byte[] in, int inOffset,
339 byte[] out, int outOffset)
340 {
341 int keyOffset = 0;
342 int t0 = ((in[inOffset++] ) << 24 |
343 (in[inOffset++] & 0xFF) << 16 |
344 (in[inOffset++] & 0xFF) << 8 |
345 (in[inOffset++] & 0xFF) ) ^ K[keyOffset++];
346 int t1 = ((in[inOffset++] ) << 24 |
347 (in[inOffset++] & 0xFF) << 16 |
348 (in[inOffset++] & 0xFF) << 8 |
349 (in[inOffset++] & 0xFF) ) ^ K[keyOffset++];
350 int t2 = ((in[inOffset++] ) << 24 |
351 (in[inOffset++] & 0xFF) << 16 |
352 (in[inOffset++] & 0xFF) << 8 |
353 (in[inOffset++] & 0xFF) ) ^ K[keyOffset++];
354 int t3 = ((in[inOffset++] ) << 24 |
355 (in[inOffset++] & 0xFF) << 16 |
356 (in[inOffset++] & 0xFF) << 8 |
357 (in[inOffset++] & 0xFF) ) ^ K[keyOffset++];
358
359 // apply round transforms
360 while( keyOffset < limit )
361 {
362 int a0, a1, a2;
363 a0 = T1[(t0 >>> 24) ] ^
364 T2[(t1 >>> 16) & 0xFF] ^
365 T3[(t2 >>> 8) & 0xFF] ^
366 T4[(t3 ) & 0xFF] ^ K[keyOffset++];
367 a1 = T1[(t1 >>> 24) ] ^
368 T2[(t2 >>> 16) & 0xFF] ^
369 T3[(t3 >>> 8) & 0xFF] ^
370 T4[(t0 ) & 0xFF] ^ K[keyOffset++];
371 a2 = T1[(t2 >>> 24) ] ^
372 T2[(t3 >>> 16) & 0xFF] ^
373 T3[(t0 >>> 8) & 0xFF] ^
374 T4[(t1 ) & 0xFF] ^ K[keyOffset++];
375 t3 = T1[(t3 >>> 24) ] ^
376 T2[(t0 >>> 16) & 0xFF] ^
377 T3[(t1 >>> 8) & 0xFF] ^
378 T4[(t2 ) & 0xFF] ^ K[keyOffset++];
379 t0 = a0; t1 = a1; t2 = a2;
380 }
381
382 // last round is special
383 int tt = K[keyOffset++];
384 out[outOffset++] = (byte)(S[(t0 >>> 24) ] ^ (tt >>> 24));
385 out[outOffset++] = (byte)(S[(t1 >>> 16) & 0xFF] ^ (tt >>> 16));
386 out[outOffset++] = (byte)(S[(t2 >>> 8) & 0xFF] ^ (tt >>> 8));
387 out[outOffset++] = (byte)(S[(t3 ) & 0xFF] ^ (tt ));
388 tt = K[keyOffset++];
389 out[outOffset++] = (byte)(S[(t1 >>> 24) ] ^ (tt >>> 24));
390 out[outOffset++] = (byte)(S[(t2 >>> 16) & 0xFF] ^ (tt >>> 16));
391 out[outOffset++] = (byte)(S[(t3 >>> 8) & 0xFF] ^ (tt >>> 8));
392 out[outOffset++] = (byte)(S[(t0 ) & 0xFF] ^ (tt ));
393 tt = K[keyOffset++];
394 out[outOffset++] = (byte)(S[(t2 >>> 24) ] ^ (tt >>> 24));
395 out[outOffset++] = (byte)(S[(t3 >>> 16) & 0xFF] ^ (tt >>> 16));
396 out[outOffset++] = (byte)(S[(t0 >>> 8) & 0xFF] ^ (tt >>> 8));
397 out[outOffset++] = (byte)(S[(t1 ) & 0xFF] ^ (tt ));
398 tt = K[keyOffset++];
399 out[outOffset++] = (byte)(S[(t3 >>> 24) ] ^ (tt >>> 24));
400 out[outOffset++] = (byte)(S[(t0 >>> 16) & 0xFF] ^ (tt >>> 16));
401 out[outOffset++] = (byte)(S[(t1 >>> 8) & 0xFF] ^ (tt >>> 8));
402 out[outOffset ] = (byte)(S[(t2 ) & 0xFF] ^ (tt ));
403 }
404
405
406 /**
407 * Decrypt exactly one block of plaintext.
408 */
409 void decryptBlock(byte[] in, int inOffset,
410 byte[] out, int outOffset)
411 {
412 int keyOffset = 4;
413 int t0 = ((in[inOffset++] ) << 24 |
414 (in[inOffset++] & 0xFF) << 16 |
415 (in[inOffset++] & 0xFF) << 8 |
416 (in[inOffset++] & 0xFF) ) ^ K[keyOffset++];
417 int t1 = ((in[inOffset++] ) << 24 |
418 (in[inOffset++] & 0xFF) << 16 |
419 (in[inOffset++] & 0xFF) << 8 |
420 (in[inOffset++] & 0xFF) ) ^ K[keyOffset++];
421 int t2 = ((in[inOffset++] ) << 24 |
422 (in[inOffset++] & 0xFF) << 16 |
423 (in[inOffset++] & 0xFF) << 8 |
424 (in[inOffset++] & 0xFF) ) ^ K[keyOffset++];
425 int t3 = ((in[inOffset++] ) << 24 |
426 (in[inOffset++] & 0xFF) << 16 |
427 (in[inOffset++] & 0xFF) << 8 |
428 (in[inOffset ] & 0xFF) ) ^ K[keyOffset++];
429
430 int a0, a1, a2;
431 if(ROUNDS_12)
432 {
433 a0 = T5[(t0>>>24) ] ^ T6[(t3>>>16)&0xFF] ^
434 T7[(t2>>> 8)&0xFF] ^ T8[(t1 )&0xFF] ^ K[keyOffset++];
435 a1 = T5[(t1>>>24) ] ^ T6[(t0>>>16)&0xFF] ^
436 T7[(t3>>> 8)&0xFF] ^ T8[(t2 )&0xFF] ^ K[keyOffset++];
437 a2 = T5[(t2>>>24) ] ^ T6[(t1>>>16)&0xFF] ^
438 T7[(t0>>> 8)&0xFF] ^ T8[(t3 )&0xFF] ^ K[keyOffset++];
439 t3 = T5[(t3>>>24) ] ^ T6[(t2>>>16)&0xFF] ^
440 T7[(t1>>> 8)&0xFF] ^ T8[(t0 )&0xFF] ^ K[keyOffset++];
441 t0 = T5[(a0>>>24) ] ^ T6[(t3>>>16)&0xFF] ^
442 T7[(a2>>> 8)&0xFF] ^ T8[(a1 )&0xFF] ^ K[keyOffset++];
443 t1 = T5[(a1>>>24) ] ^ T6[(a0>>>16)&0xFF] ^
444 T7[(t3>>> 8)&0xFF] ^ T8[(a2 )&0xFF] ^ K[keyOffset++];
445 t2 = T5[(a2>>>24) ] ^ T6[(a1>>>16)&0xFF] ^
446 T7[(a0>>> 8)&0xFF] ^ T8[(t3 )&0xFF] ^ K[keyOffset++];
447 t3 = T5[(t3>>>24) ] ^ T6[(a2>>>16)&0xFF] ^
448 T7[(a1>>> 8)&0xFF] ^ T8[(a0 )&0xFF] ^ K[keyOffset++];
449
450 if(ROUNDS_14)
451 {
452 a0 = T5[(t0>>>24) ] ^ T6[(t3>>>16)&0xFF] ^
453 T7[(t2>>> 8)&0xFF] ^ T8[(t1 )&0xFF] ^ K[keyOffset++];
454 a1 = T5[(t1>>>24) ] ^ T6[(t0>>>16)&0xFF] ^
455 T7[(t3>>> 8)&0xFF] ^ T8[(t2 )&0xFF] ^ K[keyOffset++];
456 a2 = T5[(t2>>>24) ] ^ T6[(t1>>>16)&0xFF] ^
457 T7[(t0>>> 8)&0xFF] ^ T8[(t3 )&0xFF] ^ K[keyOffset++];
458 t3 = T5[(t3>>>24) ] ^ T6[(t2>>>16)&0xFF] ^
459 T7[(t1>>> 8)&0xFF] ^ T8[(t0 )&0xFF] ^ K[keyOffset++];
460 t0 = T5[(a0>>>24) ] ^ T6[(t3>>>16)&0xFF] ^
461 T7[(a2>>> 8)&0xFF] ^ T8[(a1 )&0xFF] ^ K[keyOffset++];
462 t1 = T5[(a1>>>24) ] ^ T6[(a0>>>16)&0xFF] ^
463 T7[(t3>>> 8)&0xFF] ^ T8[(a2 )&0xFF] ^ K[keyOffset++];
464 t2 = T5[(a2>>>24) ] ^ T6[(a1>>>16)&0xFF] ^
465 T7[(a0>>> 8)&0xFF] ^ T8[(t3 )&0xFF] ^ K[keyOffset++];
466 t3 = T5[(t3>>>24) ] ^ T6[(a2>>>16)&0xFF] ^
467 T7[(a1>>> 8)&0xFF] ^ T8[(a0 )&0xFF] ^ K[keyOffset++];
468 }
469 }
470 a0 = T5[(t0>>>24) ] ^ T6[(t3>>>16)&0xFF] ^
471 T7[(t2>>> 8)&0xFF] ^ T8[(t1 )&0xFF] ^ K[keyOffset++];
472 a1 = T5[(t1>>>24) ] ^ T6[(t0>>>16)&0xFF] ^
473 T7[(t3>>> 8)&0xFF] ^ T8[(t2 )&0xFF] ^ K[keyOffset++];
474 a2 = T5[(t2>>>24) ] ^ T6[(t1>>>16)&0xFF] ^
475 T7[(t0>>> 8)&0xFF] ^ T8[(t3 )&0xFF] ^ K[keyOffset++];
476 t3 = T5[(t3>>>24) ] ^ T6[(t2>>>16)&0xFF] ^
477 T7[(t1>>> 8)&0xFF] ^ T8[(t0 )&0xFF] ^ K[keyOffset++];
478 t0 = T5[(a0>>>24) ] ^ T6[(t3>>>16)&0xFF] ^
479 T7[(a2>>> 8)&0xFF] ^ T8[(a1 )&0xFF] ^ K[keyOffset++];
480 t1 = T5[(a1>>>24) ] ^ T6[(a0>>>16)&0xFF] ^
481 T7[(t3>>> 8)&0xFF] ^ T8[(a2 )&0xFF] ^ K[keyOffset++];
482 t2 = T5[(a2>>>24) ] ^ T6[(a1>>>16)&0xFF] ^
483 T7[(a0>>> 8)&0xFF] ^ T8[(t3 )&0xFF] ^ K[keyOffset++];
484 t3 = T5[(t3>>>24) ] ^ T6[(a2>>>16)&0xFF] ^
485 T7[(a1>>> 8)&0xFF] ^ T8[(a0 )&0xFF] ^ K[keyOffset++];
486 a0 = T5[(t0>>>24) ] ^ T6[(t3>>>16)&0xFF] ^
487 T7[(t2>>> 8)&0xFF] ^ T8[(t1 )&0xFF] ^ K[keyOffset++];
488 a1 = T5[(t1>>>24) ] ^ T6[(t0>>>16)&0xFF] ^
489 T7[(t3>>> 8)&0xFF] ^ T8[(t2 )&0xFF] ^ K[keyOffset++];
490 a2 = T5[(t2>>>24) ] ^ T6[(t1>>>16)&0xFF] ^
491 T7[(t0>>> 8)&0xFF] ^ T8[(t3 )&0xFF] ^ K[keyOffset++];
492 t3 = T5[(t3>>>24) ] ^ T6[(t2>>>16)&0xFF] ^
493 T7[(t1>>> 8)&0xFF] ^ T8[(t0 )&0xFF] ^ K[keyOffset++];
494 t0 = T5[(a0>>>24) ] ^ T6[(t3>>>16)&0xFF] ^
495 T7[(a2>>> 8)&0xFF] ^ T8[(a1 )&0xFF] ^ K[keyOffset++];
496 t1 = T5[(a1>>>24) ] ^ T6[(a0>>>16)&0xFF] ^
497 T7[(t3>>> 8)&0xFF] ^ T8[(a2 )&0xFF] ^ K[keyOffset++];
498 t2 = T5[(a2>>>24) ] ^ T6[(a1>>>16)&0xFF] ^
499 T7[(a0>>> 8)&0xFF] ^ T8[(t3 )&0xFF] ^ K[keyOffset++];
500 t3 = T5[(t3>>>24) ] ^ T6[(a2>>>16)&0xFF] ^
501 T7[(a1>>> 8)&0xFF] ^ T8[(a0 )&0xFF] ^ K[keyOffset++];
502 a0 = T5[(t0>>>24) ] ^ T6[(t3>>>16)&0xFF] ^
503 T7[(t2>>> 8)&0xFF] ^ T8[(t1 )&0xFF] ^ K[keyOffset++];
504 a1 = T5[(t1>>>24) ] ^ T6[(t0>>>16)&0xFF] ^
505 T7[(t3>>> 8)&0xFF] ^ T8[(t2 )&0xFF] ^ K[keyOffset++];
506 a2 = T5[(t2>>>24) ] ^ T6[(t1>>>16)&0xFF] ^
507 T7[(t0>>> 8)&0xFF] ^ T8[(t3 )&0xFF] ^ K[keyOffset++];
508 t3 = T5[(t3>>>24) ] ^ T6[(t2>>>16)&0xFF] ^
509 T7[(t1>>> 8)&0xFF] ^ T8[(t0 )&0xFF] ^ K[keyOffset++];
510 t0 = T5[(a0>>>24) ] ^ T6[(t3>>>16)&0xFF] ^
511 T7[(a2>>> 8)&0xFF] ^ T8[(a1 )&0xFF] ^ K[keyOffset++];
512 t1 = T5[(a1>>>24) ] ^ T6[(a0>>>16)&0xFF] ^
513 T7[(t3>>> 8)&0xFF] ^ T8[(a2 )&0xFF] ^ K[keyOffset++];
514 t2 = T5[(a2>>>24) ] ^ T6[(a1>>>16)&0xFF] ^
515 T7[(a0>>> 8)&0xFF] ^ T8[(t3 )&0xFF] ^ K[keyOffset++];
516 t3 = T5[(t3>>>24) ] ^ T6[(a2>>>16)&0xFF] ^
517 T7[(a1>>> 8)&0xFF] ^ T8[(a0 )&0xFF] ^ K[keyOffset++];
518 a0 = T5[(t0>>>24) ] ^ T6[(t3>>>16)&0xFF] ^
519 T7[(t2>>> 8)&0xFF] ^ T8[(t1 )&0xFF] ^ K[keyOffset++];
520 a1 = T5[(t1>>>24) ] ^ T6[(t0>>>16)&0xFF] ^
521 T7[(t3>>> 8)&0xFF] ^ T8[(t2 )&0xFF] ^ K[keyOffset++];
522 a2 = T5[(t2>>>24) ] ^ T6[(t1>>>16)&0xFF] ^
523 T7[(t0>>> 8)&0xFF] ^ T8[(t3 )&0xFF] ^ K[keyOffset++];
524 t3 = T5[(t3>>>24) ] ^ T6[(t2>>>16)&0xFF] ^
525 T7[(t1>>> 8)&0xFF] ^ T8[(t0 )&0xFF] ^ K[keyOffset++];
526 t0 = T5[(a0>>>24) ] ^ T6[(t3>>>16)&0xFF] ^
527 T7[(a2>>> 8)&0xFF] ^ T8[(a1 )&0xFF] ^ K[keyOffset++];
528 t1 = T5[(a1>>>24) ] ^ T6[(a0>>>16)&0xFF] ^
529 T7[(t3>>> 8)&0xFF] ^ T8[(a2 )&0xFF] ^ K[keyOffset++];
530 t2 = T5[(a2>>>24) ] ^ T6[(a1>>>16)&0xFF] ^
531 T7[(a0>>> 8)&0xFF] ^ T8[(t3 )&0xFF] ^ K[keyOffset++];
532 t3 = T5[(t3>>>24) ] ^ T6[(a2>>>16)&0xFF] ^
533 T7[(a1>>> 8)&0xFF] ^ T8[(a0 )&0xFF] ^ K[keyOffset++];
534 a0 = T5[(t0>>>24) ] ^ T6[(t3>>>16)&0xFF] ^
535 T7[(t2>>> 8)&0xFF] ^ T8[(t1 )&0xFF] ^ K[keyOffset++];
536 a1 = T5[(t1>>>24) ] ^ T6[(t0>>>16)&0xFF] ^
537 T7[(t3>>> 8)&0xFF] ^ T8[(t2 )&0xFF] ^ K[keyOffset++];
538 a2 = T5[(t2>>>24) ] ^ T6[(t1>>>16)&0xFF] ^
539 T7[(t0>>> 8)&0xFF] ^ T8[(t3 )&0xFF] ^ K[keyOffset++];
540 t3 = T5[(t3>>>24) ] ^ T6[(t2>>>16)&0xFF] ^
541 T7[(t1>>> 8)&0xFF] ^ T8[(t0 )&0xFF] ^ K[keyOffset++];
542
543 t1 = K[0];
544 out[outOffset++] = (byte)(Si[(a0 >>> 24) ] ^ (t1 >>> 24));
545 out[outOffset++] = (byte)(Si[(t3 >>> 16) & 0xFF] ^ (t1 >>> 16));
546 out[outOffset++] = (byte)(Si[(a2 >>> 8) & 0xFF] ^ (t1 >>> 8));
547 out[outOffset++] = (byte)(Si[(a1 ) & 0xFF] ^ (t1 ));
548 t1 = K[1];
549 out[outOffset++] = (byte)(Si[(a1 >>> 24) ] ^ (t1 >>> 24));
550 out[outOffset++] = (byte)(Si[(a0 >>> 16) & 0xFF] ^ (t1 >>> 16));
551 out[outOffset++] = (byte)(Si[(t3 >>> 8) & 0xFF] ^ (t1 >>> 8));
552 out[outOffset++] = (byte)(Si[(a2 ) & 0xFF] ^ (t1 ));
553 t1 = K[2];
554 out[outOffset++] = (byte)(Si[(a2 >>> 24) ] ^ (t1 >>> 24));
555 out[outOffset++] = (byte)(Si[(a1 >>> 16) & 0xFF] ^ (t1 >>> 16));
556 out[outOffset++] = (byte)(Si[(a0 >>> 8) & 0xFF] ^ (t1 >>> 8));
557 out[outOffset++] = (byte)(Si[(t3 ) & 0xFF] ^ (t1 ));
558 t1 = K[3];
559 out[outOffset++] = (byte)(Si[(t3 >>> 24) ] ^ (t1 >>> 24));
560 out[outOffset++] = (byte)(Si[(a2 >>> 16) & 0xFF] ^ (t1 >>> 16));
561 out[outOffset++] = (byte)(Si[(a1 >>> 8) & 0xFF] ^ (t1 >>> 8));
562 out[outOffset ] = (byte)(Si[(a0 ) & 0xFF] ^ (t1 ));
563 }
564
565
566 /**
567 * Expand a user-supplied key material into a session key.
568 *
569 * @param key The 128/192/256-bit user-key to use.
570 * @exception InvalidKeyException If the key is invalid.
571 */
572 private static Object[] makeKey(byte[] k) throws InvalidKeyException {
573 if (k == null) {
574 throw new InvalidKeyException("Empty key");
575 }
576 if (!isKeySizeValid(k.length)) {
577 throw new InvalidKeyException("Invalid AES key length: " +
578 k.length + " bytes");
579 }
580 int ROUNDS = getRounds(k.length);
581 int ROUND_KEY_COUNT = (ROUNDS + 1) * 4;
582
583 int BC = 4;
584 int[][] Ke = new int[ROUNDS + 1][4]; // encryption round keys
585 int[][] Kd = new int[ROUNDS + 1][4]; // decryption round keys
586
587 int KC = k.length/4; // keylen in 32-bit elements
588
589 int[] tk = new int[KC];
590 int i, j;
591
592 // copy user material bytes into temporary ints
593 for (i = 0, j = 0; i < KC; i++, j+=4) {
594 tk[i] = (k[j] ) << 24 |
595 (k[j+1] & 0xFF) << 16 |
596 (k[j+2] & 0xFF) << 8 |
597 (k[j+3] & 0xFF);
598 }
599
600 // copy values into round key arrays
601 int t = 0;
602 for (j = 0; (j < KC) && (t < ROUND_KEY_COUNT); j++, t++) {
603 Ke[t / 4][t % 4] = tk[j];
604 Kd[ROUNDS - (t / 4)][t % 4] = tk[j];
605 }
606 int tt, rconpointer = 0;
607 while (t < ROUND_KEY_COUNT) {
608 // extrapolate using phi (the round key evolution function)
609 tt = tk[KC - 1];
610 tk[0] ^= (S[(tt >>> 16) & 0xFF] ) << 24 ^
611 (S[(tt >>> 8) & 0xFF] & 0xFF) << 16 ^
612 (S[(tt ) & 0xFF] & 0xFF) << 8 ^
613 (S[(tt >>> 24) ] & 0xFF) ^
614 (rcon[rconpointer++] ) << 24;
615 if (KC != 8)
616 for (i = 1, j = 0; i < KC; i++, j++) tk[i] ^= tk[j];
617 else {
618 for (i = 1, j = 0; i < KC / 2; i++, j++) tk[i] ^= tk[j];
619 tt = tk[KC / 2 - 1];
620 tk[KC / 2] ^= (S[(tt ) & 0xFF] & 0xFF) ^
621 (S[(tt >>> 8) & 0xFF] & 0xFF) << 8 ^
622 (S[(tt >>> 16) & 0xFF] & 0xFF) << 16 ^
623 (S[(tt >>> 24) ] ) << 24;
624 for (j = KC / 2, i = j + 1; i < KC; i++, j++) tk[i] ^= tk[j];
625 }
626 // copy values into round key arrays
627 for (j = 0; (j < KC) && (t < ROUND_KEY_COUNT); j++, t++) {
628 Ke[t / 4][t % 4] = tk[j];
629 Kd[ROUNDS - (t / 4)][t % 4] = tk[j];
630 }
631 }
632 for (int r = 1; r < ROUNDS; r++) {
633 // inverse MixColumn where needed
634 for (j = 0; j < BC; j++) {
635 tt = Kd[r][j];
636 Kd[r][j] = U1[(tt >>> 24) & 0xFF] ^
637 U2[(tt >>> 16) & 0xFF] ^
638 U3[(tt >>> 8) & 0xFF] ^
639 U4[ tt & 0xFF];
640 }
641 }
642 // assemble the encryption (Ke) and decryption (Kd) round keys into
643 // one sessionKey object
644 Object[] result = new Object[] {Ke, Kd};
645 return result;
646 }
647
648
649 /**
650 * Return The number of rounds for a given Rijndael keysize.
651 *
652 * @param keySize The size of the user key material in bytes.
653 * MUST be one of (16, 24, 32).
654 * @return The number of rounds.
655 */
656 private static int getRounds(int keySize) {
657 return (keySize >> 2) + 6;
658 }
659}
java/pkg/com/sun/crypto/provider/AESKeyGenerator.java+117−0
@@ -0,0 +1,117 @@
1/*
2 * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26package com.sun.crypto.provider;
27
28import java.security.SecureRandom;
29import java.security.InvalidParameterException;
30import java.security.InvalidAlgorithmParameterException;
31import java.security.InvalidKeyException;
32import java.security.spec.AlgorithmParameterSpec;
33import javax.crypto.KeyGeneratorSpi;
34import javax.crypto.SecretKey;
35import javax.crypto.spec.SecretKeySpec;
36
37
38/**
39 * This class generates a AES key.
40 *
41 * @author Valerie Peng
42 *
43 */
44
45public final class AESKeyGenerator extends KeyGeneratorSpi {
46
47 private SecureRandom random = null;
48 private int keySize = 16; // default keysize (in number of bytes)
49
50 /**
51 * Empty constructor.
52 */
53 public AESKeyGenerator() {
54 }
55
56 /**
57 * Initializes this key generator.
58 *
59 * @param random the source of randomness for this generator
60 */
61 protected void engineInit(SecureRandom random) {
62 this.random = random;
63 }
64
65 /**
66 * Initializes this key generator with the specified parameter
67 * set and a user-provided source of randomness.
68 *
69 * @param params the key generation parameters
70 * @param random the source of randomness for this key generator
71 *
72 * @exception InvalidAlgorithmParameterException if <code>params</code> is
73 * inappropriate for this key generator
74 */
75 protected void engineInit(AlgorithmParameterSpec params,
76 SecureRandom random)
77 throws InvalidAlgorithmParameterException {
78 throw new InvalidAlgorithmParameterException
79 ("AES key generation does not take any parameters");
80 }
81
82 /**
83 * Initializes this key generator for a certain keysize, using the given
84 * source of randomness.
85 *
86 * @param keysize the keysize. This is an algorithm-specific
87 * metric specified in number of bits.
88 * @param random the source of randomness for this key generator
89 */
90 protected void engineInit(int keysize, SecureRandom random) {
91 if (((keysize % 8) != 0) ||
92 (!AESCrypt.isKeySizeValid(keysize/8))) {
93 throw new InvalidParameterException
94 ("Wrong keysize: must be equal to 128, 192 or 256");
95 }
96 this.keySize = keysize/8;
97 this.engineInit(random);
98 }
99
100 /**
101 * Generates the AES key.
102 *
103 * @return the new AES key
104 */
105 protected SecretKey engineGenerateKey() {
106 SecretKeySpec aesKey = null;
107
108 if (this.random == null) {
109 this.random = SunJCE.RANDOM;
110 }
111
112 byte[] keyBytes = new byte[keySize];
113 this.random.nextBytes(keyBytes);
114 aesKey = new SecretKeySpec(keyBytes, "AES");
115 return aesKey;
116 }
117}
java/pkg/com/sun/crypto/provider/AESParameters.java+87−0
@@ -0,0 +1,87 @@
1/*
2 * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26package com.sun.crypto.provider;
27
28import java.util.*;
29import java.io.*;
30import sun.security.util.*;
31import java.security.AlgorithmParametersSpi;
32import java.security.spec.AlgorithmParameterSpec;
33import java.security.spec.InvalidParameterSpecException;
34import javax.crypto.spec.IvParameterSpec;
35
36/**
37 * This class implements the parameter (IV) used with the AES algorithm
38 * in feedback-mode. IV is defined in the standards as follows:
39 *
40 * <pre>
41 * IV ::= OCTET STRING -- 16 octets
42 * </pre>
43 *
44 * @author Valerie Peng
45 *
46 */
47public final class AESParameters extends AlgorithmParametersSpi {
48
49 private BlockCipherParamsCore core;
50
51 public AESParameters() {
52 core = new BlockCipherParamsCore(AESConstants.AES_BLOCK_SIZE);
53 }
54
55 protected void engineInit(AlgorithmParameterSpec paramSpec)
56 throws InvalidParameterSpecException {
57 core.init(paramSpec);
58 }
59
60 protected void engineInit(byte[] encoded)
61 throws IOException {
62 core.init(encoded);
63 }
64
65 protected void engineInit(byte[] encoded, String decodingMethod)
66 throws IOException {
67 core.init(encoded, decodingMethod);
68 }
69
70 protected AlgorithmParameterSpec engineGetParameterSpec(Class paramSpec)
71 throws InvalidParameterSpecException {
72 return core.getParameterSpec(paramSpec);
73 }
74
75 protected byte[] engineGetEncoded() throws IOException {
76 return core.getEncoded();
77 }
78
79 protected byte[] engineGetEncoded(String encodingMethod)
80 throws IOException {
81 return core.getEncoded();
82 }
83
84 protected String engineToString() {
85 return core.toString();
86 }
87}
java/pkg/com/sun/crypto/provider/AESWrapCipher.java+483−0
@@ -0,0 +1,483 @@
1/*
2 * Copyright (c) 2004, 2009, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26package com.sun.crypto.provider;
27
28import java.util.Arrays;
29import java.security.*;
30import java.security.spec.*;
31import javax.crypto.*;
32import javax.crypto.spec.*;
33
34/**
35 * This class implements the AES KeyWrap algorithm as defined
36 * in <a href=http://www.w3.org/TR/xmlenc-core/#sec-Alg-SymmetricKeyWrap>
37 * "XML Encryption Syntax and Processing" section 5.6.3 "AES Key Wrap".
38 * Note: only <code>ECB</code> mode and <code>NoPadding</code> padding
39 * can be used for this algorithm.
40 *
41 * @author Valerie Peng
42 *
43 *
44 * @see AESCipher
45 */
46public final class AESWrapCipher extends CipherSpi {
47
48 private static final byte[] IV = {
49 (byte) 0xA6, (byte) 0xA6, (byte) 0xA6, (byte) 0xA6,
50 (byte) 0xA6, (byte) 0xA6, (byte) 0xA6, (byte) 0xA6
51 };
52
53 private static final int blksize = AESConstants.AES_BLOCK_SIZE;
54
55 /*
56 * internal cipher object which does the real work.
57 */
58 private AESCrypt cipher;
59
60 /*
61 * are we encrypting or decrypting?
62 */
63 private boolean decrypting = false;
64
65 /**
66 * Creates an instance of AES KeyWrap cipher with default
67 * mode, i.e. "ECB" and padding scheme, i.e. "NoPadding".
68 */
69 public AESWrapCipher() {
70 cipher = new AESCrypt();
71 }
72
73 /**
74 * Sets the mode of this cipher. Only "ECB" mode is accepted for this
75 * cipher.
76 *
77 * @param mode the cipher mode
78 *
79 * @exception NoSuchAlgorithmException if the requested cipher mode
80 * is not "ECB".
81 */
82 protected void engineSetMode(String mode)
83 throws NoSuchAlgorithmException {
84 if (!mode.equalsIgnoreCase("ECB")) {
85 throw new NoSuchAlgorithmException(mode + " cannot be used");
86 }
87 }
88
89 /**
90 * Sets the padding mechanism of this cipher. Only "NoPadding" schmem
91 * is accepted for this cipher.
92 *
93 * @param padding the padding mechanism
94 *
95 * @exception NoSuchPaddingException if the requested padding mechanism
96 * is not "NoPadding".
97 */
98 protected void engineSetPadding(String padding)
99 throws NoSuchPaddingException {
100 if (!padding.equalsIgnoreCase("NoPadding")) {
101 throw new NoSuchPaddingException(padding + " cannot be used");
102 }
103 }
104
105 /**
106 * Returns the block size (in bytes). i.e. 16 bytes.
107 *
108 * @return the block size (in bytes), i.e. 16 bytes.
109 */
110 protected int engineGetBlockSize() {
111 return blksize;
112 }
113
114 /**
115 * Returns the length in bytes that an output buffer would need to be
116 * given the input length <code>inputLen</code> (in bytes).
117 *
118 * <p>The actual output length of the next <code>update</code> or
119 * <code>doFinal</code> call may be smaller than the length returned
120 * by this method.
121 *
122 * @param inputLen the input length (in bytes)
123 *
124 * @return the required output buffer size (in bytes)
125 */
126 protected int engineGetOutputSize(int inputLen) {
127 // can only return an upper-limit if not initialized yet.
128 int result = 0;
129 if (decrypting) {
130 result = inputLen - 8;
131 } else {
132 result = inputLen + 8;
133 }
134 return (result < 0? 0:result);
135 }
136
137 /**
138 * Returns the initialization vector (IV) which is null for this cipher.
139 *
140 * @return null for this cipher.
141 */
142 protected byte[] engineGetIV() {
143 return null;
144 }
145
146 /**
147 * Initializes this cipher with a key and a source of randomness.
148 *
149 * <p>The cipher only supports the following two operation modes:<b>
150 * Cipher.WRAP_MODE, and <b>
151 * Cipher.UNWRAP_MODE.
152 * <p>For modes other than the above two, UnsupportedOperationException
153 * will be thrown.
154 *
155 * @param opmode the operation mode of this cipher. Only
156 * <code>WRAP_MODE</code> or <code>UNWRAP_MODE</code>) are accepted.
157 * @param key the secret key.
158 * @param random the source of randomness.
159 *
160 * @exception InvalidKeyException if the given key is inappropriate for
161 * initializing this cipher.
162 */
163 protected void engineInit(int opmode, Key key, SecureRandom random)
164 throws InvalidKeyException {
165 if (opmode == Cipher.WRAP_MODE) {
166 decrypting = false;
167 } else if (opmode == Cipher.UNWRAP_MODE) {
168 decrypting = true;
169 } else {
170 throw new UnsupportedOperationException("This cipher can " +
171 "only be used for key wrapping and unwrapping");
172 }
173 cipher.init(decrypting, key.getAlgorithm(), key.getEncoded());
174 }
175
176 /**
177 * Initializes this cipher with a key, a set of algorithm parameters,
178 * and a source of randomness.
179 *
180 * <p>The cipher only supports the following two operation modes:<b>
181 * Cipher.WRAP_MODE, and <b>
182 * Cipher.UNWRAP_MODE.
183 * <p>For modes other than the above two, UnsupportedOperationException
184 * will be thrown.
185 *
186 * @param opmode the operation mode of this cipher. Only
187 * <code>WRAP_MODE</code> or <code>UNWRAP_MODE</code>) are accepted.
188 * @param key the secret key.
189 * @param params the algorithm parameters; must be null for this cipher.
190 * @param random the source of randomness.
191 *
192 * @exception InvalidKeyException if the given key is inappropriate for
193 * initializing this cipher
194 * @exception InvalidAlgorithmParameterException if the given algorithm
195 * parameters is not null.
196 */
197 protected void engineInit(int opmode, Key key,
198 AlgorithmParameterSpec params,
199 SecureRandom random)
200 throws InvalidKeyException, InvalidAlgorithmParameterException {
201 if (params != null) {
202 throw new InvalidAlgorithmParameterException("This cipher " +
203 "does not accept any parameters");
204 }
205 engineInit(opmode, key, random);
206 }
207
208 /**
209 * Initializes this cipher with a key, a set of algorithm parameters,
210 * and a source of randomness.
211 *
212 * <p>The cipher only supports the following two operation modes:<b>
213 * Cipher.WRAP_MODE, and <b>
214 * Cipher.UNWRAP_MODE.
215 * <p>For modes other than the above two, UnsupportedOperationException
216 * will be thrown.
217 *
218 * @param opmode the operation mode of this cipher. Only
219 * <code>WRAP_MODE</code> or <code>UNWRAP_MODE</code>) are accepted.
220 * @param key the secret key.
221 * @param params the algorithm parameters; must be null for this cipher.
222 * @param random the source of randomness.
223 *
224 * @exception InvalidKeyException if the given key is inappropriate.
225 * @exception InvalidAlgorithmParameterException if the given algorithm
226 * parameters is not null.
227 */
228 protected void engineInit(int opmode, Key key,
229 AlgorithmParameters params,
230 SecureRandom random)
231 throws InvalidKeyException, InvalidAlgorithmParameterException {
232 if (params != null) {
233 throw new InvalidAlgorithmParameterException("This cipher " +
234 "does not accept any parameters");
235 }
236 engineInit(opmode, key, random);
237 }
238
239 /**
240 * This operation is not supported by this cipher.
241 * Since it's impossible to initialize this cipher given the
242 * current Cipher.engineInit(...) implementation,
243 * IllegalStateException will always be thrown upon invocation.
244 *
245 * @param in the input buffer.
246 * @param inOffset the offset in <code>in</code> where the input
247 * starts.
248 * @param inLen the input length.
249 *
250 * @return n/a.
251 *
252 * @exception IllegalStateException upon invocation of this method.
253 */
254 protected byte[] engineUpdate(byte[] in, int inOffset, int inLen) {
255 throw new IllegalStateException("Cipher has not been initialized");
256 }
257
258 /**
259 * This operation is not supported by this cipher.
260 * Since it's impossible to initialize this cipher given the
261 * current Cipher.engineInit(...) implementation,
262 * IllegalStateException will always be thrown upon invocation.
263 *
264 * @param in the input buffer.
265 * @param inOffset the offset in <code>in</code> where the input
266 * starts.
267 * @param inLen the input length.
268 * @param out the buffer for the result.
269 * @param outOffset the offset in <code>out</code> where the result
270 * is stored.
271 *
272 * @return n/a.
273 *
274 * @exception IllegalStateException upon invocation of this method.
275 */
276 protected int engineUpdate(byte[] in, int inOffset, int inLen,
277 byte[] out, int outOffset)
278 throws ShortBufferException {
279 throw new IllegalStateException("Cipher has not been initialized");
280 }
281
282 /**
283 * This operation is not supported by this cipher.
284 * Since it's impossible to initialize this cipher given the
285 * current Cipher.engineInit(...) implementation,
286 * IllegalStateException will always be thrown upon invocation.
287 *
288 * @param in the input buffer
289 * @param inOffset the offset in <code>in</code> where the input
290 * starts
291 * @param inLen the input length.
292 *
293 * @return n/a.
294 *
295 * @exception IllegalStateException upon invocation of this method.
296 */
297 protected byte[] engineDoFinal(byte[] input, int inputOffset,
298 int inputLen)
299 throws IllegalBlockSizeException, BadPaddingException {
300 throw new IllegalStateException("Cipher has not been initialized");
301 }
302
303 /**
304 * This operation is not supported by this cipher.
305 * Since it's impossible to initialize this cipher given the
306 * current Cipher.engineInit(...) implementation,
307 * IllegalStateException will always be thrown upon invocation.
308 *
309 * @param in the input buffer.
310 * @param inOffset the offset in <code>in</code> where the input
311 * starts.
312 * @param inLen the input length.
313 * @param out the buffer for the result.
314 * @param outOffset the ofset in <code>out</code> where the result
315 * is stored.
316 *
317 * @return n/a.
318 *
319 * @exception IllegalStateException upon invocation of this method.
320 */
321 protected int engineDoFinal(byte[] in, int inOffset, int inLen,
322 byte[] out, int outOffset)
323 throws IllegalBlockSizeException, ShortBufferException,
324 BadPaddingException {
325 throw new IllegalStateException("Cipher has not been initialized");
326 }
327
328 /**
329 * Returns the parameters used with this cipher which is always null
330 * for this cipher.
331 *
332 * @return null since this cipher does not use any parameters.
333 */
334 protected AlgorithmParameters engineGetParameters() {
335 return null;
336 }
337
338 /**
339 * Returns the key size of the given key object in number of bits.
340 *
341 * @param key the key object.
342 *
343 * @return the "effective" key size of the given key object.
344 *
345 * @exception InvalidKeyException if <code>key</code> is invalid.
346 */
347 protected int engineGetKeySize(Key key) throws InvalidKeyException {
348 byte[] encoded = key.getEncoded();
349 if (!AESCrypt.isKeySizeValid(encoded.length)) {
350 throw new InvalidKeyException("Invalid key length: " +
351 encoded.length + " bytes");
352 }
353 return encoded.length * 8;
354 }
355
356 /**
357 * Wrap a key.
358 *
359 * @param key the key to be wrapped.
360 *
361 * @return the wrapped key.
362 *
363 * @exception IllegalBlockSizeException if this cipher is a block
364 * cipher, no padding has been requested, and the length of the
365 * encoding of the key to be wrapped is not a
366 * multiple of the block size.
367 *
368 * @exception InvalidKeyException if it is impossible or unsafe to
369 * wrap the key with this cipher (e.g., a hardware protected key is
370 * being passed to a software only cipher).
371 */
372 protected byte[] engineWrap(Key key)
373 throws IllegalBlockSizeException, InvalidKeyException {
374 byte[] keyVal = key.getEncoded();
375 if ((keyVal == null) || (keyVal.length == 0)) {
376 throw new InvalidKeyException("Cannot get an encoding of " +
377 "the key to be wrapped");
378 }
379 byte[] out = new byte[keyVal.length + 8];
380
381 if (keyVal.length == 8) {
382 System.arraycopy(IV, 0, out, 0, IV.length);
383 System.arraycopy(keyVal, 0, out, IV.length, 8);
384 cipher.encryptBlock(out, 0, out, 0);
385 } else {
386 if (keyVal.length % 8 != 0) {
387 throw new IllegalBlockSizeException("length of the " +
388 "to be wrapped key should be multiples of 8 bytes");
389 }
390 System.arraycopy(IV, 0, out, 0, IV.length);
391 System.arraycopy(keyVal, 0, out, IV.length, keyVal.length);
392 int N = keyVal.length/8;
393 byte[] buffer = new byte[blksize];
394 for (int j = 0; j < 6; j++) {
395 for (int i = 1; i <= N; i++) {
396 int T = i + j*N;
397 System.arraycopy(out, 0, buffer, 0, IV.length);
398 System.arraycopy(out, i*8, buffer, IV.length, 8);
399 cipher.encryptBlock(buffer, 0, buffer, 0);
400 for (int k = 1; T != 0; k++) {
401 byte v = (byte) T;
402 buffer[IV.length - k] ^= v;
403 T >>>= 8;
404 }
405 System.arraycopy(buffer, 0, out, 0, IV.length);
406 System.arraycopy(buffer, 8, out, 8*i, 8);
407 }
408 }
409 }
410 return out;
411 }
412
413 /**
414 * Unwrap a previously wrapped key.
415 *
416 * @param wrappedKey the key to be unwrapped.
417 *
418 * @param wrappedKeyAlgorithm the algorithm the wrapped key is for.
419 *
420 * @param wrappedKeyType the type of the wrapped key.
421 * This is one of <code>Cipher.SECRET_KEY</code>,
422 * <code>Cipher.PRIVATE_KEY</code>, or <code>Cipher.PUBLIC_KEY</code>.
423 *
424 * @return the unwrapped key.
425 *
426 * @exception NoSuchAlgorithmException if no installed providers
427 * can create keys of type <code>wrappedKeyType</code> for the
428 * <code>wrappedKeyAlgorithm</code>.
429 *
430 * @exception InvalidKeyException if <code>wrappedKey</code> does not
431 * represent a wrapped key of type <code>wrappedKeyType</code> for
432 * the <code>wrappedKeyAlgorithm</code>.
433 */
434 protected Key engineUnwrap(byte[] wrappedKey,
435 String wrappedKeyAlgorithm,
436 int wrappedKeyType)
437 throws InvalidKeyException, NoSuchAlgorithmException {
438 int wrappedKeyLen = wrappedKey.length;
439 // ensure the wrappedKey length is multiples of 8 bytes and non-zero
440 if (wrappedKeyLen == 0) {
441 throw new InvalidKeyException("The wrapped key is empty");
442 }
443 if (wrappedKeyLen % 8 != 0) {
444 throw new InvalidKeyException
445 ("The wrapped key has invalid key length");
446 }
447 byte[] out = new byte[wrappedKeyLen - 8];
448 byte[] buffer = new byte[blksize];
449 if (wrappedKeyLen == 16) {
450 cipher.decryptBlock(wrappedKey, 0, buffer, 0);
451 for (int i = 0; i < IV.length; i++) {
452 if (IV[i] != buffer[i]) {
453 throw new InvalidKeyException("Integrity check failed");
454 }
455 }
456 System.arraycopy(buffer, IV.length, out, 0, out.length);
457 } else {
458 System.arraycopy(wrappedKey, 0, buffer, 0, IV.length);
459 System.arraycopy(wrappedKey, IV.length, out, 0, out.length);
460 int N = out.length/8;
461 for (int j = 5; j >= 0; j--) {
462 for (int i = N; i > 0; i--) {
463 int T = i + j*N;
464 System.arraycopy(out, 8*(i-1), buffer, IV.length, 8);
465 for (int k = 1; T != 0; k++) {
466 byte v = (byte) T;
467 buffer[IV.length - k] ^= v;
468 T >>>= 8;
469 }
470 cipher.decryptBlock(buffer, 0, buffer, 0);
471 System.arraycopy(buffer, IV.length, out, 8*(i-1), 8);
472 }
473 }
474 for (int i = 0; i < IV.length; i++) {
475 if (IV[i] != buffer[i]) {
476 throw new InvalidKeyException("Integrity check failed");
477 }
478 }
479 }
480 return ConstructKeys.constructKey(out, wrappedKeyAlgorithm,
481 wrappedKeyType);
482 }
483}
java/pkg/com/sun/crypto/provider/ARCFOURCipher.java+263−0
@@ -0,0 +1,263 @@
1/*
2 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26package com.sun.crypto.provider;
27
28import java.security.*;
29import java.security.spec.AlgorithmParameterSpec;
30
31import javax.crypto.*;
32
33/**
34 * Implementation of the ARCFOUR cipher, an algorithm apparently compatible
35 * with RSA Security's RC4(tm) cipher. The description of this algorithm was
36 * taken from Bruce Schneier's book Applied Cryptography, 2nd ed.,
37 * section 17.1.
38 *
39 * We support keys from 40 to 1024 bits. ARCFOUR would allow for keys shorter
40 * than 40 bits, but that is too insecure for us to permit.
41 *
42 * Note that we subclass CipherSpi directly and do not use the CipherCore
43 * framework. That was designed to simplify implementation of block ciphers
44 * and does not offer any advantages for stream ciphers such as ARCFOUR.
45 *
46 * @since 1.5
47 * @author Andreas Sterbenz
48 */
49public final class ARCFOURCipher extends CipherSpi {
50
51 // state array S, 256 entries. The entries are 8-bit, but we use an int[]
52 // because int arithmetic is much faster than in Java than bytes.
53 private final int[] S;
54
55 // state indices i and j. Called is and js to avoid collision with
56 // local variables. 'is' is set to -1 after a call to doFinal()
57 private int is, js;
58
59 // the bytes of the last key used (if any)
60 // we need this to re-initialize after a call to doFinal()
61 private byte[] lastKey;
62
63 // called by the JCE framework
64 public ARCFOURCipher() {
65 S = new int[256];
66 }
67
68 // core key setup code. initializes S, is, and js
69 // assumes key is non-null and between 40 and 1024 bit
70 private void init(byte[] key) {
71 // initialize S[i] to i
72 for (int i = 0; i < 256; i++) {
73 S[i] = i;
74 }
75
76 // we avoid expanding key to 256 bytes and instead keep a separate
77 // counter ki = i mod key.length.
78 for (int i = 0, j = 0, ki = 0; i < 256; i++) {
79 int Si = S[i];
80 j = (j + Si + key[ki]) & 0xff;
81 S[i] = S[j];
82 S[j] = Si;
83 ki++;
84 if (ki == key.length) {
85 ki = 0;
86 }
87 }
88
89 // set indices to 0
90 is = 0;
91 js = 0;
92 }
93
94 // core crypt code. OFB style, so works for both encryption and decryption
95 private void crypt(byte[] in, int inOfs, int inLen, byte[] out,
96 int outOfs) {
97 if (is < 0) {
98 // doFinal() was called, need to reset the cipher to initial state
99 init(lastKey);
100 }
101 while (inLen-- > 0) {
102 is = (is + 1) & 0xff;
103 int Si = S[is];
104 js = (js + Si) & 0xff;
105 int Sj = S[js];
106 S[is] = Sj;
107 S[js] = Si;
108 out[outOfs++] = (byte)(in[inOfs++] ^ S[(Si + Sj) & 0xff]);
109 }
110 }
111
112 // Modes do not make sense with stream ciphers, but allow ECB
113 // see JCE spec.
114 protected void engineSetMode(String mode) throws NoSuchAlgorithmException {
115 if (mode.equalsIgnoreCase("ECB") == false) {
116 throw new NoSuchAlgorithmException("Unsupported mode " + mode);
117 }
118 }
119
120 // Padding does not make sense with stream ciphers, but allow NoPadding
121 // see JCE spec.
122 protected void engineSetPadding(String padding)
123 throws NoSuchPaddingException {
124 if (padding.equalsIgnoreCase("NoPadding") == false) {
125 throw new NoSuchPaddingException("Padding must be NoPadding");
126 }
127 }
128
129 // Return 0 to indicate stream cipher
130 // see JCE spec.
131 protected int engineGetBlockSize() {
132 return 0;
133 }
134
135 // output length is always the same as input length
136 // see JCE spec
137 protected int engineGetOutputSize(int inputLen) {
138 return inputLen;
139 }
140
141 // no IV, return null
142 // see JCE spec
143 protected byte[] engineGetIV() {
144 return null;
145 }
146
147 // no parameters
148 // see JCE spec
149 protected AlgorithmParameters engineGetParameters() {
150 return null;
151 }
152
153 // see JCE spec
154 protected void engineInit(int opmode, Key key, SecureRandom random)
155 throws InvalidKeyException {
156 init(opmode, key);
157 }
158
159 // see JCE spec
160 protected void engineInit(int opmode, Key key,
161 AlgorithmParameterSpec params, SecureRandom random)
162 throws InvalidKeyException, InvalidAlgorithmParameterException {
163 if (params != null) {
164 throw new InvalidAlgorithmParameterException
165 ("Parameters not supported");
166 }
167 init(opmode, key);
168 }
169
170 // see JCE spec
171 protected void engineInit(int opmode, Key key,
172 AlgorithmParameters params, SecureRandom random)
173 throws InvalidKeyException, InvalidAlgorithmParameterException {
174 if (params != null) {
175 throw new InvalidAlgorithmParameterException
176 ("Parameters not supported");
177 }
178 init(opmode, key);
179 }
180
181 // init method. Check opmode and key, then call init(byte[]).
182 private void init(int opmode, Key key) throws InvalidKeyException {
183 if ((opmode < Cipher.ENCRYPT_MODE) || (opmode > Cipher.UNWRAP_MODE)) {
184 throw new InvalidKeyException("Unknown opmode: " + opmode);
185 }
186 lastKey = getEncodedKey(key);
187 init(lastKey);
188 }
189
190 // return the encoding of key if key is a valid ARCFOUR key.
191 // otherwise, throw an InvalidKeyException
192 private static byte[] getEncodedKey(Key key) throws InvalidKeyException {
193 String keyAlg = key.getAlgorithm();
194 if (!keyAlg.equals("RC4") && !keyAlg.equals("ARCFOUR")) {
195 throw new InvalidKeyException("Not an ARCFOUR key: " + keyAlg);
196 }
197 if ("RAW".equals(key.getFormat()) == false) {
198 throw new InvalidKeyException("Key encoding format must be RAW");
199 }
200 byte[] encodedKey = key.getEncoded();
201 if ((encodedKey.length < 5) || (encodedKey.length > 128)) {
202 throw new InvalidKeyException
203 ("Key length must be between 40 and 1024 bit");
204 }
205 return encodedKey;
206 }
207
208 // see JCE spec
209 protected byte[] engineUpdate(byte[] in, int inOfs, int inLen) {
210 byte[] out = new byte[inLen];
211 crypt(in, inOfs, inLen, out, 0);
212 return out;
213 }
214
215 // see JCE spec
216 protected int engineUpdate(byte[] in, int inOfs, int inLen,
217 byte[] out, int outOfs) throws ShortBufferException {
218 if (out.length - outOfs < inLen) {
219 throw new ShortBufferException("Output buffer too small");
220 }
221 crypt(in, inOfs, inLen, out, outOfs);
222 return inLen;
223 }
224
225 // see JCE spec
226 protected byte[] engineDoFinal(byte[] in, int inOfs, int inLen) {
227 byte[] out = engineUpdate(in, inOfs, inLen);
228 is = -1;
229 return out;
230 }
231
232 // see JCE spec
233 protected int engineDoFinal(byte[] in, int inOfs, int inLen,
234 byte[] out, int outOfs) throws ShortBufferException {
235 int outLen = engineUpdate(in, inOfs, inLen, out, outOfs);
236 is = -1;
237 return outLen;
238 }
239
240 // see JCE spec
241 protected byte[] engineWrap(Key key) throws IllegalBlockSizeException,
242 InvalidKeyException {
243 byte[] encoded = key.getEncoded();
244 if ((encoded == null) || (encoded.length == 0)) {
245 throw new InvalidKeyException("Could not obtain encoded key");
246 }
247 return engineDoFinal(encoded, 0, encoded.length);
248 }
249
250 // see JCE spec
251 protected Key engineUnwrap(byte[] wrappedKey, String algorithm,
252 int type) throws InvalidKeyException, NoSuchAlgorithmException {
253 byte[] encoded = engineDoFinal(wrappedKey, 0, wrappedKey.length);
254 return ConstructKeys.constructKey(encoded, algorithm, type);
255 }
256
257 // see JCE spec
258 protected int engineGetKeySize(Key key) throws InvalidKeyException {
259 byte[] encodedKey = getEncodedKey(key);
260 return encodedKey.length << 3;
261 }
262
263}
java/pkg/com/sun/crypto/provider/BlockCipherParamsCore.java+127−0
@@ -0,0 +1,127 @@
1/*
2 * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26package com.sun.crypto.provider;
27
28import java.util.*;
29import java.io.*;
30import sun.security.util.*;
31import sun.misc.HexDumpEncoder;
32import java.security.spec.AlgorithmParameterSpec;
33import java.security.spec.InvalidParameterSpecException;
34import javax.crypto.spec.IvParameterSpec;
35
36/**
37 * This class implements the parameter (IV) used with Block Ciphers
38 * in feedback-mode. IV is defined in the standards as follows:
39 *
40 * <pre>
41 * IV ::= OCTET STRING -- length depends on the block size of the
42 * block ciphers
43 * </pre>
44 *
45 * @author Valerie Peng
46 *
47 */
48final class BlockCipherParamsCore {
49 private int block_size = 0;
50 private byte[] iv = null;
51
52 BlockCipherParamsCore(int blksize) {
53 block_size = blksize;
54 }
55
56 void init(AlgorithmParameterSpec paramSpec)
57 throws InvalidParameterSpecException {
58 if (!(paramSpec instanceof IvParameterSpec)) {
59 throw new InvalidParameterSpecException
60 ("Inappropriate parameter specification");
61 }
62 byte[] tmpIv = ((IvParameterSpec)paramSpec).getIV();
63 if (tmpIv.length != block_size) {
64 throw new InvalidParameterSpecException("IV not " +
65 block_size + " bytes long");
66 }
67 iv = (byte[]) tmpIv.clone();
68 }
69
70 void init(byte[] encoded) throws IOException {
71 DerInputStream der = new DerInputStream(encoded);
72
73 byte[] tmpIv = der.getOctetString();
74 if (der.available() != 0) {
75 throw new IOException("IV parsing error: extra data");
76 }
77 if (tmpIv.length != block_size) {
78 throw new IOException("IV not " + block_size +
79 " bytes long");
80 }
81 iv = tmpIv;
82 }
83
84 void init(byte[] encoded, String decodingMethod)
85 throws IOException {
86 if ((decodingMethod != null) &&
87 (!decodingMethod.equalsIgnoreCase("ASN.1"))) {
88 throw new IllegalArgumentException("Only support ASN.1 format");
89 }
90 init(encoded);
91 }
92
93 AlgorithmParameterSpec getParameterSpec(Class paramSpec)
94 throws InvalidParameterSpecException
95 {
96 if (IvParameterSpec.class.isAssignableFrom(paramSpec)) {
97 return new IvParameterSpec(this.iv);
98 } else {
99 throw new InvalidParameterSpecException
100 ("Inappropriate parameter specification");
101 }
102 }
103
104 byte[] getEncoded() throws IOException {
105 DerOutputStream out = new DerOutputStream();
106 out.putOctetString(this.iv);
107 return out.toByteArray();
108 }
109
110 byte[] getEncoded(String encodingMethod)
111 throws IOException {
112 return getEncoded();
113 }
114
115 /*
116 * Returns a formatted string describing the parameters.
117 */
118 public String toString() {
119 String LINE_SEP = System.getProperty("line.separator");
120
121 String ivString = LINE_SEP + " iv:" + LINE_SEP + "[";
122 HexDumpEncoder encoder = new HexDumpEncoder();
123 ivString += encoder.encodeBuffer(this.iv);
124 ivString += "]" + LINE_SEP;
125 return ivString;
126 }
127}
java/pkg/com/sun/crypto/provider/BlowfishCipher.java+428−0
@@ -0,0 +1,428 @@
1/*
2 * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26package com.sun.crypto.provider;
27
28import java.security.*;
29import java.security.spec.*;
30import sun.security.util.*;
31import javax.crypto.*;
32import javax.crypto.spec.*;
33import javax.crypto.BadPaddingException;
34
35/**
36 * This class implements the Blowfish algorithm in its various modes
37 * (<code>ECB</code>, <code>CFB</code>, <code>OFB</code>, <code>CBC</code>,
38 * <code>PCBC</code>) and padding schemes (<code>PKCS5Padding</code>,
39 * <code>NoPadding</code>, <code>ISO10126Padding</code>).
40 *
41 * <p> Blowfish is a 64-bit block cipher with a variable-length key.
42 *
43 * @author Jan Luehe
44 *
45 *
46 * @see BlowfishCrypt
47 * @see CipherBlockChaining
48 * @see ElectronicCodeBook
49 * @see CipherFeedback
50 * @see OutputFeedback
51 */
52
53public final class BlowfishCipher extends CipherSpi {
54
55 /*
56 * internal CipherCore object which does the real work.
57 */
58 private CipherCore core = null;
59
60 /**
61 * Creates an instance of Blowfish cipher with default ECB mode and
62 * PKCS5Padding.
63 */
64 public BlowfishCipher() {
65 core = new CipherCore(new BlowfishCrypt(),
66 BlowfishConstants.BLOWFISH_BLOCK_SIZE);
67 }
68
69 /**
70 * Sets the mode of this cipher.
71 *
72 * @param mode the cipher mode
73 *
74 * @exception NoSuchAlgorithmException if the requested cipher mode does
75 * not exist
76 */
77 protected void engineSetMode(String mode)
78 throws NoSuchAlgorithmException {
79 core.setMode(mode);
80 }
81
82 /**
83 * Sets the padding mechanism of this cipher.
84 *
85 * @param padding the padding mechanism
86 *
87 * @exception NoSuchPaddingException if the requested padding mechanism
88 * does not exist
89 */
90 protected void engineSetPadding(String paddingScheme)
91 throws NoSuchPaddingException {
92 core.setPadding(paddingScheme);
93 }
94
95 /**
96 * Returns the block size (in bytes).
97 *
98 * @return the block size (in bytes), or 0 if the underlying algorithm is
99 * not a block cipher
100 */
101 protected int engineGetBlockSize() {
102 return BlowfishConstants.BLOWFISH_BLOCK_SIZE;
103 }
104
105 /**
106 * Returns the length in bytes that an output buffer would need to be in
107 * order to hold the result of the next <code>update</code> or
108 * <code>doFinal</code> operation, given the input length
109 * <code>inputLen</code> (in bytes).
110 *
111 * <p>This call takes into account any unprocessed (buffered) data from a
112 * previous <code>update</code> call, and padding.
113 *
114 * <p>The actual output length of the next <code>update</code> or
115 * <code>doFinal</code> call may be smaller than the length returned by
116 * this method.
117 *
118 * @param inputLen the input length (in bytes)
119 *
120 * @return the required output buffer size (in bytes)
121 */
122 protected int engineGetOutputSize(int inputLen) {
123 return core.getOutputSize(inputLen);
124 }
125
126 /**
127 * Returns the initialization vector (IV) in a new buffer.
128 *
129 * <p>This is useful in the case where a random IV has been created
130 * (see <a href = "#init">init</a>),
131 * or in the context of password-based encryption or
132 * decryption, where the IV is derived from a user-supplied password.
133 *
134 * @return the initialization vector in a new buffer, or null if the
135 * underlying algorithm does not use an IV, or if the IV has not yet
136 * been set.
137 */
138 protected byte[] engineGetIV() {
139 return core.getIV();
140 }
141
142 /**
143 * Returns the parameters used with this cipher.
144 *
145 * <p>The returned parameters may be the same that were used to initialize
146 * this cipher, or may contain the default set of parameters or a set of
147 * randomly generated parameters used by the underlying cipher
148 * implementation (provided that the underlying cipher implementation
149 * uses a default set of parameters or creates new parameters if it needs
150 * parameters but was not initialized with any).
151 *
152 * @return the parameters used with this cipher, or null if this cipher
153 * does not use any parameters.
154 */
155 protected AlgorithmParameters engineGetParameters() {
156 return core.getParameters("Blowfish");
157 }
158
159 /**
160 * Initializes this cipher with a key and a source of randomness.
161 *
162 * <p>The cipher is initialized for one of the following four operations:
163 * encryption, decryption, key wrapping or key unwrapping, depending on
164 * the value of <code>opmode</code>.
165 *
166 * <p>If this cipher requires an initialization vector (IV), it will get
167 * it from <code>random</code>.
168 * This behaviour should only be used in encryption or key wrapping
169 * mode, however.
170 * When initializing a cipher that requires an IV for decryption or
171 * key unwrapping, the IV
172 * (same IV that was used for encryption or key wrapping) must be provided
173 * explicitly as a
174 * parameter, in order to get the correct result.
175 *
176 * <p>This method also cleans existing buffer and other related state
177 * information.
178 *
179 * @param opmode the operation mode of this cipher (this is one of
180 * the following:
181 * <code>ENCRYPT_MODE</code>, <code>DECRYPT_MODE</code>,
182 * <code>WRAP_MODE</code> or <code>UNWRAP_MODE</code>)
183 * @param key the secret key
184 * @param random the source of randomness
185 *
186 * @exception InvalidKeyException if the given key is inappropriate for
187 * initializing this cipher
188 */
189 protected void engineInit(int opmode, Key key, SecureRandom random)
190 throws InvalidKeyException {
191 core.init(opmode, key, random);
192 }
193
194 /**
195 * Initializes this cipher with a key, a set of
196 * algorithm parameters, and a source of randomness.
197 *
198 * <p>The cipher is initialized for one of the following four operations:
199 * encryption, decryption, key wrapping or key unwrapping, depending on
200 * the value of <code>opmode</code>.
201 *
202 * <p>If this cipher (including its underlying feedback or padding scheme)
203 * requires any random bytes, it will get them from <code>random</code>.
204 *
205 * @param opmode the operation mode of this cipher (this is one of
206 * the following:
207 * <code>ENCRYPT_MODE</code>, <code>DECRYPT_MODE</code>,
208 * <code>WRAP_MODE</code> or <code>UNWRAP_MODE</code>)
209 * @param key the encryption key
210 * @param params the algorithm parameters
211 * @param random the source of randomness
212 *
213 * @exception InvalidKeyException if the given key is inappropriate for
214 * initializing this cipher
215 * @exception InvalidAlgorithmParameterException if the given algorithm
216 * parameters are inappropriate for this cipher
217 */
218 protected void engineInit(int opmode, Key key,
219 AlgorithmParameterSpec params,
220 SecureRandom random)
221 throws InvalidKeyException, InvalidAlgorithmParameterException {
222 core.init(opmode, key, params, random);
223 }
224
225 protected void engineInit(int opmode, Key key,
226 AlgorithmParameters params,
227 SecureRandom random)
228 throws InvalidKeyException, InvalidAlgorithmParameterException {
229 core.init(opmode, key, params, random);
230 }
231
232 /**
233 * Continues a multiple-part encryption or decryption operation
234 * (depending on how this cipher was initialized), processing another data
235 * part.
236 *
237 * <p>The first <code>inputLen</code> bytes in the <code>input</code>
238 * buffer, starting at <code>inputOffset</code>, are processed, and the
239 * result is stored in a new buffer.
240 *
241 * @param input the input buffer
242 * @param inputOffset the offset in <code>input</code> where the input
243 * starts
244 * @param inputLen the input length
245 *
246 * @return the new buffer with the result
247 *
248 * @exception IllegalStateException if this cipher is in a wrong state
249 * (e.g., has not been initialized)
250 */
251 protected byte[] engineUpdate(byte[] input, int inputOffset,
252 int inputLen) {
253 return core.update(input, inputOffset, inputLen);
254 }
255
256 /**
257 * Continues a multiple-part encryption or decryption operation
258 * (depending on how this cipher was initialized), processing another data
259 * part.
260 *
261 * <p>The first <code>inputLen</code> bytes in the <code>input</code>
262 * buffer, starting at <code>inputOffset</code>, are processed, and the
263 * result is stored in the <code>output</code> buffer, starting at
264 * <code>outputOffset</code>.
265 *
266 * @param input the input buffer
267 * @param inputOffset the offset in <code>input</code> where the input
268 * starts
269 * @param inputLen the input length
270 * @param output the buffer for the result
271 * @param outputOffset the offset in <code>output</code> where the result
272 * is stored
273 *
274 * @return the number of bytes stored in <code>output</code>
275 *
276 * @exception ShortBufferException if the given output buffer is too small
277 * to hold the result
278 */
279 protected int engineUpdate(byte[] input, int inputOffset, int inputLen,
280 byte[] output, int outputOffset)
281 throws ShortBufferException {
282 return core.update(input, inputOffset, inputLen, output,
283 outputOffset);
284 }
285
286 /**
287 * Encrypts or decrypts data in a single-part operation,
288 * or finishes a multiple-part operation.
289 * The data is encrypted or decrypted, depending on how this cipher was
290 * initialized.
291 *
292 * <p>The first <code>inputLen</code> bytes in the <code>input</code>
293 * buffer, starting at <code>inputOffset</code>, and any input bytes that
294 * may have been buffered during a previous <code>update</code> operation,
295 * are processed, with padding (if requested) being applied.
296 * The result is stored in a new buffer.
297 *
298 * <p>The cipher is reset to its initial state (uninitialized) after this
299 * call.
300 *
301 * @param input the input buffer
302 * @param inputOffset the offset in <code>input</code> where the input
303 * starts
304 * @param inputLen the input length
305 *
306 * @return the new buffer with the result
307 *
308 * @exception IllegalBlockSizeException if this cipher is a block cipher,
309 * no padding has been requested (only in encryption mode), and the total
310 * input length of the data processed by this cipher is not a multiple of
311 * block size
312 * @exception BadPaddingException if this cipher is in decryption mode,
313 * and (un)padding has been requested, but the decrypted data is not
314 * bounded by the appropriate padding bytes
315 */
316 protected byte[] engineDoFinal(byte[] input, int inputOffset,
317 int inputLen)
318 throws IllegalBlockSizeException, BadPaddingException {
319 return core.doFinal(input, inputOffset, inputLen);
320 }
321
322 /**
323 * Encrypts or decrypts data in a single-part operation,
324 * or finishes a multiple-part operation.
325 * The data is encrypted or decrypted, depending on how this cipher was
326 * initialized.
327 *
328 * <p>The first <code>inputLen</code> bytes in the <code>input</code>
329 * buffer, starting at <code>inputOffset</code>, and any input bytes that
330 * may have been buffered during a previous <code>update</code> operation,
331 * are processed, with padding (if requested) being applied.
332 * The result is stored in the <code>output</code> buffer, starting at
333 * <code>outputOffset</code>.
334 *
335 * <p>The cipher is reset to its initial state (uninitialized) after this
336 * call.
337 *
338 * @param input the input buffer
339 * @param inputOffset the offset in <code>input</code> where the input
340 * starts
341 * @param inputLen the input length
342 * @param output the buffer for the result
343 * @param outputOffset the offset in <code>output</code> where the result
344 * is stored
345 *
346 * @return the number of bytes stored in <code>output</code>
347 *
348 * @exception IllegalBlockSizeException if this cipher is a block cipher,
349 * no padding has been requested (only in encryption mode), and the total
350 * input length of the data processed by this cipher is not a multiple of
351 * block size
352 * @exception ShortBufferException if the given output buffer is too small
353 * to hold the result
354 * @exception BadPaddingException if this cipher is in decryption mode,
355 * and (un)padding has been requested, but the decrypted data is not
356 * bounded by the appropriate padding bytes
357 */
358 protected int engineDoFinal(byte[] input, int inputOffset, int inputLen,
359 byte[] output, int outputOffset)
360 throws IllegalBlockSizeException, ShortBufferException,
361 BadPaddingException {
362 return core.doFinal(input, inputOffset, inputLen, output,
363 outputOffset);
364 }
365
366 /**
367 * Returns the key size of the given key object.
368 *
369 * @param key the key object.
370 *
371 * @return the key size of the given key object.
372 *
373 * @exception InvalidKeyException if <code>key</code> is invalid.
374 */
375 protected int engineGetKeySize(Key key) throws InvalidKeyException {
376 return (key.getEncoded().length * 8);
377 }
378
379 /**
380 * Wrap a key.
381 *
382 * @param key the key to be wrapped.
383 *
384 * @return the wrapped key.
385 *
386 * @exception IllegalBlockSizeException if this cipher is a block
387 * cipher, no padding has been requested, and the length of the
388 * encoding of the key to be wrapped is not a
389 * multiple of the block size.
390 *
391 * @exception InvalidKeyException if it is impossible or unsafe to
392 * wrap the key with this cipher (e.g., a hardware protected key is
393 * being passed to a software only cipher).
394 */
395 protected byte[] engineWrap(Key key)
396 throws IllegalBlockSizeException, InvalidKeyException {
397 return core.wrap(key);
398 }
399
400 /**
401 * Unwrap a previously wrapped key.
402 *
403 * @param wrappedKey the key to be unwrapped.
404 *
405 * @param wrappedKeyAlgorithm the algorithm the wrapped key is for.
406 *
407 * @param wrappedKeyType the type of the wrapped key.
408 * This is one of <code>Cipher.SECRET_KEY</code>,
409 * <code>Cipher.PRIVATE_KEY</code>, or <code>Cipher.PUBLIC_KEY</code>.
410 *
411 * @return the unwrapped key.
412 *
413 * @exception NoSuchAlgorithmException if no installed providers
414 * can create keys of type <code>wrappedKeyType</code> for the
415 * <code>wrappedKeyAlgorithm</code>.
416 *
417 * @exception InvalidKeyException if <code>wrappedKey</code> does not
418 * represent a wrapped key of type <code>wrappedKeyType</code> for
419 * the <code>wrappedKeyAlgorithm</code>.
420 */
421 protected Key engineUnwrap(byte[] wrappedKey,
422 String wrappedKeyAlgorithm,
423 int wrappedKeyType)
424 throws InvalidKeyException, NoSuchAlgorithmException {
425 return core.unwrap(wrappedKey, wrappedKeyAlgorithm,
426 wrappedKeyType);
427 }
428}
java/pkg/com/sun/crypto/provider/BlowfishConstants.java+41−0
@@ -0,0 +1,41 @@
1/*
2 * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26package com.sun.crypto.provider;
27
28/**
29 * This class defines the constants used by the Blowfish algorithm
30 * implementation.
31 *
32 * @author Jan Luehe
33 *
34 * @see BlowfishCipher
35 * @see BlowfishCrypt
36 */
37
38interface BlowfishConstants {
39 int BLOWFISH_BLOCK_SIZE = 8; // number of bytes
40 int BLOWFISH_MAX_KEYSIZE = 56; // number of bytes
41}
java/pkg/com/sun/crypto/provider/BlowfishCrypt.java+558−0
@@ -0,0 +1,558 @@
1/*
2 * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26package com.sun.crypto.provider;
27
28import java.security.InvalidKeyException;
29
30/**
31 * This is the internal Blowfish class responsible for encryption and
32 * decryption of a byte array of size <code>BLOWFISH_BLOCK_SIZE</code>.
33 *
34 * @author Jan Luehe
35 * @author David Brownell
36 *
37 * @see BlowfishCipher
38 */
39
40final class BlowfishCrypt extends SymmetricCipher
41 implements BlowfishConstants {
42
43 /*
44 * Are we encrypting or decrypting?
45 */
46 private boolean decrypting = false;
47
48 /**
49 * Gets this cipher's block size.
50 *
51 * @return this cipher's block size
52 */
53 int getBlockSize() {
54 return BLOWFISH_BLOCK_SIZE;
55 }
56
57 void init(boolean decrypting, String algorithm, byte[] rawKey)
58 throws InvalidKeyException {
59 this.decrypting = decrypting;
60 if (!algorithm.equalsIgnoreCase("Blowfish")) {
61 throw new InvalidKeyException("Wrong algorithm: Blowfish required");
62 }
63 if (rawKey.length > BLOWFISH_MAX_KEYSIZE) {
64 throw new InvalidKeyException("Key too long (> 448 bits)");
65 }
66 // Step 1: Init P and then S arrays from pi bytes
67 int i, j, count;
68
69 System.arraycopy(pi, 0, p, 0, 18);
70 System.arraycopy(pi, 18, s0, 0, 256);
71 System.arraycopy(pi, 18 + 256, s1, 0, 256);
72 System.arraycopy(pi, 18 + 512, s2, 0, 256);
73 System.arraycopy(pi, 18 + 768, s3, 0, 256);
74
75 // Step 2: XOR all parts of P with key data
76 int tmp = 0;
77 int nLen = rawKey.length;
78 int nKeyPos = 0;
79 for (i = 0; i < 18; i++) {
80 for (j = 0; j < 4; j++) {
81 tmp <<= 8;
82 tmp |= 0x0ff & rawKey[nKeyPos];
83 if (++nKeyPos == nLen) nKeyPos = 0;
84 }
85 p[i] ^= tmp;
86 }
87
88 // Steps 3-7: Replace all P, S values with computed values
89 int[] data = new int[2];
90
91 for (i = 0; i < 18; i+=2) {
92 encryptBlock(data);
93 p[i] = data[0];
94 p[i+1] = data[1];
95 }
96
97 for (j = 0; j < 256; j+=2) {
98 encryptBlock(data);
99 s0[j] = data[0];
100 s0[j+1] = data[1];
101 }
102 for (j = 0; j < 256; j+=2) {
103 encryptBlock(data);
104 s1[j] = data[0];
105 s1[j+1] = data[1];
106 }
107 for (j = 0; j < 256; j+=2) {
108 encryptBlock(data);
109 s2[j] = data[0];
110 s2[j+1] = data[1];
111 }
112 for (j = 0; j < 256; j+=2) {
113 encryptBlock(data);
114 s3[j] = data[0];
115 s3[j+1] = data[1];
116 }
117 }
118
119 /**
120 * Performs encryption operation.
121 *
122 * <p>The input plain text <code>plain</code>, starting at
123 * <code>plainOffset</code> and ending at
124 * <code>(plainOffset + len - 1)</code>, is encrypted.
125 * The result is stored in <code>cipher</code>, starting at
126 * <code>cipherOffset</code>.
127 *
128 * <p>The subclass that implements Cipher should ensure that
129 * <code>init</code> has been called before this method is called.
130 *
131 * @param plain the buffer with the input data to be encrypted
132 * @param plainOffset the offset in <code>plain</code>
133 * @param plainLen the length of the input data
134 * @param cipher the buffer for the result
135 * @param cipherOffset the offset in <code>cipher</code>
136 */
137 void encryptBlock(byte[] plain, int plainOffset,
138 byte[] cipher, int cipherOffset)
139 {
140 cipherBlock(plain, plainOffset, cipher, cipherOffset);
141 }
142
143 /**
144 * Performs decryption operation.
145 *
146 * <p>The input cipher text <code>cipher</code>, starting at
147 * <code>cipherOffset</code> and ending at
148 * <code>(cipherOffset + len - 1)</code>, is decrypted.
149 * The result is stored in <code>plain</code>, starting at
150 * <code>plainOffset</code>.
151 *
152 * <p>The subclass that implements Cipher should ensure that
153 * <code>init</code> has been called before this method is called.
154 *
155 * @param cipher the buffer with the input data to be decrypted
156 * @param cipherOffset the offset in <code>cipherOffset</code>
157 * @param cipherLen the length of the input data
158 * @param plain the buffer for the result
159 * @param plainOffset the offset in <code>plain</code>
160 */
161 void decryptBlock(byte[] cipher, int cipherOffset,
162 byte[] plain, int plainOffset)
163 {
164 cipherBlock(cipher, cipherOffset, plain, plainOffset);
165 }
166
167 /**
168 * Encrypts, or decrypts, the blocks of data passed in.
169 */
170 private void cipherBlock(byte[] in, int inOffset,
171 byte[] out, int outOffset) {
172 temp[0] = ((in[inOffset ] ) << 24) |
173 ((in[inOffset + 1] & 0xff) << 16) |
174 ((in[inOffset + 2] & 0xff) << 8) |
175 ((in[inOffset + 3] & 0xff) );
176
177 temp[1] = ((in[inOffset + 4] ) << 24) |
178 ((in[inOffset + 5] & 0xff) << 16) |
179 ((in[inOffset + 6] & 0xff) << 8) |
180 ((in[inOffset + 7] & 0xff) );
181
182 if (decrypting) {
183 decryptBlock(temp);
184 } else {
185 encryptBlock(temp);
186 }
187
188 int t = temp[0];
189 out[outOffset ] = (byte)(t >> 24);
190 out[outOffset + 1] = (byte)(t >> 16);
191 out[outOffset + 2] = (byte)(t >> 8);
192 out[outOffset + 3] = (byte)(t );
193
194 t = temp[1];
195 out[outOffset + 4] = (byte)(t >> 24);
196 out[outOffset + 5] = (byte)(t >> 16);
197 out[outOffset + 6] = (byte)(t >> 8);
198 out[outOffset + 7] = (byte)(t );
199 }
200
201 /**
202 * Encrypts a single block, in place.
203 */
204 private void encryptBlock(int[] value) {
205 int left = value[0];
206 int right = value[1];
207
208 left ^= p[0];
209
210 right ^= F(left) ^ p[1];
211 left ^= F(right) ^ p[2];
212 right ^= F(left) ^ p[3];
213 left ^= F(right) ^ p[4];
214
215 right ^= F(left) ^ p[5];
216 left ^= F(right) ^ p[6];
217 right ^= F(left) ^ p[7];
218 left ^= F(right) ^ p[8];
219
220 right ^= F(left) ^ p[9];
221 left ^= F(right) ^ p[10];
222 right ^= F(left) ^ p[11];
223 left ^= F(right) ^ p[12];
224
225 right ^= F(left) ^ p[13];
226 left ^= F(right) ^ p[14];
227 right ^= F(left) ^ p[15];
228 left ^= F(right) ^ p[16];
229
230 right ^= p[17];
231
232 value[0] = right;
233 value[1] = left;
234 }
235
236 /**
237 * Decrypts a single block, in place.
238 */
239 private void decryptBlock(int[] value) {
240 int left = value[1];
241 int right = value[0];
242
243 right ^= p[17];
244
245 left ^= p[16] ^ F(right);
246 right ^= p[15] ^ F(left);
247 left ^= p[14] ^ F(right);
248 right ^= p[13] ^ F(left);
249
250 left ^= p[12] ^ F(right);
251 right ^= p[11] ^ F(left);
252 left ^= p[10] ^ F(right);
253 right ^= p[9] ^ F(left);
254
255 left ^= p[8] ^ F(right);
256 right ^= p[7] ^ F(left);
257 left ^= p[6] ^ F(right);
258 right ^= p[5] ^ F(left);
259
260 left ^= p[4] ^ F(right);
261 right ^= p[3] ^ F(left);
262 left ^= p[2] ^ F(right);
263 right ^= p[1] ^ F(left);
264
265 left ^= p[0];
266
267 value[0] = left;
268 value[1] = right;
269 }
270
271 /**
272 * Calculates the S-Box function F().
273 *
274 * This gets used "rounds" times on each encryption/decryption.
275 */
276 private int F(int v) {
277 return (( s0[ v >>> 24 ]
278 + s1[(v >> 16) & 0xff])
279 ^ s2[(v >> 8) & 0xff])
280 + s3[ v & 0xff];
281 }
282
283 private final int[] p = new int[18]; // subkeys
284 private final int[] s0 = new int[256]; // s-boxes
285 private final int[] s1 = new int[256];
286 private final int[] s2 = new int[256];
287 private final int[] s3 = new int[256];
288 private final int[] temp = new int[2]; // to avoid encrypt/decrypt mallocs
289
290 // many digits of pi, for initializing p and s
291 private static final int[] pi = {
292
293 // p [rounds + 2]
294 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344,
295 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89,
296 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c,
297 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917,
298 0x9216d5d9, 0x8979fb1b,
299
300 // s [4][256]
301 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7,
302 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99,
303 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16,
304 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e,
305 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee,
306 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013,
307 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef,
308 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e,
309 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60,
310 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440,
311 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce,
312 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a,
313 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e,
314 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677,
315 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193,
316 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032,
317 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88,
318 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239,
319 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e,
320 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0,
321 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3,
322 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98,
323 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88,
324 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe,
325 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6,
326 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d,
327 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b,
328 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7,
329 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba,
330 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463,
331 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f,
332 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09,
333 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3,
334 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb,
335 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279,
336 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8,
337 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab,
338 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82,
339 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db,
340 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573,
341 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0,
342 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b,
343 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790,
344 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8,
345 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4,
346 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0,
347 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7,
348 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c,
349 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad,
350 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1,
351 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299,
352 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9,
353 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477,
354 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf,
355 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49,
356 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af,
357 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa,
358 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5,
359 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41,
360 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915,
361 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400,
362 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915,
363 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664,
364 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a,
365 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623,
366 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266,
367 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1,
368 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e,
369 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6,
370 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1,
371 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e,
372 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1,
373 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737,
374 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8,
375 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff,
376 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd,
377 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701,
378 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7,
379 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41,
380 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331,
381 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf,
382 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af,
383 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e,
384 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87,
385 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c,
386 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2,
387 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16,
388 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd,
389 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b,
390 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509,
391 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e,
392 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3,
393 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f,
394 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a,
395 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4,
396 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960,
397 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66,
398 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28,
399 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802,
400 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84,
401 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510,
402 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf,
403 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14,
404 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e,
405 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50,
406 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7,
407 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8,
408 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281,
409 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99,
410 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696,
411 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128,
412 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73,
413 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0,
414 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0,
415 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105,
416 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250,
417 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3,
418 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285,
419 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00,
420 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061,
421 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb,
422 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e,
423 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735,
424 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc,
425 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9,
426 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340,
427 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20,
428 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7,
429 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934,
430 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068,
431 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af,
432 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840,
433 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45,
434 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504,
435 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a,
436 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb,
437 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee,
438 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6,
439 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42,
440 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b,
441 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2,
442 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb,
443 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527,
444 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b,
445 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33,
446 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c,
447 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3,
448 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc,
449 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17,
450 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564,
451 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b,
452 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115,
453 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922,
454 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728,
455 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0,
456 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e,
457 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37,
458 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d,
459 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804,
460 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b,
461 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3,
462 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb,
463 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d,
464 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c,
465 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350,
466 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9,
467 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a,
468 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe,
469 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d,
470 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc,
471 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f,
472 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61,
473 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2,
474 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9,
475 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2,
476 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c,
477 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e,
478 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633,
479 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10,
480 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169,
481 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52,
482 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027,
483 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5,
484 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62,
485 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634,
486 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76,
487 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24,
488 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc,
489 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4,
490 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c,
491 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837,
492 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0,
493 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b,
494 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe,
495 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b,
496 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4,
497 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8,
498 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6,
499 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304,
500 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22,
501 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4,
502 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6,
503 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9,
504 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59,
505 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593,
506 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51,
507 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28,
508 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c,
509 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b,
510 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28,
511 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c,
512 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd,
513 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a,
514 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319,
515 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb,
516 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f,
517 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991,
518 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32,
519 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680,
520 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166,
521 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae,
522 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb,
523 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5,
524 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47,
525 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370,
526 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d,
527 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84,
528 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048,
529 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8,
530 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd,
531 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9,
532 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7,
533 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38,
534 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f,
535 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c,
536 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525,
537 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1,
538 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442,
539 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964,
540 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e,
541 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8,
542 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d,
543 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f,
544 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299,
545 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02,
546 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc,
547 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614,
548 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a,
549 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6,
550 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b,
551 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0,
552 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060,
553 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e,
554 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9,
555 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f,
556 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6,
557 };
558}
java/pkg/com/sun/crypto/provider/BlowfishKeyGenerator.java+115−0
@@ -0,0 +1,115 @@
1/*
2 * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26package com.sun.crypto.provider;
27
28import java.security.SecureRandom;
29import java.security.InvalidParameterException;
30import java.security.InvalidAlgorithmParameterException;
31import java.security.spec.AlgorithmParameterSpec;
32import javax.crypto.KeyGeneratorSpi;
33import javax.crypto.SecretKey;
34import javax.crypto.spec.SecretKeySpec;
35
36/**
37 * This class generates a secret key for use with the Blowfish algorithm.
38 *
39 * @author Jan Luehe
40 *
41 */
42
43public final class BlowfishKeyGenerator extends KeyGeneratorSpi {
44
45 private SecureRandom random = null;
46 private int keysize = 16; // default keysize (in number of bytes)
47
48 /**
49 * Empty constructor
50 */
51 public BlowfishKeyGenerator() {
52 }
53
54 /**
55 * Initializes this key generator.
56 *
57 * @param random the source of randomness for this generator
58 */
59 protected void engineInit(SecureRandom random) {
60 this.random = random;
61 }
62
63 /**
64 * Initializes this key generator with the specified parameter
65 * set and a user-provided source of randomness.
66 *
67 * @param params the key generation parameters
68 * @param random the source of randomness for this key generator
69 *
70 * @exception InvalidAlgorithmParameterException if <code>params</code> is
71 * inappropriate for this key generator
72 */
73 protected void engineInit(AlgorithmParameterSpec params,
74 SecureRandom random)
75 throws InvalidAlgorithmParameterException
76 {
77 throw new InvalidAlgorithmParameterException
78 ("Blowfish key generation does not take any parameters");
79 }
80
81 /**
82 * Initializes this key generator for a certain keysize, using the given
83 * source of randomness.
84 *
85 * @param keysize the keysize. This is an algorithm-specific
86 * metric specified in number of bits.
87 * @param random the source of randomness for this key generator
88 */
89 protected void engineInit(int keysize, SecureRandom random) {
90 if (((keysize % 8) != 0) || (keysize < 32) || (keysize > 448)) {
91 throw new InvalidParameterException("Keysize must be "
92 + "multiple of 8, and can "
93 + "only range from 32 to 448 "
94 + "(inclusive)");
95 }
96 this.keysize = keysize / 8;
97 this.engineInit(random);
98 }
99
100 /**
101 * Generates a Blowfish key.
102 *
103 * @return the new Blowfish key
104 */
105 protected SecretKey engineGenerateKey() {
106 if (this.random == null) {
107 this.random = SunJCE.RANDOM;
108 }
109
110 byte[] keyBytes = new byte[this.keysize];
111 this.random.nextBytes(keyBytes);
112
113 return new SecretKeySpec(keyBytes, "Blowfish");
114 }
115}
java/pkg/com/sun/crypto/provider/BlowfishParameters.java+88−0
@@ -0,0 +1,88 @@
1/*
2 * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26package com.sun.crypto.provider;
27
28import java.util.*;
29import java.io.*;
30import sun.security.util.*;
31import java.security.AlgorithmParametersSpi;
32import java.security.spec.AlgorithmParameterSpec;
33import java.security.spec.InvalidParameterSpecException;
34import javax.crypto.spec.IvParameterSpec;
35
36/**
37 * This class implements the parameter (IV) used with the Blowfish algorithm in
38 * feedback-mode. IV is defined in the standards as follows:
39 *
40 * <pre>
41 * IV ::= OCTET STRING -- 8 octets
42 * </pre>
43 *
44 * @author Jan Luehe
45 *
46 */
47
48public final class BlowfishParameters extends AlgorithmParametersSpi {
49
50 private BlockCipherParamsCore core;
51
52 public BlowfishParameters() {
53 core = new BlockCipherParamsCore
54 (BlowfishConstants.BLOWFISH_BLOCK_SIZE);
55 }
56 protected void engineInit(AlgorithmParameterSpec paramSpec)
57 throws InvalidParameterSpecException {
58 core.init(paramSpec);
59 }
60
61 protected void engineInit(byte[] encoded)
62 throws IOException {
63 core.init(encoded);
64 }
65
66 protected void engineInit(byte[] encoded, String decodingMethod)
67 throws IOException {
68 core.init(encoded, decodingMethod);
69 }
70
71 protected AlgorithmParameterSpec engineGetParameterSpec(Class paramSpec)
72 throws InvalidParameterSpecException {
73 return core.getParameterSpec(paramSpec);
74 }
75
76 protected byte[] engineGetEncoded() throws IOException {
77 return core.getEncoded();
78 }
79
80 protected byte[] engineGetEncoded(String encodingMethod)
81 throws IOException {
82 return core.getEncoded();
83 }
84
85 protected String engineToString() {
86 return core.toString();
87 }
88}
java/pkg/com/sun/crypto/provider/CipherBlockChaining.java+212−0
@@ -0,0 +1,212 @@
1/*
2 * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26package com.sun.crypto.provider;
27
28import java.security.InvalidKeyException;
29
30/**
31 * This class represents ciphers in cipher block chaining (CBC) mode.
32 *
33 * <p>This mode is implemented independently of a particular cipher.
34 * Ciphers to which this mode should apply (e.g., DES) must be
35 * <i>plugged-in</i> using the constructor.
36 *
37 * <p>NOTE: This class does not deal with buffering or padding.
38 *
39 * @author Gigi Ankeny
40 */
41
42class CipherBlockChaining extends FeedbackCipher {
43
44 /*
45 * random bytes that are initialized with iv
46 */
47 protected byte[] r;
48
49 /*
50 * output buffer
51 */
52 private byte[] k;
53
54 // variables for save/restore calls
55 private byte[] rSave = null;
56
57 CipherBlockChaining(SymmetricCipher embeddedCipher) {
58 super(embeddedCipher);
59 k = new byte[blockSize];
60 r = new byte[blockSize];
61 }
62
63 /**
64 * Gets the name of this feedback mode.
65 *
66 * @return the string <code>CBC</code>
67 */
68 String getFeedback() {
69 return "CBC";
70 }
71
72 /**
73 * Initializes the cipher in the specified mode with the given key
74 * and iv.
75 *
76 * @param decrypting flag indicating encryption or decryption
77 * @param algorithm the algorithm name
78 * @param key the key
79 * @param iv the iv
80 *
81 * @exception InvalidKeyException if the given key is inappropriate for
82 * initializing this cipher
83 */
84 void init(boolean decrypting, String algorithm, byte[] key, byte[] iv)
85 throws InvalidKeyException {
86 if ((key == null) || (iv == null) || (iv.length != blockSize)) {
87 throw new InvalidKeyException("Internal error");
88 }
89 this.iv = iv;
90 reset();
91 embeddedCipher.init(decrypting, algorithm, key);
92 }
93
94 /**
95 * Resets the iv to its original value.
96 * This is used when doFinal is called in the Cipher class, so that the
97 * cipher can be reused (with its original iv).
98 */
99 void reset() {
100 System.arraycopy(iv, 0, r, 0, blockSize);
101 }
102
103 /**
104 * Save the current content of this cipher.
105 */
106 void save() {
107 if (rSave == null) {
108 rSave = new byte[blockSize];
109 }
110 System.arraycopy(r, 0, rSave, 0, blockSize);
111 }
112
113 /**
114 * Restores the content of this cipher to the previous saved one.
115 */
116 void restore() {
117 System.arraycopy(rSave, 0, r, 0, blockSize);
118 }
119
120 /**
121 * Performs encryption operation.
122 *
123 * <p>The input plain text <code>plain</code>, starting at
124 * <code>plainOffset</code> and ending at
125 * <code>(plainOffset + len - 1)</code>, is encrypted.
126 * The result is stored in <code>cipher</code>, starting at
127 * <code>cipherOffset</code>.
128 *
129 * <p>It is the application's responsibility to make sure that
130 * <code>plainLen</code> is a multiple of the embedded cipher's block size,
131 * as any excess bytes are ignored.
132 *
133 * @param plain the buffer with the input data to be encrypted
134 * @param plainOffset the offset in <code>plain</code>
135 * @param plainLen the length of the input data
136 * @param cipher the buffer for the result
137 * @param cipherOffset the offset in <code>cipher</code>
138 */
139 void encrypt(byte[] plain, int plainOffset, int plainLen,
140 byte[] cipher, int cipherOffset)
141 {
142 int i;
143 int endIndex = plainOffset + plainLen;
144
145 for (; plainOffset < endIndex;
146 plainOffset+=blockSize, cipherOffset += blockSize) {
147 for (i=0; i<blockSize; i++) {
148 k[i] = (byte)(plain[i+plainOffset] ^ r[i]);
149 }
150 embeddedCipher.encryptBlock(k, 0, cipher, cipherOffset);
151 System.arraycopy(cipher, cipherOffset, r, 0, blockSize);
152 }
153 }
154
155 /**
156 * Performs decryption operation.
157 *
158 * <p>The input cipher text <code>cipher</code>, starting at
159 * <code>cipherOffset</code> and ending at
160 * <code>(cipherOffset + len - 1)</code>, is decrypted.
161 * The result is stored in <code>plain</code>, starting at
162 * <code>plainOffset</code>.
163 *
164 * <p>It is the application's responsibility to make sure that
165 * <code>cipherLen</code> is a multiple of the embedded cipher's block
166 * size, as any excess bytes are ignored.
167 *
168 * <p>It is also the application's responsibility to make sure that
169 * <code>init</code> has been called before this method is called.
170 * (This check is omitted here, to avoid double checking.)
171 *
172 * @param cipher the buffer with the input data to be decrypted
173 * @param cipherOffset the offset in <code>cipherOffset</code>
174 * @param cipherLen the length of the input data
175 * @param plain the buffer for the result
176 * @param plainOffset the offset in <code>plain</code>
177 *
178 * @exception IllegalBlockSizeException if input data whose length does
179 * not correspond to the embedded cipher's block size is passed to the
180 * embedded cipher
181 */
182 void decrypt(byte[] cipher, int cipherOffset, int cipherLen,
183 byte[] plain, int plainOffset)
184 {
185 int i;
186 byte[] cipherOrig=null;
187 int endIndex = cipherOffset + cipherLen;
188
189 if (cipher==plain && (cipherOffset >= plainOffset)
190 && ((cipherOffset - plainOffset) < blockSize)) {
191 // Save the original ciphertext blocks, so they can be
192 // stored in the feedback register "r".
193 // This is necessary because in this constellation, a
194 // ciphertext block (or parts of it) will be overridden by
195 // the plaintext result.
196 cipherOrig = (byte[])cipher.clone();
197 }
198
199 for (; cipherOffset < endIndex;
200 cipherOffset += blockSize, plainOffset += blockSize) {
201 embeddedCipher.decryptBlock(cipher, cipherOffset, k, 0);
202 for (i = 0; i < blockSize; i++) {
203 plain[i+plainOffset] = (byte)(k[i] ^ r[i]);
204 }
205 if (cipherOrig==null) {
206 System.arraycopy(cipher, cipherOffset, r, 0, blockSize);
207 } else {
208 System.arraycopy(cipherOrig, cipherOffset, r, 0, blockSize);
209 }
210 }
211 }
212}
java/pkg/com/sun/crypto/provider/CipherCore.java+943−0
@@ -0,0 +1,943 @@
1/*
2 * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26package com.sun.crypto.provider;
27
28import java.util.Locale;
29
30import java.security.*;
31import java.security.spec.*;
32import javax.crypto.*;
33import javax.crypto.spec.*;
34import javax.crypto.BadPaddingException;
35
36/**
37 * This class represents the symmetric algorithms in its various modes
38 * (<code>ECB</code>, <code>CFB</code>, <code>OFB</code>, <code>CBC</code>,
39 * <code>PCBC</code>, <code>CTR</code>, and <code>CTS</code>) and
40 * padding schemes (<code>PKCS5Padding</code>, <code>NoPadding</code>,
41 * <code>ISO10126Padding</code>).
42 *
43 * @author Gigi Ankeny
44 * @author Jan Luehe
45 * @see ElectronicCodeBook
46 * @see CipherFeedback
47 * @see OutputFeedback
48 * @see CipherBlockChaining
49 * @see PCBC
50 * @see CounterMode
51 * @see CipherTextStealing
52 */
53
54final class CipherCore {
55
56 /*
57 * internal buffer
58 */
59 private byte[] buffer = null;
60
61 /*
62 * internal buffer
63 */
64 private int blockSize = 0;
65
66 /*
67 * unit size (number of input bytes that can be processed at a time)
68 */
69 private int unitBytes = 0;
70
71 /*
72 * index of the content size left in the buffer
73 */
74 private int buffered = 0;
75
76 /*
77 * minimum number of bytes in the buffer required for
78 * FeedbackCipher.encryptFinal()/decryptFinal() call.
79 * update() must buffer this many bytes before before starting
80 * to encrypt/decrypt data.
81 * currently, only CTS mode has a non-zero value due to its special
82 * handling on the last two blocks (the last one may be incomplete).
83 */
84 private int minBytes = 0;
85
86 /*
87 * number of bytes needed to make the total input length a multiple
88 * of the blocksize (this is used in feedback mode, when the number of
89 * input bytes that are processed at a time is different from the block
90 * size)
91 */
92 private int diffBlocksize = 0;
93
94 /*
95 * padding class
96 */
97 private Padding padding = null;
98
99 /*
100 * internal cipher engine
101 */
102 private FeedbackCipher cipher = null;
103
104 /*
105 * the cipher mode
106 */
107 private int cipherMode = ECB_MODE;
108
109 /*
110 * are we encrypting or decrypting?
111 */
112 private boolean decrypting = false;
113
114 /*
115 * Block Mode constants
116 */
117 private static final int ECB_MODE = 0;
118 private static final int CBC_MODE = 1;
119 private static final int CFB_MODE = 2;
120 private static final int OFB_MODE = 3;
121 private static final int PCBC_MODE = 4;
122 private static final int CTR_MODE = 5;
123 private static final int CTS_MODE = 6;
124
125 /**
126 * Creates an instance of CipherCore with default ECB mode and
127 * PKCS5Padding.
128 */
129 CipherCore(SymmetricCipher impl, int blkSize) {
130 blockSize = blkSize;
131 unitBytes = blkSize;
132 diffBlocksize = blkSize;
133
134 /*
135 * The buffer should be usable for all cipher mode and padding
136 * schemes. Thus, it has to be at least (blockSize+1) for CTS.
137 * In decryption mode, it also hold the possible padding block.
138 */
139 buffer = new byte[blockSize*2];
140
141 // set mode and padding
142 cipher = new ElectronicCodeBook(impl);
143 padding = new PKCS5Padding(blockSize);
144 }
145
146 /**
147 * Sets the mode of this cipher.
148 *
149 * @param mode the cipher mode
150 *
151 * @exception NoSuchAlgorithmException if the requested cipher mode does
152 * not exist
153 */
154 void setMode(String mode) throws NoSuchAlgorithmException {
155 if (mode == null)
156 throw new NoSuchAlgorithmException("null mode");
157
158 String modeUpperCase = mode.toUpperCase(Locale.ENGLISH);
159
160 if (modeUpperCase.equals("ECB")) {
161 return;
162 }
163
164 SymmetricCipher rawImpl = cipher.getEmbeddedCipher();
165 if (modeUpperCase.equals("CBC")) {
166 cipherMode = CBC_MODE;
167 cipher = new CipherBlockChaining(rawImpl);
168 }
169 else if (modeUpperCase.equals("CTS")) {
170 cipherMode = CTS_MODE;
171 cipher = new CipherTextStealing(rawImpl);
172 minBytes = blockSize+1;
173 padding = null;
174 }
175 else if (modeUpperCase.equals("CTR")) {
176 cipherMode = CTR_MODE;
177 cipher = new CounterMode(rawImpl);
178 unitBytes = 1;
179 padding = null;
180 }
181 else if (modeUpperCase.startsWith("CFB")) {
182 cipherMode = CFB_MODE;
183 unitBytes = getNumOfUnit(mode, "CFB".length(), blockSize);
184 cipher = new CipherFeedback(rawImpl, unitBytes);
185 }
186 else if (modeUpperCase.startsWith("OFB")) {
187 cipherMode = OFB_MODE;
188 unitBytes = getNumOfUnit(mode, "OFB".length(), blockSize);
189 cipher = new OutputFeedback(rawImpl, unitBytes);
190 }
191 else if (modeUpperCase.equals("PCBC")) {
192 cipherMode = PCBC_MODE;
193 cipher = new PCBC(rawImpl);
194 }
195 else {
196 throw new NoSuchAlgorithmException("Cipher mode: " + mode
197 + " not found");
198 }
199 }
200
201 private static int getNumOfUnit(String mode, int offset, int blockSize)
202 throws NoSuchAlgorithmException {
203 int result = blockSize; // use blockSize as default value
204 if (mode.length() > offset) {
205 int numInt;
206 try {
207 Integer num = Integer.valueOf(mode.substring(offset));
208 numInt = num.intValue();
209 result = numInt >> 3;
210 } catch (NumberFormatException e) {
211 throw new NoSuchAlgorithmException
212 ("Algorithm mode: " + mode + " not implemented");
213 }
214 if ((numInt % 8 != 0) || (result > blockSize)) {
215 throw new NoSuchAlgorithmException
216 ("Invalid algorithm mode: " + mode);
217 }
218 }
219 return result;
220 }
221
222 /**
223 * Sets the padding mechanism of this cipher.
224 *
225 * @param padding the padding mechanism
226 *
227 * @exception NoSuchPaddingException if the requested padding mechanism
228 * does not exist
229 */
230 void setPadding(String paddingScheme)
231 throws NoSuchPaddingException
232 {
233 if (paddingScheme == null) {
234 throw new NoSuchPaddingException("null padding");
235 }
236 if (paddingScheme.equalsIgnoreCase("NoPadding")) {
237 padding = null;
238 } else if (paddingScheme.equalsIgnoreCase("ISO10126Padding")) {
239 padding = new ISO10126Padding(blockSize);
240 } else if (!paddingScheme.equalsIgnoreCase("PKCS5Padding")) {
241 throw new NoSuchPaddingException("Padding: " + paddingScheme
242 + " not implemented");
243 }
244 if ((padding != null) &&
245 ((cipherMode == CTR_MODE) || (cipherMode == CTS_MODE))) {
246 padding = null;
247 throw new NoSuchPaddingException
248 ((cipherMode == CTR_MODE? "CTR":"CTS") +
249 " mode must be used with NoPadding");
250 }
251 }
252
253 /**
254 * Returns the length in bytes that an output buffer would need to be in
255 * order to hold the result of the next <code>update</code> or
256 * <code>doFinal</code> operation, given the input length
257 * <code>inputLen</code> (in bytes).
258 *
259 * <p>This call takes into account any unprocessed (buffered) data from a
260 * previous <code>update</code> call, and padding.
261 *
262 * <p>The actual output length of the next <code>update</code> or
263 * <code>doFinal</code> call may be smaller than the length returned by
264 * this method.
265 *
266 * @param inputLen the input length (in bytes)
267 *
268 * @return the required output buffer size (in bytes)
269 */
270 int getOutputSize(int inputLen) {
271 int totalLen = buffered + inputLen;
272
273 if (padding == null)
274 return totalLen;
275
276 if (decrypting)
277 return totalLen;
278
279 if (unitBytes != blockSize) {
280 if (totalLen < diffBlocksize)
281 return diffBlocksize;
282 else
283 return (totalLen + blockSize -
284 ((totalLen - diffBlocksize) % blockSize));
285 } else {
286 return totalLen + padding.padLength(totalLen);
287 }
288 }
289
290 /**
291 * Returns the initialization vector (IV) in a new buffer.
292 *
293 * <p>This is useful in the case where a random IV has been created
294 * (see <a href = "#init">init</a>),
295 * or in the context of password-based encryption or
296 * decryption, where the IV is derived from a user-provided password.
297 *
298 * @return the initialization vector in a new buffer, or null if the
299 * underlying algorithm does not use an IV, or if the IV has not yet
300 * been set.
301 */
302 byte[] getIV() {
303 byte[] iv = cipher.getIV();
304 return (iv == null) ? null : (byte[])iv.clone();
305 }
306
307 /**
308 * Returns the parameters used with this cipher.
309 *
310 * <p>The returned parameters may be the same that were used to initialize
311 * this cipher, or may contain the default set of parameters or a set of
312 * randomly generated parameters used by the underlying cipher
313 * implementation (provided that the underlying cipher implementation
314 * uses a default set of parameters or creates new parameters if it needs
315 * parameters but was not initialized with any).
316 *
317 * @return the parameters used with this cipher, or null if this cipher
318 * does not use any parameters.
319 */
320 AlgorithmParameters getParameters(String algName) {
321 AlgorithmParameters params = null;
322 if (cipherMode == ECB_MODE) return null;
323 byte[] iv = getIV();
324 if (iv != null) {
325 AlgorithmParameterSpec ivSpec;
326 if (algName.equals("RC2")) {
327 RC2Crypt rawImpl = (RC2Crypt) cipher.getEmbeddedCipher();
328 ivSpec = new RC2ParameterSpec(rawImpl.getEffectiveKeyBits(),
329 iv);
330 } else {
331 ivSpec = new IvParameterSpec(iv);
332 }
333 try {
334 params = AlgorithmParameters.getInstance(algName, "SunJCE");
335 } catch (NoSuchAlgorithmException nsae) {
336 // should never happen
337 throw new RuntimeException("Cannot find " + algName +
338 " AlgorithmParameters implementation in SunJCE provider");
339 } catch (NoSuchProviderException nspe) {
340 // should never happen
341 throw new RuntimeException("Cannot find SunJCE provider");
342 }
343 try {
344 params.init(ivSpec);
345 } catch (InvalidParameterSpecException ipse) {
346 // should never happen
347 throw new RuntimeException("IvParameterSpec not supported");
348 }
349 }
350 return params;
351 }
352
353 /**
354 * Initializes this cipher with a key and a source of randomness.
355 *
356 * <p>The cipher is initialized for one of the following four operations:
357 * encryption, decryption, key wrapping or key unwrapping, depending on
358 * the value of <code>opmode</code>.
359 *
360 * <p>If this cipher requires an initialization vector (IV), it will get
361 * it from <code>random</code>.
362 * This behaviour should only be used in encryption or key wrapping
363 * mode, however.
364 * When initializing a cipher that requires an IV for decryption or
365 * key unwrapping, the IV
366 * (same IV that was used for encryption or key wrapping) must be provided
367 * explicitly as a
368 * parameter, in order to get the correct result.
369 *
370 * <p>This method also cleans existing buffer and other related state
371 * information.
372 *
373 * @param opmode the operation mode of this cipher (this is one of
374 * the following:
375 * <code>ENCRYPT_MODE</code>, <code>DECRYPT_MODE</code>,
376 * <code>WRAP_MODE</code> or <code>UNWRAP_MODE</code>)
377 * @param key the secret key
378 * @param random the source of randomness
379 *
380 * @exception InvalidKeyException if the given key is inappropriate for
381 * initializing this cipher
382 */
383 void init(int opmode, Key key, SecureRandom random)
384 throws InvalidKeyException {
385 try {
386 init(opmode, key, (AlgorithmParameterSpec)null, random);
387 } catch (InvalidAlgorithmParameterException e) {
388 throw new InvalidKeyException(e.getMessage());
389 }
390 }
391
392 /**
393 * Initializes this cipher with a key, a set of
394 * algorithm parameters, and a source of randomness.
395 *
396 * <p>The cipher is initialized for one of the following four operations:
397 * encryption, decryption, key wrapping or key unwrapping, depending on
398 * the value of <code>opmode</code>.
399 *
400 * <p>If this cipher (including its underlying feedback or padding scheme)
401 * requires any random bytes, it will get them from <code>random</code>.
402 *
403 * @param opmode the operation mode of this cipher (this is one of
404 * the following:
405 * <code>ENCRYPT_MODE</code>, <code>DECRYPT_MODE</code>,
406 * <code>WRAP_MODE</code> or <code>UNWRAP_MODE</code>)
407 * @param key the encryption key
408 * @param params the algorithm parameters
409 * @param random the source of randomness
410 *
411 * @exception InvalidKeyException if the given key is inappropriate for
412 * initializing this cipher
413 * @exception InvalidAlgorithmParameterException if the given algorithm
414 * parameters are inappropriate for this cipher
415 */
416 void init(int opmode, Key key, AlgorithmParameterSpec params,
417 SecureRandom random)
418 throws InvalidKeyException, InvalidAlgorithmParameterException {
419 decrypting = (opmode == Cipher.DECRYPT_MODE)
420 || (opmode == Cipher.UNWRAP_MODE);
421
422 byte[] keyBytes = getKeyBytes(key);
423
424 byte[] ivBytes;
425 if (params == null) {
426 ivBytes = null;
427 } else if (params instanceof IvParameterSpec) {
428 ivBytes = ((IvParameterSpec)params).getIV();
429 if ((ivBytes == null) || (ivBytes.length != blockSize)) {
430 throw new InvalidAlgorithmParameterException
431 ("Wrong IV length: must be " + blockSize +
432 " bytes long");
433 }
434 } else if (params instanceof RC2ParameterSpec) {
435 ivBytes = ((RC2ParameterSpec)params).getIV();
436 if ((ivBytes != null) && (ivBytes.length != blockSize)) {
437 throw new InvalidAlgorithmParameterException
438 ("Wrong IV length: must be " + blockSize +
439 " bytes long");
440 }
441 } else {
442 throw new InvalidAlgorithmParameterException("Wrong parameter "
443 + "type: IV "
444 + "expected");
445 }
446
447 if (cipherMode == ECB_MODE) {
448 if (ivBytes != null) {
449 throw new InvalidAlgorithmParameterException
450 ("ECB mode cannot use IV");
451 }
452 } else if (ivBytes == null) {
453 if (decrypting) {
454 throw new InvalidAlgorithmParameterException("Parameters "
455 + "missing");
456 }
457 if (random == null) {
458 random = SunJCE.RANDOM;
459 }
460 ivBytes = new byte[blockSize];
461 random.nextBytes(ivBytes);
462 }
463
464 buffered = 0;
465 diffBlocksize = blockSize;
466
467 String algorithm = key.getAlgorithm();
468
469 cipher.init(decrypting, algorithm, keyBytes, ivBytes);
470 }
471
472 void init(int opmode, Key key, AlgorithmParameters params,
473 SecureRandom random)
474 throws InvalidKeyException, InvalidAlgorithmParameterException {
475 IvParameterSpec ivSpec = null;
476 if (params != null) {
477 try {
478 ivSpec = (IvParameterSpec)params.getParameterSpec
479 (IvParameterSpec.class);
480 } catch (InvalidParameterSpecException ipse) {
481 throw new InvalidAlgorithmParameterException("Wrong parameter "
482 + "type: IV "
483 + "expected");
484 }
485 }
486 init(opmode, key, ivSpec, random);
487 }
488
489 /**
490 * Return the key bytes of the specified key. Throw an InvalidKeyException
491 * if the key is not usable.
492 */
493 static byte[] getKeyBytes(Key key) throws InvalidKeyException {
494 if (key == null) {
495 throw new InvalidKeyException("No key given");
496 }
497 // note: key.getFormat() may return null
498 if (!"RAW".equalsIgnoreCase(key.getFormat())) {
499 throw new InvalidKeyException("Wrong format: RAW bytes needed");
500 }
501 byte[] keyBytes = key.getEncoded();
502 if (keyBytes == null) {
503 throw new InvalidKeyException("RAW key bytes missing");
504 }
505 return keyBytes;
506 }
507
508 /**
509 * Continues a multiple-part encryption or decryption operation
510 * (depending on how this cipher was initialized), processing another data
511 * part.
512 *
513 * <p>The first <code>inputLen</code> bytes in the <code>input</code>
514 * buffer, starting at <code>inputOffset</code>, are processed, and the
515 * result is stored in a new buffer.
516 *
517 * @param input the input buffer
518 * @param inputOffset the offset in <code>input</code> where the input
519 * starts
520 * @param inputLen the input length
521 *
522 * @return the new buffer with the result
523 *
524 * @exception IllegalStateException if this cipher is in a wrong state
525 * (e.g., has not been initialized)
526 */
527 byte[] update(byte[] input, int inputOffset, int inputLen) {
528 byte[] output = null;
529 byte[] out = null;
530 try {
531 output = new byte[getOutputSize(inputLen)];
532 int len = update(input, inputOffset, inputLen, output,
533 0);
534 if (len == output.length) {
535 out = output;
536 } else {
537 out = new byte[len];
538 System.arraycopy(output, 0, out, 0, len);
539 }
540 } catch (ShortBufferException e) {
541 // never thrown
542 }
543 return out;
544 }
545
546 /**
547 * Continues a multiple-part encryption or decryption operation
548 * (depending on how this cipher was initialized), processing another data
549 * part.
550 *
551 * <p>The first <code>inputLen</code> bytes in the <code>input</code>
552 * buffer, starting at <code>inputOffset</code>, are processed, and the
553 * result is stored in the <code>output</code> buffer, starting at
554 * <code>outputOffset</code>.
555 *
556 * @param input the input buffer
557 * @param inputOffset the offset in <code>input</code> where the input
558 * starts
559 * @param inputLen the input length
560 * @param output the buffer for the result
561 * @param outputOffset the offset in <code>output</code> where the result
562 * is stored
563 *
564 * @return the number of bytes stored in <code>output</code>
565 *
566 * @exception ShortBufferException if the given output buffer is too small
567 * to hold the result
568 */
569 int update(byte[] input, int inputOffset, int inputLen, byte[] output,
570 int outputOffset) throws ShortBufferException {
571 // figure out how much can be sent to crypto function
572 int len = buffered + inputLen - minBytes;
573 if (padding != null && decrypting) {
574 // do not include the padding bytes when decrypting
575 len -= blockSize;
576 }
577 // do not count the trailing bytes which do not make up a unit
578 len = (len > 0 ? (len - (len%unitBytes)) : 0);
579
580 // check output buffer capacity
581 if ((output == null) || ((output.length - outputOffset) < len)) {
582 throw new ShortBufferException("Output buffer must be "
583 + "(at least) " + len
584 + " bytes long");
585 }
586 if (len != 0) {
587 // there is some work to do
588 byte[] in = new byte[len];
589
590 int inputConsumed = len - buffered;
591 int bufferedConsumed = buffered;
592 if (inputConsumed < 0) {
593 inputConsumed = 0;
594 bufferedConsumed = len;
595 }
596
597 if (buffered != 0) {
598 System.arraycopy(buffer, 0, in, 0, bufferedConsumed);
599 }
600 if (inputConsumed > 0) {
601 System.arraycopy(input, inputOffset, in,
602 bufferedConsumed, inputConsumed);
603 }
604
605 if (decrypting) {
606 cipher.decrypt(in, 0, len, output, outputOffset);
607 } else {
608 cipher.encrypt(in, 0, len, output, outputOffset);
609 }
610
611 // Let's keep track of how many bytes are needed to make
612 // the total input length a multiple of blocksize when
613 // padding is applied
614 if (unitBytes != blockSize) {
615 if (len < diffBlocksize)
616 diffBlocksize -= len;
617 else
618 diffBlocksize = blockSize -
619 ((len - diffBlocksize) % blockSize);
620 }
621
622 inputLen -= inputConsumed;
623 inputOffset += inputConsumed;
624 outputOffset += len;
625 buffered -= bufferedConsumed;
626 if (buffered > 0) {
627 System.arraycopy(buffer, bufferedConsumed, buffer, 0,
628 buffered);
629 }
630 }
631 // left over again
632 if (inputLen > 0) {
633 System.arraycopy(input, inputOffset, buffer, buffered,
634 inputLen);
635 }
636 buffered += inputLen;
637 return len;
638 }
639
640 /**
641 * Encrypts or decrypts data in a single-part operation,
642 * or finishes a multiple-part operation.
643 * The data is encrypted or decrypted, depending on how this cipher was
644 * initialized.
645 *
646 * <p>The first <code>inputLen</code> bytes in the <code>input</code>
647 * buffer, starting at <code>inputOffset</code>, and any input bytes that
648 * may have been buffered during a previous <code>update</code> operation,
649 * are processed, with padding (if requested) being applied.
650 * The result is stored in a new buffer.
651 *
652 * <p>The cipher is reset to its initial state (uninitialized) after this
653 * call.
654 *
655 * @param input the input buffer
656 * @param inputOffset the offset in <code>input</code> where the input
657 * starts
658 * @param inputLen the input length
659 *
660 * @return the new buffer with the result
661 *
662 * @exception IllegalBlockSizeException if this cipher is a block cipher,
663 * no padding has been requested (only in encryption mode), and the total
664 * input length of the data processed by this cipher is not a multiple of
665 * block size
666 * @exception BadPaddingException if this cipher is in decryption mode,
667 * and (un)padding has been requested, but the decrypted data is not
668 * bounded by the appropriate padding bytes
669 */
670 byte[] doFinal(byte[] input, int inputOffset, int inputLen)
671 throws IllegalBlockSizeException, BadPaddingException {
672 byte[] output = null;
673 byte[] out = null;
674 try {
675 output = new byte[getOutputSize(inputLen)];
676 int len = doFinal(input, inputOffset, inputLen, output, 0);
677 if (len < output.length) {
678 out = new byte[len];
679 if (len != 0)
680 System.arraycopy(output, 0, out, 0, len);
681 } else {

262 more lines aren’t shown here.

java/pkg/com/sun/crypto/provider/CipherFeedback.java+272−0

This diff is large: its 273 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/CipherTextStealing.java+215−0

This diff is large: its 216 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/CipherWithWrappingSpi.java+261−0

This diff is large: its 262 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/ConstructKeys.java+191−0

This diff is large: its 192 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/CounterMode.java+210−0

This diff is large: its 211 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/DESCipher.java+428−0

This diff is large: its 429 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/DESConstants.java+39−0

This diff is large: its 40 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/DESCrypt.java+1145−0

This diff is large: its 1146 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/DESKey.java+161−0

This diff is large: its 162 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/DESKeyFactory.java+164−0

This diff is large: its 165 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/DESKeyGenerator.java+147−0

This diff is large: its 148 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/DESParameters.java+88−0

This diff is large: its 89 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/DESedeCipher.java+426−0

This diff is large: its 427 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/DESedeCrypt.java+168−0

This diff is large: its 169 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/DESedeKey.java+162−0

This diff is large: its 163 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/DESedeKeyFactory.java+161−0

This diff is large: its 162 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/DESedeKeyGenerator.java+145−0

This diff is large: its 146 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/DESedeParameters.java+87−0

This diff is large: its 88 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/DESedeWrapCipher.java+567−0

This diff is large: its 568 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/DHKeyAgreement.java+412−0

This diff is large: its 413 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/DHKeyFactory.java+236−0

This diff is large: its 237 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/DHKeyPairGenerator.java+186−0

This diff is large: its 187 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/DHParameterGenerator.java+171−0

This diff is large: its 172 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/DHParameters.java+144−0

This diff is large: its 145 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/DHPrivateKey.java+352−0

This diff is large: its 353 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/DHPublicKey.java+331−0

This diff is large: its 332 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/ElectronicCodeBook.java+160−0

This diff is large: its 161 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/EncryptedPrivateKeyInfo.java+130−0

This diff is large: its 131 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/FeedbackCipher.java+199−0

This diff is large: its 200 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/HmacCore.java+348−0

This diff is large: its 349 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/HmacMD5.java+133−0

This diff is large: its 134 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/HmacMD5KeyGenerator.java+109−0

This diff is large: its 110 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/HmacPKCS12PBESHA1.java+203−0

This diff is large: its 204 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/HmacSHA1.java+133−0

This diff is large: its 134 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/HmacSHA1KeyGenerator.java+109−0

This diff is large: its 110 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/ISO10126Padding.java+123−0

This diff is large: its 124 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/JceKeyStore.java+903−0

This diff is large: its 904 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/KeyGeneratorCore.java+221−0

This diff is large: its 222 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/KeyProtector.java+410−0

This diff is large: its 411 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/OAEPParameters.java+259−0

This diff is large: its 260 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/OutputFeedback.java+229−0

This diff is large: its 230 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/PBECipherCore.java+541−0

This diff is large: its 542 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/PBEKey.java+154−0

This diff is large: its 155 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/PBEKeyFactory.java+203−0

This diff is large: its 204 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/PBEParameters.java+143−0

This diff is large: its 144 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/PBEWithMD5AndDESCipher.java+429−0

This diff is large: its 430 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/PBEWithMD5AndTripleDESCipher.java+435−0

This diff is large: its 436 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/PBKDF2HmacSHA1Factory.java+154−0

This diff is large: its 155 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/PBKDF2KeyImpl.java+282−0

This diff is large: its 283 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/PCBC.java+198−0

This diff is large: its 199 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/PKCS12PBECipherCore.java+521−0

This diff is large: its 522 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/PKCS5Padding.java+128−0

This diff is large: its 129 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/Padding.java+84−0

This diff is large: its 85 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/PrivateKeyInfo.java+90−0

This diff is large: its 91 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/RC2Cipher.java+151−0

This diff is large: its 152 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/RC2Crypt.java+320−0

This diff is large: its 321 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/RC2Parameters.java+229−0

This diff is large: its 230 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/RSACipher.java+444−0

This diff is large: its 445 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/SslMacCore.java+264−0

This diff is large: its 265 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/SunJCE.java+456−0

This diff is large: its 457 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/SymmetricCipher.java+102−0

This diff is large: its 103 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/TlsKeyMaterialGenerator.java+277−0

This diff is large: its 278 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/TlsMasterSecretGenerator.java+175−0

This diff is large: its 176 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/TlsPrfGenerator.java+368−0

This diff is large: its 369 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/TlsRsaPremasterSecretGenerator.java+85−0

This diff is large: its 86 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/ai.java+64−0

This diff is large: its 65 lines aren’t shown here.

java/pkg/com/sun/crypto/provider/mkfile+88−0

This diff is large: its 89 lines aren’t shown here.

java/pkg/com/sun/demo/jvmti/hprof/Tracker.java+102−0

This diff is large: its 103 lines aren’t shown here.

java/pkg/com/sun/demo/jvmti/hprof/mkfile+8−0

This diff is large: its 9 lines aren’t shown here.

java/pkg/com/sun/demo/jvmti/mkfile+6−0

This diff is large: its 7 lines aren’t shown here.

java/pkg/com/sun/demo/mkfile+6−0

This diff is large: its 7 lines aren’t shown here.

java/pkg/com/sun/imageio/mkfile+8−0

This diff is large: its 9 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/bmp/BMPConstants.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/bmp/BMPConstants.java+53−0

This diff is large: its 54 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/bmp/BMPImageReader$1.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/bmp/BMPImageReader$2.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/bmp/BMPImageReader$3.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/bmp/BMPImageReader$4.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/bmp/BMPImageReader$5.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/bmp/BMPImageReader$EmbeddedProgressAdapter.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/bmp/BMPImageReader.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/bmp/BMPImageReader.java+1821−0

This diff is large: its 1822 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/bmp/BMPImageReaderSpi.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/bmp/BMPImageReaderSpi.java+94−0

This diff is large: its 95 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/bmp/BMPImageWriter$1.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/bmp/BMPImageWriter$2.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/bmp/BMPImageWriter$IIOWriteProgressAdapter.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/bmp/BMPImageWriter.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/bmp/BMPImageWriter.java+1532−0

This diff is large: its 1533 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/bmp/BMPImageWriterSpi.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/bmp/BMPImageWriterSpi.java+106−0

This diff is large: its 107 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/bmp/BMPMetadata.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/bmp/BMPMetadata.java+307−0

This diff is large: its 308 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/bmp/BMPMetadataFormat.java+208−0

This diff is large: its 209 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/bmp/BMPMetadataFormatResources.java+69−0

This diff is large: its 70 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/bmp/mkfile+15−0

This diff is large: its 16 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/common/BitFile.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/common/BitFile.java+123−0

This diff is large: its 124 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/common/BogusColorSpace.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/common/BogusColorSpace.java+136−0

This diff is large: its 137 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/common/I18N.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/common/I18N.java+33−0

This diff is large: its 34 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/common/I18NImpl.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/common/I18NImpl.java+62−0

This diff is large: its 63 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/common/ImageUtil.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/common/ImageUtil.java+1167−0

This diff is large: its 1168 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/common/InputStreamAdapter.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/common/InputStreamAdapter.java+49−0

This diff is large: its 50 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/common/LZWCompressor.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/common/LZWCompressor.java+146−0

This diff is large: its 147 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/common/LZWStringTable.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/common/LZWStringTable.java+218−0

This diff is large: its 219 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/common/PaletteBuilder$ColorNode.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/common/PaletteBuilder.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/common/PaletteBuilder.java+486−0

This diff is large: its 487 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/common/ReaderUtil.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/common/ReaderUtil.java+216−0

This diff is large: its 217 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/common/StandardMetadataFormat.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/common/StandardMetadataFormat.java+499−0

This diff is large: its 500 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/common/StandardMetadataFormatResources.java+210−0

This diff is large: its 211 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/common/SubImageInputStream.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/common/SubImageInputStream.java+79−0

This diff is large: its 80 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/common/iio-plugin.properties+47−0

This diff is large: its 48 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/common/mkfile+20−0

This diff is large: its 21 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/gif/GIFImageMetadata.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/gif/GIFImageMetadata.java+446−0

This diff is large: its 447 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/gif/GIFImageMetadataFormat.java+171−0

This diff is large: its 172 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/gif/GIFImageMetadataFormatResources.java+104−0

This diff is large: its 105 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/gif/GIFImageReader.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/gif/GIFImageReader.java+1028−0

This diff is large: its 1029 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/gif/GIFImageReaderSpi.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/gif/GIFImageReaderSpi.java+99−0

This diff is large: its 100 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/gif/GIFImageWriteParam.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/gif/GIFImageWriter.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/gif/GIFImageWriter.java+1317−0

This diff is large: its 1318 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/gif/GIFImageWriterSpi.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/gif/GIFImageWriterSpi.java+104−0

This diff is large: its 105 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/gif/GIFMetadata.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/gif/GIFMetadata.java+317−0

This diff is large: its 318 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/gif/GIFStreamMetadata.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/gif/GIFStreamMetadata.java+320−0

This diff is large: its 321 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/gif/GIFStreamMetadataFormat.java+106−0

This diff is large: its 107 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/gif/GIFStreamMetadataFormatResources.java+71−0

This diff is large: its 72 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.java+402−0

This diff is large: its 403 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/gif/GIFWritableStreamMetadata.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/gif/GIFWritableStreamMetadata.java+267−0

This diff is large: its 268 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/gif/mkfile+20−0

This diff is large: its 21 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/jpeg/AdobeMarkerSegment.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/AdobeMarkerSegment.java+136−0

This diff is large: its 137 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/jpeg/COMMarkerSegment.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/COMMarkerSegment.java+133−0

This diff is large: its 134 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/jpeg/DHTMarkerSegment$Htable.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/DHTMarkerSegment.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/DHTMarkerSegment.java+260−0

This diff is large: its 261 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/jpeg/DQTMarkerSegment$Qtable.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/DQTMarkerSegment.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/DQTMarkerSegment.java+309−0

This diff is large: its 310 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/jpeg/DRIMarkerSegment.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/DRIMarkerSegment.java+83−0

This diff is large: its 84 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/jpeg/ImageTypeIterator.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/ImageTypeProducer.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment$1.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment$ICCMarkerSegment.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment$IllegalThumbException.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment$JFIFExtensionMarkerSegment.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment$JFIFThumb.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment$JFIFThumbJPEG$ThumbnailReadListener.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment$JFIFThumbJPEG.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment$JFIFThumbPalette.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment$JFIFThumbRGB.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment$JFIFThumbUncompressed.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java+1564−0

This diff is large: its 1565 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/jpeg/JPEG$JCS.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/JPEG.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/JPEG.java+371−0

This diff is large: its 372 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/jpeg/JPEGBuffer.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/JPEGBuffer.java+254−0

This diff is large: its 255 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageMetadataFormat.java+366−0

This diff is large: its 367 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageMetadataFormatResources.java+143−0

This diff is large: its 144 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageReader$1.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageReader$JPEGReaderDisposerRecord.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageReader.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageReader.java+1675−0

This diff is large: its 1676 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageReaderResources.java+46−0

This diff is large: its 47 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageReaderSpi.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageReaderSpi.java+88−0

This diff is large: its 89 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageWriter$JPEGWriterDisposerRecord.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageWriter.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java+1809−0

This diff is large: its 1810 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageWriterResources.java+82−0

This diff is large: its 83 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageWriterSpi.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/JPEGImageWriterSpi.java+98−0

This diff is large: its 99 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/jpeg/JPEGMetadata.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/JPEGMetadata.java+2416−0

This diff is large: its 2417 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/jpeg/JPEGMetadataFormat.java+157−0

This diff is large: its 158 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/jpeg/JPEGMetadataFormatResources.java+61−0

This diff is large: its 62 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/jpeg/JPEGStreamMetadataFormat.java+47−0

This diff is large: its 48 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/jpeg/JPEGStreamMetadataFormatResources.java+46−0

This diff is large: its 47 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/jpeg/MarkerSegment.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/MarkerSegment.java+224−0

This diff is large: its 225 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/jpeg/SOFMarkerSegment$ComponentSpec.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/SOFMarkerSegment.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/SOFMarkerSegment.java+284−0

This diff is large: its 285 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/jpeg/SOSMarkerSegment$ScanComponentSpec.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/SOSMarkerSegment.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/jpeg/SOSMarkerSegment.java+241−0

This diff is large: its 242 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/jpeg/mkfile+31−0

This diff is large: its 32 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/mkfile+11−0

This diff is large: its 12 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/png/CRC.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/png/ChunkStream.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/png/IDATOutputStream.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/png/PNGImageDataEnumeration.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/png/PNGImageReader.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/png/PNGImageReader.java+1592−0

This diff is large: its 1593 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/png/PNGImageReaderSpi.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/png/PNGImageReaderSpi.java+103−0

This diff is large: its 104 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/png/PNGImageWriteParam.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/png/PNGImageWriter.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/png/PNGImageWriter.java+1171−0

This diff is large: its 1172 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/png/PNGImageWriterSpi.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/png/PNGImageWriterSpi.java+126−0

This diff is large: its 127 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/png/PNGMetadata.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/png/PNGMetadata.java+2046−0

This diff is large: its 2047 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/png/PNGMetadataFormat.java+500−0

This diff is large: its 501 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/png/PNGMetadataFormatResources.java+219−0

This diff is large: its 220 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/png/RowFilter.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/png/RowFilter.java+192−0

This diff is large: its 193 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/png/mkfile+15−0

This diff is large: its 16 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/wbmp/WBMPImageReader.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/wbmp/WBMPImageReader.java+322−0

This diff is large: its 323 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/wbmp/WBMPImageReaderSpi.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/wbmp/WBMPImageReaderSpi.java+130−0

This diff is large: its 131 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/wbmp/WBMPImageWriter.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/wbmp/WBMPImageWriter.java+315−0

This diff is large: its 316 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/wbmp/WBMPImageWriterSpi.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/wbmp/WBMPImageWriterSpi.java+93−0

This diff is large: its 94 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/wbmp/WBMPMetadata.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/plugins/wbmp/WBMPMetadata.java+134−0

This diff is large: its 135 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/wbmp/WBMPMetadataFormat.java+70−0

This diff is large: its 71 lines aren’t shown here.

java/pkg/com/sun/imageio/plugins/wbmp/mkfile+13−0

This diff is large: its 14 lines aren’t shown here.

java/pkg/com/sun/imageio/spi/FileImageInputStreamSpi.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/spi/FileImageInputStreamSpi.java+63−0

This diff is large: its 64 lines aren’t shown here.

java/pkg/com/sun/imageio/spi/FileImageOutputStreamSpi.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/spi/FileImageOutputStreamSpi.java+64−0

This diff is large: its 65 lines aren’t shown here.

java/pkg/com/sun/imageio/spi/InputStreamImageInputStreamSpi.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/spi/InputStreamImageInputStreamSpi.java+77−0

This diff is large: its 78 lines aren’t shown here.

java/pkg/com/sun/imageio/spi/OutputStreamImageOutputStreamSpi.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/spi/OutputStreamImageOutputStreamSpi.java+76−0

This diff is large: its 77 lines aren’t shown here.

java/pkg/com/sun/imageio/spi/RAFImageInputStreamSpi.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/spi/RAFImageInputStreamSpi.java+65−0

This diff is large: its 66 lines aren’t shown here.

java/pkg/com/sun/imageio/spi/RAFImageOutputStreamSpi.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/spi/RAFImageOutputStreamSpi.java+66−0

This diff is large: its 67 lines aren’t shown here.

java/pkg/com/sun/imageio/spi/mkfile+13−0

This diff is large: its 14 lines aren’t shown here.

java/pkg/com/sun/imageio/stream/CloseableDisposerRecord.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/stream/CloseableDisposerRecord.java+54−0

This diff is large: its 55 lines aren’t shown here.

java/pkg/com/sun/imageio/stream/StreamCloser$1.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/stream/StreamCloser$2.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/stream/StreamCloser$CloseAction.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/stream/StreamCloser.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/stream/StreamCloser.java+134−0

This diff is large: its 135 lines aren’t shown here.

java/pkg/com/sun/imageio/stream/StreamFinalizer.class+0−0

Binary file not shown.

java/pkg/com/sun/imageio/stream/StreamFinalizer.java+72−0

This diff is large: its 73 lines aren’t shown here.

java/pkg/com/sun/imageio/stream/mkfile+10−0

This diff is large: its 11 lines aren’t shown here.

java/pkg/com/sun/jarsigner/ContentSigner.java+70−0

This diff is large: its 71 lines aren’t shown here.

java/pkg/com/sun/jarsigner/ContentSignerParameters.java+97−0

This diff is large: its 98 lines aren’t shown here.

java/pkg/com/sun/jarsigner/mkfile+9−0

This diff is large: its 10 lines aren’t shown here.

java/pkg/com/sun/jarsigner/package.html+38−0

This diff is large: its 39 lines aren’t shown here.

java/pkg/com/sun/java/browser/dom/DOMAccessException.java+89−0

This diff is large: its 90 lines aren’t shown here.

java/pkg/com/sun/java/browser/dom/DOMAccessor.java+40−0

This diff is large: its 41 lines aren’t shown here.

java/pkg/com/sun/java/browser/dom/DOMAction.java+42−0

This diff is large: its 43 lines aren’t shown here.

java/pkg/com/sun/java/browser/dom/DOMService.java+103−0

This diff is large: its 104 lines aren’t shown here.

java/pkg/com/sun/java/browser/dom/DOMServiceProvider.java+60−0

This diff is large: its 61 lines aren’t shown here.

java/pkg/com/sun/java/browser/dom/DOMUnsupportedException.java+89−0

This diff is large: its 90 lines aren’t shown here.

java/pkg/com/sun/java/browser/dom/mkfile+13−0

This diff is large: its 14 lines aren’t shown here.

java/pkg/com/sun/java/browser/mkfile+7−0

This diff is large: its 8 lines aren’t shown here.

java/pkg/com/sun/java/browser/net/ProxyInfo.java+36−0

This diff is large: its 37 lines aren’t shown here.

java/pkg/com/sun/java/browser/net/ProxyService.java+61−0

This diff is large: its 62 lines aren’t shown here.

java/pkg/com/sun/java/browser/net/ProxyServiceProvider.java+36−0

This diff is large: its 37 lines aren’t shown here.

java/pkg/com/sun/java/browser/net/mkfile+10−0

This diff is large: its 11 lines aren’t shown here.

java/pkg/com/sun/java/mkfile+8−0

This diff is large: its 9 lines aren’t shown here.

java/pkg/com/sun/java/swing/Painter.java+33−0

This diff is large: its 34 lines aren’t shown here.

java/pkg/com/sun/java/swing/SwingUtilities3$EventQueueDelegateFromMap.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/SwingUtilities3.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/SwingUtilities3.java+220−0

This diff is large: its 221 lines aren’t shown here.

java/pkg/com/sun/java/swing/mkfile+13−0

This diff is large: its 14 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java+1303−0

This diff is large: its 1304 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/GTKColorType.java+167−0

This diff is large: its 168 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/GTKConstants.java+118−0

This diff is large: its 119 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/GTKEngine.java+635−0

This diff is large: its 636 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java+1398−0

This diff is large: its 1399 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java+144−0

This diff is large: its 145 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/GTKIconFactory.java+351−0

This diff is large: its 352 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java+1739−0

This diff is large: its 1740 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/GTKPainter.java+1497−0

This diff is large: its 1498 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/GTKRegion.java+42−0

This diff is large: its 43 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/GTKStyle.java+1141−0

This diff is large: its 1142 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/GTKStyleFactory.java+182−0

This diff is large: its 183 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/Metacity.java+2155−0

This diff is large: its 2156 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/PangoFonts.java+233−0

This diff is large: its 234 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/XColors.java+831−0

This diff is large: its 832 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/icons/Directory.gif+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/gtk/icons/File.gif+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/gtk/icons/image-delayed.png+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/gtk/icons/image-failed.png+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/gtk/icons/mkfile+2−0

This diff is large: its 3 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/mkfile+27−0

This diff is large: its 28 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/resources/gtk.properties+83−0

This diff is large: its 84 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/resources/gtk_de.properties+88−0

This diff is large: its 89 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/resources/gtk_es.properties+88−0

This diff is large: its 89 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/resources/gtk_fr.properties+88−0

This diff is large: its 89 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/resources/gtk_it.properties+88−0

This diff is large: its 89 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/resources/gtk_ja.properties+84−0

This diff is large: its 85 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/resources/gtk_ko.properties+84−0

This diff is large: its 85 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/resources/gtk_pt_BR.properties+88−0

This diff is large: its 89 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/resources/gtk_sv.properties+88−0

This diff is large: its 89 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/resources/gtk_zh_CN.properties+84−0

This diff is large: its 85 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/resources/gtk_zh_TW.properties+84−0

This diff is large: its 85 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/resources/metacity/SwingFallbackTheme/metacity-1/metacity-theme-1.xml+178−0

This diff is large: its 179 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/resources/metacity/SwingFallbackTheme/metacity-1/mkfile+2−0

This diff is large: its 3 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/resources/metacity/SwingFallbackTheme/mkfile+6−0

This diff is large: its 7 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/resources/metacity/mkfile+6−0

This diff is large: its 7 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/gtk/resources/mkfile+6−0

This diff is large: its 7 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/mkfile+9−0

This diff is large: its 10 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifBorders.java+734−0

This diff is large: its 735 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifButtonListener.java+49−0

This diff is large: its 50 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifButtonUI.java+150−0

This diff is large: its 151 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifCheckBoxMenuItemUI.java+107−0

This diff is large: its 108 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifCheckBoxUI.java+90−0

This diff is large: its 91 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifComboBoxUI.java+361−0

This diff is large: its 362 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifDesktopIconUI.java+365−0

This diff is large: its 366 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifDesktopPaneUI.java+267−0

This diff is large: its 268 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifEditorPaneUI.java+68−0

This diff is large: its 69 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java+846−0

This diff is large: its 847 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifGraphicsUtils.java+476−0

This diff is large: its 477 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifIconFactory.java+460−0

This diff is large: its 461 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java+374−0

This diff is large: its 375 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifInternalFrameUI.java+223−0

This diff is large: its 224 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifLabelUI.java+61−0

This diff is large: its 62 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java+1283−0

This diff is large: its 1284 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifMenuBarUI.java+69−0

This diff is large: its 70 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifMenuItemUI.java+109−0

This diff is large: its 110 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifMenuMouseListener.java+48−0

This diff is large: its 49 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifMenuMouseMotionListener.java+43−0

This diff is large: its 44 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifMenuUI.java+151−0

This diff is large: its 152 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifOptionPaneUI.java+114−0

This diff is large: its 115 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifPasswordFieldUI.java+68−0

This diff is large: its 69 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifPopupMenuSeparatorUI.java+66−0

This diff is large: its 67 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifPopupMenuUI.java+114−0

This diff is large: its 115 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifProgressBarUI.java+58−0

This diff is large: its 59 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifRadioButtonMenuItemUI.java+113−0

This diff is large: its 114 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifRadioButtonUI.java+104−0

This diff is large: its 105 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifScrollBarButton.java+211−0

This diff is large: its 212 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifScrollBarUI.java+108−0

This diff is large: its 109 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifScrollPaneUI.java+143−0

This diff is large: its 144 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifSeparatorUI.java+59−0

This diff is large: its 60 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifSliderUI.java+159−0

This diff is large: its 160 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifSplitPaneDivider.java+295−0

This diff is large: its 296 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifSplitPaneUI.java+66−0

This diff is large: its 67 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifTabbedPaneUI.java+306−0

This diff is large: its 307 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifTextAreaUI.java+70−0

This diff is large: its 71 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifTextFieldUI.java+68−0

This diff is large: its 69 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifTextPaneUI.java+68−0

This diff is large: its 69 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifTextUI.java+175−0

This diff is large: its 176 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifToggleButtonUI.java+125−0

This diff is large: its 126 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifTreeCellRenderer.java+113−0

This diff is large: its 114 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/MotifTreeUI.java+166−0

This diff is large: its 167 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/icons/DesktopIcon.gif+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/motif/icons/Error.gif+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/motif/icons/Inform.gif+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/motif/icons/Question.gif+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/motif/icons/TreeClosed.gif+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/motif/icons/TreeOpen.gif+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/motif/icons/Warn.gif+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/motif/icons/image-delayed.png+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/motif/icons/image-failed.png+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/motif/icons/mkfile+2−0

This diff is large: its 3 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/mkfile+55−0

This diff is large: its 56 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/resources/mkfile+2−0

This diff is large: its 3 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/resources/motif.properties+40−0

This diff is large: its 41 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/resources/motif_de.properties+40−0

This diff is large: its 41 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/resources/motif_es.properties+40−0

This diff is large: its 41 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/resources/motif_fr.properties+40−0

This diff is large: its 41 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/resources/motif_it.properties+40−0

This diff is large: its 41 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/resources/motif_ja.properties+40−0

This diff is large: its 41 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/resources/motif_ko.properties+40−0

This diff is large: its 41 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/resources/motif_pt_BR.properties+40−0

This diff is large: its 41 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/resources/motif_sv.properties+40−0

This diff is large: its 41 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/resources/motif_zh_CN.properties+40−0

This diff is large: its 41 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/motif/resources/motif_zh_TW.properties+40−0

This diff is large: its 41 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/nimbus/AbstractRegionPainter.java+33−0

This diff is large: its 34 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/nimbus/NimbusLookAndFeel.java+33−0

This diff is large: its 34 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/nimbus/mkfile+9−0

This diff is large: its 10 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/AnimationController$1.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/AnimationController$AnimationState.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/AnimationController$PartUIClientPropertyKey.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/AnimationController.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/AnimationController.java+428−0

This diff is large: its 429 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/DesktopProperty$1.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/DesktopProperty$WeakPCL.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/DesktopProperty.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/DesktopProperty.java+285−0

This diff is large: its 286 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/TMSchema$Control.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/TMSchema$Part.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/TMSchema$Prop.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/TMSchema$State.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/TMSchema$TypeEnum.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/TMSchema.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/TMSchema.java+565−0

This diff is large: its 566 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsBorders$ComplementDashedBorder.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsBorders$DashedBorder.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsBorders$InternalFrameLineBorder.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsBorders$ProgressBarBorder.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsBorders$ToolBarBorder.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsBorders.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsBorders.java+336−0

This diff is large: its 337 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsButtonListener.java+54−0

This diff is large: its 55 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsButtonUI$1.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsButtonUI.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsButtonUI.java+320−0

This diff is large: its 321 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsCheckBoxMenuItemUI$1.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsCheckBoxMenuItemUI.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsCheckBoxMenuItemUI.java+104−0

This diff is large: its 105 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsCheckBoxUI.java+95−0

This diff is large: its 96 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsClassicLookAndFeel.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsClassicLookAndFeel.java+44−0

This diff is large: its 45 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsComboBoxUI$1.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsComboBoxUI$2.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsComboBoxUI$3.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsComboBoxUI$WindowsComboBoxEditor.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsComboBoxUI$WindowsComboBoxRenderer.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsComboBoxUI$WindowsComboPopup$InvocationKeyHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsComboBoxUI$WindowsComboPopup.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsComboBoxUI$XPComboBoxButton.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java+565−0

This diff is large: its 566 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsDesktopIconUI.java+98−0

This diff is large: its 99 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsDesktopManager.java+103−0

This diff is large: its 104 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsDesktopPaneUI.java+71−0

This diff is large: its 72 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsEditorPaneUI.java+68−0

This diff is large: its 69 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java+1309−0

This diff is large: its 1310 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsGraphicsUtils.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsGraphicsUtils.java+211−0

This diff is large: its 212 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsIconFactory$1.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsIconFactory$CheckBoxIcon.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsIconFactory$CheckBoxMenuItemIcon.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsIconFactory$FrameButtonIcon.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsIconFactory$MenuArrowIcon.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsIconFactory$MenuItemArrowIcon.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsIconFactory$MenuItemCheckIcon.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsIconFactory$RadioButtonIcon.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsIconFactory$RadioButtonMenuItemIcon.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsIconFactory$ResizeIcon.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsIconFactory$VistaMenuItemCheckIconFactory$VistaMenuItemCheckIcon.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsIconFactory$VistaMenuItemCheckIconFactory.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsIconFactory.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsIconFactory.java+903−0

This diff is large: its 904 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsInternalFrameTitlePane.java+559−0

This diff is large: its 560 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsInternalFrameUI.java+134−0

This diff is large: its 135 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsLabelUI.java+112−0

This diff is large: its 113 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$1.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$2.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$ActiveWindowsIcon$1.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$ActiveWindowsIcon.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$AudioAction.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$FontDesktopProperty.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$LazyWindowsIcon.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$RGBGrayFilter.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$SkinIcon.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$TriggerDesktopProperty.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$WindowsFontProperty.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$WindowsFontSizeProperty.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$WindowsLayoutStyle.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$XPBorderValue.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$XPColorValue$XPColorValueKey.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$XPColorValue.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$XPDLUValue.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel$XPValue.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java+2620−0

This diff is large: its 2621 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsMenuBarUI$1.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsMenuBarUI$2.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsMenuBarUI$TakeFocus.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsMenuBarUI.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsMenuBarUI.java+186−0

This diff is large: its 187 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsMenuItemUI$1.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsMenuItemUI.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsMenuItemUI.java+177−0

This diff is large: its 178 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsMenuItemUIAccessor.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsMenuItemUIAccessor.java+46−0

This diff is large: its 47 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsMenuUI$1.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsMenuUI$WindowsMouseInputHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsMenuUI.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsMenuUI.java+295−0

This diff is large: its 296 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsOptionPaneUI.java+47−0

This diff is large: its 48 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsPasswordFieldUI.java+69−0

This diff is large: its 70 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsPopupMenuSeparatorUI.java+94−0

This diff is large: its 95 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsPopupMenuUI$MnemonicListener.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsPopupMenuUI.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsPopupMenuUI.java+224−0

This diff is large: its 225 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsPopupWindow.java+95−0

This diff is large: its 96 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsProgressBarUI.java+400−0

This diff is large: its 401 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsRadioButtonMenuItemUI$1.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsRadioButtonMenuItemUI.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsRadioButtonMenuItemUI.java+103−0

This diff is large: its 104 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsRadioButtonUI.java+130−0

This diff is large: its 131 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsRootPaneUI$AltProcessor.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsRootPaneUI.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsRootPaneUI.java+184−0

This diff is large: its 185 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsScrollBarUI.java+479−0

This diff is large: its 480 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsScrollPaneUI.java+44−0

This diff is large: its 45 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsSeparatorUI.java+35−0

This diff is large: its 36 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsSliderUI.java+234−0

This diff is large: its 235 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsSpinnerUI.java+103−0

This diff is large: its 104 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsSplitPaneDivider.java+72−0

This diff is large: its 73 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsSplitPaneUI.java+67−0

This diff is large: its 68 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsTabbedPaneUI.java+227−0

This diff is large: its 228 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsTableHeaderUI.java+245−0

This diff is large: its 246 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsTextAreaUI.java+68−0

This diff is large: its 69 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsTextFieldUI.java+175−0

This diff is large: its 176 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsTextPaneUI.java+67−0

This diff is large: its 68 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsTextUI.java+236−0

This diff is large: its 237 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsToggleButtonUI.java+181−0

This diff is large: its 182 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsToolBarSeparatorUI.java+124−0

This diff is large: its 125 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsToolBarUI.java+99−0

This diff is large: its 100 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/WindowsTreeUI$CollapsedIcon.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsTreeUI$ExpandedIcon.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsTreeUI$WindowsTreeCellRenderer.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsTreeUI.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/WindowsTreeUI.java+234−0

This diff is large: its 235 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/XPStyle$GlyphButton.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/XPStyle$Skin.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/XPStyle$SkinPainter.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/XPStyle$XPEmptyBorder.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/XPStyle$XPFillBorder.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/XPStyle$XPImageBorder.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/XPStyle$XPStatefulFillBorder.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/XPStyle.class+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/XPStyle.java+751−0

This diff is large: its 752 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/icons/Computer.gif+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/icons/DetailsView.gif+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/icons/Directory.gif+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/icons/Error.gif+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/icons/File.gif+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/icons/FloppyDrive.gif+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/icons/HardDrive.gif+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/icons/HomeFolder.gif+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/icons/Inform.gif+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/icons/JavaCup32.png+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/icons/ListView.gif+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/icons/NewFolder.gif+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/icons/Question.gif+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/icons/TreeClosed.gif+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/icons/TreeLeaf.gif+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/icons/TreeOpen.gif+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/icons/UpFolder.gif+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/icons/Warn.gif+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/icons/image-delayed.png+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/icons/image-failed.png+0−0

Binary file not shown.

java/pkg/com/sun/java/swing/plaf/windows/icons/mkfile+2−0

This diff is large: its 3 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/mkfile+64−0

This diff is large: its 65 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/resources/mkfile+2−0

This diff is large: its 3 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/resources/windows.properties+47−0

This diff is large: its 48 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/resources/windows_de.properties+47−0

This diff is large: its 48 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/resources/windows_es.properties+47−0

This diff is large: its 48 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/resources/windows_fr.properties+47−0

This diff is large: its 48 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/resources/windows_it.properties+47−0

This diff is large: its 48 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/resources/windows_ja.properties+47−0

This diff is large: its 48 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/resources/windows_ko.properties+47−0

This diff is large: its 48 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/resources/windows_pt_BR.properties+47−0

This diff is large: its 48 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/resources/windows_sv.properties+47−0

This diff is large: its 48 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/resources/windows_zh_CN.properties+47−0

This diff is large: its 48 lines aren’t shown here.

java/pkg/com/sun/java/swing/plaf/windows/resources/windows_zh_TW.properties+47−0

This diff is large: its 48 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/mkfile+6−0

This diff is large: its 7 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/AdaptiveCoding.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/AdaptiveCoding.java+298−0

This diff is large: its 299 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/Attribute$1.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Attribute$FormatException.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Attribute$Holder.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Attribute$Layout$Element.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Attribute$Layout.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Attribute$ValueStream.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Attribute.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Attribute.java+1622−0

This diff is large: its 1623 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/BandStructure$Band.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/BandStructure$ByteBand$1.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/BandStructure$ByteBand.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/BandStructure$ByteCounter.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/BandStructure$CPRefBand.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/BandStructure$IntBand.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/BandStructure$MultiBand.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/BandStructure$ValueBand.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/BandStructure.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/BandStructure.java+2682−0

This diff is large: its 2683 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/ClassReader$1.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/ClassReader$ClassFormatException.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/ClassReader.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/ClassReader.java+494−0

This diff is large: its 495 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/ClassWriter.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/ClassWriter.java+257−0

This diff is large: its 258 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/Code.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Code.java+399−0

This diff is large: its 400 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/Coding.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Coding.java+907−0

This diff is large: its 908 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/CodingChooser$Choice.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/CodingChooser$Sizer.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/CodingChooser.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/CodingChooser.java+1489−0

This diff is large: its 1490 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/CodingMethod.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/CodingMethod.java+43−0

This diff is large: its 44 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/ConstantPool$ClassEntry.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/ConstantPool$DescriptorEntry.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/ConstantPool$Entry.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/ConstantPool$Index.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/ConstantPool$IndexGroup.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/ConstantPool$LiteralEntry.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/ConstantPool$MemberEntry.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/ConstantPool$NumberEntry.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/ConstantPool$SignatureEntry.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/ConstantPool$StringEntry.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/ConstantPool$Utf8Entry.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/ConstantPool.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/ConstantPool.java+1218−0

This diff is large: its 1219 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/Constants.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Constants.java+436−0

This diff is large: its 437 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/Driver.java+725−0

This diff is large: its 726 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/DriverResource.java+131−0

This diff is large: its 132 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/FixedList.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/FixedList.java+174−0

This diff is large: its 175 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/Fixups$1.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Fixups$Fixup.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Fixups$Itr.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Fixups.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Fixups.java+546−0

This diff is large: its 547 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/Histogram$1.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Histogram$BitMetric.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Histogram.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Histogram.java+818−0

This diff is large: its 819 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/Instruction$FormatException.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Instruction$LookupSwitch.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Instruction$Switch.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Instruction$TableSwitch.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Instruction.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Instruction.java+664−0

This diff is large: its 665 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/NativeUnpack.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/NativeUnpack.java+322−0

This diff is large: its 323 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/Package$1.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Package$Class$Field.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Package$Class$Member.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Package$Class$Method.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Package$Class.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Package$File.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Package$InnerClass.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Package.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Package.java+1322−0

This diff is large: its 1323 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/PackageReader$1.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/PackageReader$2.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/PackageReader$LimitedBuffer$1.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/PackageReader$LimitedBuffer.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/PackageReader.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/PackageReader.java+2204−0

This diff is large: its 2205 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/PackageWriter$1.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/PackageWriter$2.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/PackageWriter$3.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/PackageWriter.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/PackageWriter.java+1619−0

This diff is large: its 1620 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/PackerImpl$1.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/PackerImpl$DoPack$InFile.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/PackerImpl$DoPack.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/PackerImpl.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/PackerImpl.java+642−0

This diff is large: its 643 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/PopulationCoding.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/PopulationCoding.java+500−0

This diff is large: its 501 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/PropMap.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/PropMap.java+338−0

This diff is large: its 339 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/TLGlobals.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/TLGlobals.java+97−0

This diff is large: its 98 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/UnpackerImpl$1.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/UnpackerImpl$DoUnpack.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/UnpackerImpl.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/UnpackerImpl.java+281−0

This diff is large: its 282 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/Utils$NonCloser.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Utils$Pack200Logger.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Utils.class+0−0

Binary file not shown.

java/pkg/com/sun/java/util/jar/pack/Utils.java+344−0

This diff is large: its 345 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/intrinsic.properties+46−0

This diff is large: its 47 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/mkfile+34−0

This diff is large: its 35 lines aren’t shown here.

java/pkg/com/sun/java/util/jar/pack/package.html+104−0

This diff is large: its 105 lines aren’t shown here.

java/pkg/com/sun/java/util/mkfile+6−0

This diff is large: its 7 lines aren’t shown here.

java/pkg/com/sun/jdi/AbsentInformationException.java+45−0

This diff is large: its 46 lines aren’t shown here.

java/pkg/com/sun/jdi/Accessible.java+107−0

This diff is large: its 108 lines aren’t shown here.

java/pkg/com/sun/jdi/ArrayReference.java+209−0

This diff is large: its 210 lines aren’t shown here.

java/pkg/com/sun/jdi/ArrayType.java+96−0

This diff is large: its 97 lines aren’t shown here.

java/pkg/com/sun/jdi/BooleanType.java+39−0

This diff is large: its 40 lines aren’t shown here.

java/pkg/com/sun/jdi/BooleanValue.java+61−0

This diff is large: its 62 lines aren’t shown here.

java/pkg/com/sun/jdi/Bootstrap.java+56−0

This diff is large: its 57 lines aren’t shown here.

java/pkg/com/sun/jdi/ByteType.java+40−0

This diff is large: its 41 lines aren’t shown here.

java/pkg/com/sun/jdi/ByteValue.java+60−0

This diff is large: its 61 lines aren’t shown here.

java/pkg/com/sun/jdi/CharType.java+40−0

This diff is large: its 41 lines aren’t shown here.

java/pkg/com/sun/jdi/CharValue.java+61−0

This diff is large: its 62 lines aren’t shown here.

java/pkg/com/sun/jdi/ClassLoaderReference.java+93−0

This diff is large: its 94 lines aren’t shown here.

java/pkg/com/sun/jdi/ClassNotLoadedException.java+87−0

This diff is large: its 88 lines aren’t shown here.

java/pkg/com/sun/jdi/ClassNotPreparedException.java+45−0

This diff is large: its 46 lines aren’t shown here.

java/pkg/com/sun/jdi/ClassObjectReference.java+48−0

This diff is large: its 49 lines aren’t shown here.

java/pkg/com/sun/jdi/ClassType.java+372−0

This diff is large: its 373 lines aren’t shown here.

java/pkg/com/sun/jdi/DoubleType.java+40−0

This diff is large: its 41 lines aren’t shown here.

java/pkg/com/sun/jdi/DoubleValue.java+61−0

This diff is large: its 62 lines aren’t shown here.

java/pkg/com/sun/jdi/Field.java+135−0

This diff is large: its 136 lines aren’t shown here.

java/pkg/com/sun/jdi/FloatType.java+40−0

This diff is large: its 41 lines aren’t shown here.

java/pkg/com/sun/jdi/FloatValue.java+61−0

This diff is large: its 62 lines aren’t shown here.

java/pkg/com/sun/jdi/IncompatibleThreadStateException.java+46−0

This diff is large: its 47 lines aren’t shown here.

java/pkg/com/sun/jdi/InconsistentDebugInfoException.java+45−0

This diff is large: its 46 lines aren’t shown here.

java/pkg/com/sun/jdi/IntegerType.java+40−0

This diff is large: its 41 lines aren’t shown here.

java/pkg/com/sun/jdi/IntegerValue.java+61−0

This diff is large: its 62 lines aren’t shown here.

java/pkg/com/sun/jdi/InterfaceType.java+81−0

This diff is large: its 82 lines aren’t shown here.

java/pkg/com/sun/jdi/InternalException.java+61−0

This diff is large: its 62 lines aren’t shown here.

java/pkg/com/sun/jdi/InvalidCodeIndexException.java+46−0

This diff is large: its 47 lines aren’t shown here.

java/pkg/com/sun/jdi/InvalidLineNumberException.java+46−0

This diff is large: its 47 lines aren’t shown here.

java/pkg/com/sun/jdi/InvalidStackFrameException.java+43−0

This diff is large: its 44 lines aren’t shown here.

java/pkg/com/sun/jdi/InvalidTypeException.java+46−0

This diff is large: its 47 lines aren’t shown here.

java/pkg/com/sun/jdi/InvocationException.java+49−0

This diff is large: its 50 lines aren’t shown here.

java/pkg/com/sun/jdi/JDIPermission.java+113−0

This diff is large: its 114 lines aren’t shown here.

java/pkg/com/sun/jdi/LocalVariable.java+153−0

This diff is large: its 154 lines aren’t shown here.

java/pkg/com/sun/jdi/Locatable.java+49−0

This diff is large: its 50 lines aren’t shown here.

java/pkg/com/sun/jdi/Location.java+261−0

This diff is large: its 262 lines aren’t shown here.

java/pkg/com/sun/jdi/LongType.java+40−0

This diff is large: its 41 lines aren’t shown here.

java/pkg/com/sun/jdi/LongValue.java+61−0

This diff is large: its 62 lines aren’t shown here.

java/pkg/com/sun/jdi/Method.java+429−0

This diff is large: its 430 lines aren’t shown here.

java/pkg/com/sun/jdi/Mirror.java+76−0

This diff is large: its 77 lines aren’t shown here.

java/pkg/com/sun/jdi/MonitorInfo.java+73−0

This diff is large: its 74 lines aren’t shown here.

java/pkg/com/sun/jdi/NativeMethodException.java+44−0

This diff is large: its 45 lines aren’t shown here.

java/pkg/com/sun/jdi/ObjectCollectedException.java+43−0

This diff is large: its 44 lines aren’t shown here.

java/pkg/com/sun/jdi/ObjectReference.java+444−0

This diff is large: its 445 lines aren’t shown here.

java/pkg/com/sun/jdi/PathSearchingVirtualMachine.java+61−0

This diff is large: its 62 lines aren’t shown here.

java/pkg/com/sun/jdi/PrimitiveType.java+41−0

This diff is large: its 42 lines aren’t shown here.

java/pkg/com/sun/jdi/PrimitiveValue.java+123−0

This diff is large: its 124 lines aren’t shown here.

java/pkg/com/sun/jdi/ReferenceType.java+830−0

This diff is large: its 831 lines aren’t shown here.

java/pkg/com/sun/jdi/ShortType.java+39−0

This diff is large: its 40 lines aren’t shown here.

java/pkg/com/sun/jdi/ShortValue.java+61−0

This diff is large: its 62 lines aren’t shown here.

java/pkg/com/sun/jdi/StackFrame.java+239−0

This diff is large: its 240 lines aren’t shown here.

java/pkg/com/sun/jdi/StringReference.java+48−0

This diff is large: its 49 lines aren’t shown here.

java/pkg/com/sun/jdi/ThreadGroupReference.java+101−0

This diff is large: its 102 lines aren’t shown here.

java/pkg/com/sun/jdi/ThreadReference.java+473−0

This diff is large: its 474 lines aren’t shown here.

java/pkg/com/sun/jdi/Type.java+149−0

This diff is large: its 150 lines aren’t shown here.

java/pkg/com/sun/jdi/TypeComponent.java+129−0

This diff is large: its 130 lines aren’t shown here.

java/pkg/com/sun/jdi/VMCannotBeModifiedException.java+43−0

This diff is large: its 44 lines aren’t shown here.

java/pkg/com/sun/jdi/VMDisconnectedException.java+44−0

This diff is large: its 45 lines aren’t shown here.

java/pkg/com/sun/jdi/VMMismatchException.java+44−0

This diff is large: its 45 lines aren’t shown here.

java/pkg/com/sun/jdi/VMOutOfMemoryException.java+43−0

This diff is large: its 44 lines aren’t shown here.

java/pkg/com/sun/jdi/Value.java+181−0

This diff is large: its 182 lines aren’t shown here.

java/pkg/com/sun/jdi/VirtualMachine.java+863−0

This diff is large: its 864 lines aren’t shown here.

java/pkg/com/sun/jdi/VirtualMachineManager.java+430−0

This diff is large: its 431 lines aren’t shown here.

java/pkg/com/sun/jdi/VoidType.java+39−0

This diff is large: its 40 lines aren’t shown here.

java/pkg/com/sun/jdi/VoidValue.java+51−0

This diff is large: its 52 lines aren’t shown here.

java/pkg/com/sun/jdi/connect/AttachingConnector.java+69−0

This diff is large: its 70 lines aren’t shown here.

java/pkg/com/sun/jdi/connect/Connector.java+285−0

This diff is large: its 286 lines aren’t shown here.

java/pkg/com/sun/jdi/connect/IllegalConnectorArgumentsException.java+79−0

This diff is large: its 80 lines aren’t shown here.

java/pkg/com/sun/jdi/connect/LaunchingConnector.java+74−0

This diff is large: its 75 lines aren’t shown here.

java/pkg/com/sun/jdi/connect/ListeningConnector.java+117−0

This diff is large: its 118 lines aren’t shown here.

java/pkg/com/sun/jdi/connect/Transport.java+52−0

This diff is large: its 53 lines aren’t shown here.

java/pkg/com/sun/jdi/connect/TransportTimeoutException.java+77−0

This diff is large: its 78 lines aren’t shown here.

java/pkg/com/sun/jdi/connect/VMStartException.java+55−0

This diff is large: its 56 lines aren’t shown here.

java/pkg/com/sun/jdi/connect/mkfile+19−0

This diff is large: its 20 lines aren’t shown here.

java/pkg/com/sun/jdi/connect/package.html+43−0

This diff is large: its 44 lines aren’t shown here.

java/pkg/com/sun/jdi/connect/spi/ClosedConnectionException.java+67−0

This diff is large: its 68 lines aren’t shown here.

java/pkg/com/sun/jdi/connect/spi/Connection.java+200−0

This diff is large: its 201 lines aren’t shown here.

java/pkg/com/sun/jdi/connect/spi/TransportService.java+377−0

This diff is large: its 378 lines aren’t shown here.

java/pkg/com/sun/jdi/connect/spi/mkfile+10−0

This diff is large: its 11 lines aren’t shown here.

java/pkg/com/sun/jdi/connect/spi/package.html+35−0

This diff is large: its 36 lines aren’t shown here.

java/pkg/com/sun/jdi/doc-files/mkfile+2−0

This diff is large: its 3 lines aren’t shown here.

java/pkg/com/sun/jdi/doc-files/signature.html+39−0

This diff is large: its 40 lines aren’t shown here.

java/pkg/com/sun/jdi/event/AccessWatchpointEvent.java+41−0

This diff is large: its 42 lines aren’t shown here.

java/pkg/com/sun/jdi/event/BreakpointEvent.java+52−0

This diff is large: its 53 lines aren’t shown here.

java/pkg/com/sun/jdi/event/ClassPrepareEvent.java+73−0

This diff is large: its 74 lines aren’t shown here.

java/pkg/com/sun/jdi/event/ClassUnloadEvent.java+52−0

This diff is large: its 53 lines aren’t shown here.

java/pkg/com/sun/jdi/event/Event.java+54−0

This diff is large: its 55 lines aren’t shown here.

java/pkg/com/sun/jdi/event/EventIterator.java+49−0

This diff is large: its 50 lines aren’t shown here.

java/pkg/com/sun/jdi/event/EventQueue.java+88−0

This diff is large: its 89 lines aren’t shown here.

java/pkg/com/sun/jdi/event/EventSet.java+171−0

This diff is large: its 172 lines aren’t shown here.

java/pkg/com/sun/jdi/event/ExceptionEvent.java+94−0

This diff is large: its 95 lines aren’t shown here.

java/pkg/com/sun/jdi/event/LocatableEvent.java+48−0

This diff is large: its 49 lines aren’t shown here.

java/pkg/com/sun/jdi/event/MethodEntryEvent.java+54−0

This diff is large: its 55 lines aren’t shown here.

java/pkg/com/sun/jdi/event/MethodExitEvent.java+73−0

This diff is large: its 74 lines aren’t shown here.

java/pkg/com/sun/jdi/event/ModificationWatchpointEvent.java+48−0

This diff is large: its 49 lines aren’t shown here.

java/pkg/com/sun/jdi/event/MonitorContendedEnterEvent.java+60−0

This diff is large: its 61 lines aren’t shown here.

java/pkg/com/sun/jdi/event/MonitorContendedEnteredEvent.java+60−0

This diff is large: its 61 lines aren’t shown here.

java/pkg/com/sun/jdi/event/MonitorWaitEvent.java+65−0

This diff is large: its 66 lines aren’t shown here.

java/pkg/com/sun/jdi/event/MonitorWaitedEvent.java+67−0

This diff is large: its 68 lines aren’t shown here.

java/pkg/com/sun/jdi/event/StepEvent.java+51−0

This diff is large: its 52 lines aren’t shown here.

java/pkg/com/sun/jdi/event/ThreadDeathEvent.java+56−0

This diff is large: its 57 lines aren’t shown here.

java/pkg/com/sun/jdi/event/ThreadStartEvent.java+63−0

This diff is large: its 64 lines aren’t shown here.

java/pkg/com/sun/jdi/event/VMDeathEvent.java+72−0

This diff is large: its 73 lines aren’t shown here.

java/pkg/com/sun/jdi/event/VMDisconnectEvent.java+56−0

This diff is large: its 57 lines aren’t shown here.

java/pkg/com/sun/jdi/event/VMStartEvent.java+54−0

This diff is large: its 55 lines aren’t shown here.

java/pkg/com/sun/jdi/event/WatchpointEvent.java+67−0

This diff is large: its 68 lines aren’t shown here.

java/pkg/com/sun/jdi/event/mkfile+31−0

This diff is large: its 32 lines aren’t shown here.

java/pkg/com/sun/jdi/event/package.html+49−0

This diff is large: its 50 lines aren’t shown here.

java/pkg/com/sun/jdi/mkfile+79−0

This diff is large: its 80 lines aren’t shown here.

java/pkg/com/sun/jdi/package.html+50−0

This diff is large: its 51 lines aren’t shown here.

java/pkg/com/sun/jdi/request/AccessWatchpointRequest.java+60−0

This diff is large: its 61 lines aren’t shown here.

java/pkg/com/sun/jdi/request/BreakpointRequest.java+87−0

This diff is large: its 88 lines aren’t shown here.

java/pkg/com/sun/jdi/request/ClassPrepareRequest.java+124−0

This diff is large: its 125 lines aren’t shown here.

java/pkg/com/sun/jdi/request/ClassUnloadRequest.java+76−0

This diff is large: its 77 lines aren’t shown here.

java/pkg/com/sun/jdi/request/DuplicateRequestException.java+45−0

This diff is large: its 46 lines aren’t shown here.

java/pkg/com/sun/jdi/request/EventRequest.java+210−0

This diff is large: its 211 lines aren’t shown here.

java/pkg/com/sun/jdi/request/EventRequestManager.java+544−0

This diff is large: its 545 lines aren’t shown here.

java/pkg/com/sun/jdi/request/ExceptionRequest.java+155−0

This diff is large: its 156 lines aren’t shown here.

java/pkg/com/sun/jdi/request/InvalidRequestStateException.java+48−0

This diff is large: its 49 lines aren’t shown here.

java/pkg/com/sun/jdi/request/MethodEntryRequest.java+116−0

This diff is large: its 117 lines aren’t shown here.

java/pkg/com/sun/jdi/request/MethodExitRequest.java+119−0

This diff is large: its 120 lines aren’t shown here.

java/pkg/com/sun/jdi/request/ModificationWatchpointRequest.java+59−0

This diff is large: its 60 lines aren’t shown here.

java/pkg/com/sun/jdi/request/MonitorContendedEnterRequest.java+116−0

This diff is large: its 117 lines aren’t shown here.

java/pkg/com/sun/jdi/request/MonitorContendedEnteredRequest.java+116−0

This diff is large: its 117 lines aren’t shown here.

java/pkg/com/sun/jdi/request/MonitorWaitRequest.java+115−0

This diff is large: its 116 lines aren’t shown here.

java/pkg/com/sun/jdi/request/MonitorWaitedRequest.java+115−0

This diff is large: its 116 lines aren’t shown here.

java/pkg/com/sun/jdi/request/StepRequest.java+135−0

This diff is large: its 136 lines aren’t shown here.

java/pkg/com/sun/jdi/request/ThreadDeathRequest.java+58−0

This diff is large: its 59 lines aren’t shown here.

java/pkg/com/sun/jdi/request/ThreadStartRequest.java+58−0

This diff is large: its 59 lines aren’t shown here.

java/pkg/com/sun/jdi/request/VMDeathRequest.java+61−0

This diff is large: its 62 lines aren’t shown here.

java/pkg/com/sun/jdi/request/WatchpointRequest.java+120−0

This diff is large: its 121 lines aren’t shown here.

java/pkg/com/sun/jdi/request/mkfile+28−0

This diff is large: its 29 lines aren’t shown here.

java/pkg/com/sun/jdi/request/package.html+48−0

This diff is large: its 49 lines aren’t shown here.

java/pkg/com/sun/jmx/defaults/JmxProperties.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/defaults/JmxProperties.java+232−0

This diff is large: its 233 lines aren’t shown here.

java/pkg/com/sun/jmx/defaults/ServiceName.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/defaults/ServiceName.java+97−0

This diff is large: its 98 lines aren’t shown here.

java/pkg/com/sun/jmx/defaults/mkfile+9−0

This diff is large: its 10 lines aren’t shown here.

java/pkg/com/sun/jmx/defaults/package.html+33−0

This diff is large: its 34 lines aren’t shown here.

java/pkg/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor$1.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor$2.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor$ListenerWrapper.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor$ResourceContext$1.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor$ResourceContext.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java+2064−0

This diff is large: its 2065 lines aren’t shown here.

java/pkg/com/sun/jmx/interceptor/MBeanServerInterceptor.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/interceptor/MBeanServerInterceptor.java+130−0

This diff is large: its 131 lines aren’t shown here.

java/pkg/com/sun/jmx/interceptor/mkfile+9−0

This diff is large: its 10 lines aren’t shown here.

java/pkg/com/sun/jmx/interceptor/package.html+36−0

This diff is large: its 37 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/ClassLoaderRepositorySupport$LoaderEntry.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/ClassLoaderRepositorySupport.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/ClassLoaderRepositorySupport.java+304−0

This diff is large: its 305 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/ConvertingMethod.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/ConvertingMethod.java+228−0

This diff is large: its 229 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$1.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$ArrayMapping.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$CollectionMapping.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$CompositeBuilder.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$CompositeBuilderCheckGetters.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$CompositeBuilderViaConstructor$Constr.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$CompositeBuilderViaConstructor.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$CompositeBuilderViaFrom.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$CompositeBuilderViaProxy.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$CompositeBuilderViaSetters.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$CompositeMapping.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$EnumMapping.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$IdentityMapping.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$MXBeanRefMapping.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$Mappings.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$NonNullMXBeanMapping.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory$TabularMapping.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java+1492−0

This diff is large: its 1493 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/DescriptorCache.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/DescriptorCache.java+67−0

This diff is large: its 68 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/DynamicMBean2.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/DynamicMBean2.java+77−0

This diff is large: its 78 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/GetPropertyAction.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/GetPropertyAction.java+46−0

This diff is large: its 47 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/Introspector$BeansHelper.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/Introspector$SimpleIntrospector.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/Introspector.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/Introspector.java+778−0

This diff is large: its 779 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/JmxMBeanServer$1.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/JmxMBeanServer.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/JmxMBeanServer.java+1497−0

This diff is large: its 1498 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/JmxMBeanServerBuilder.java+114−0

This diff is large: its 115 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/MBeanAnalyzer$1.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/MBeanAnalyzer$AttrMethods.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/MBeanAnalyzer$MBeanVisitor.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/MBeanAnalyzer$MethodOrder.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/MBeanAnalyzer.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/MBeanAnalyzer.java+270−0

This diff is large: its 271 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/MBeanInstantiator.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/MBeanInstantiator.java+718−0

This diff is large: its 719 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/MBeanIntrospector$1.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/MBeanIntrospector$MBeanInfoMaker.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/MBeanIntrospector$MBeanInfoMap.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/MBeanIntrospector$PerInterfaceMap.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/MBeanIntrospector.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/MBeanIntrospector.java+469−0

This diff is large: its 470 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/MBeanServerDelegateImpl.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/MBeanServerDelegateImpl.java+321−0

This diff is large: its 322 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/MBeanSupport.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/MBeanSupport.java+274−0

This diff is large: its 275 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/MXBeanIntrospector.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/MXBeanIntrospector.java+365−0

This diff is large: its 366 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/MXBeanLookup.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/MXBeanLookup.java+188−0

This diff is large: its 189 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/MXBeanMapping.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/MXBeanMapping.java+210−0

This diff is large: its 211 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/MXBeanMappingFactory.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/MXBeanMappingFactory.java+124−0

This diff is large: its 125 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/MXBeanProxy$1.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/MXBeanProxy$GetHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/MXBeanProxy$Handler.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/MXBeanProxy$InvokeHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/MXBeanProxy$SetHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/MXBeanProxy$Visitor.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/MXBeanProxy.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/MXBeanProxy.java+175−0

This diff is large: its 176 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/MXBeanSupport.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/MXBeanSupport.java+178−0

This diff is large: its 179 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/ModifiableClassLoaderRepository.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/ModifiableClassLoaderRepository.java+70−0

This diff is large: its 71 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/NamedObject.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/NamedObject.java+122−0

This diff is large: its 123 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/ObjectInputStreamWithLoader.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/ObjectInputStreamWithLoader.java+68−0

This diff is large: its 69 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/PerInterface$1.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/PerInterface$InitMaps.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/PerInterface$MethodAndSig.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/PerInterface.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/PerInterface.java+280−0

This diff is large: its 281 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/Repository$ObjectNamePattern.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/Repository$RegistrationContext.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/Repository.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/Repository.java+678−0

This diff is large: its 679 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/SecureClassLoaderRepository.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/SecureClassLoaderRepository.java+64−0

This diff is large: its 65 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/StandardMBeanIntrospector.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/StandardMBeanIntrospector.java+192−0

This diff is large: its 193 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/StandardMBeanSupport.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/StandardMBeanSupport.java+95−0

This diff is large: its 96 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/SunJmxMBeanServer.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/SunJmxMBeanServer.java+90−0

This diff is large: its 91 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/Util.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/Util.java+241−0

This diff is large: its 242 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/WeakIdentityHashMap$IdentityWeakReference.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/WeakIdentityHashMap.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/mbeanserver/WeakIdentityHashMap.java+137−0

This diff is large: its 138 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/mkfile+38−0

This diff is large: its 39 lines aren’t shown here.

java/pkg/com/sun/jmx/mbeanserver/package.html+33−0

This diff is large: its 34 lines aren’t shown here.

java/pkg/com/sun/jmx/mkfile+10−0

This diff is large: its 11 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/internal/ArrayNotificationBuffer$1.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ArrayNotificationBuffer$2.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ArrayNotificationBuffer$3.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ArrayNotificationBuffer$4.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ArrayNotificationBuffer$5.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ArrayNotificationBuffer$BroadcasterQuery.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ArrayNotificationBuffer$BufferListener.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ArrayNotificationBuffer$NamedNotification.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ArrayNotificationBuffer$ShareBuffer.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ArrayNotificationBuffer.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ArrayNotificationBuffer.java+838−0

This diff is large: its 839 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/internal/ArrayQueue.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ArrayQueue.java+102−0

This diff is large: its 103 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/internal/ClientCommunicatorAdmin$1.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ClientCommunicatorAdmin$Checker.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ClientCommunicatorAdmin.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ClientCommunicatorAdmin.java+252−0

This diff is large: its 253 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/internal/ClientListenerInfo.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ClientListenerInfo.java+106−0

This diff is large: its 107 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/internal/ClientNotifForwarder$1.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ClientNotifForwarder$LinearExecutor$1.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ClientNotifForwarder$LinearExecutor.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ClientNotifForwarder$NotifFetcher$1.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ClientNotifForwarder$NotifFetcher.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ClientNotifForwarder.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ClientNotifForwarder.java+910−0

This diff is large: its 911 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/internal/IIOPHelper$1.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/IIOPHelper.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/IIOPHelper.java+188−0

This diff is large: its 189 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/internal/IIOPProxy.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/IIOPProxy.java+110−0

This diff is large: its 111 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/internal/NotificationBuffer.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/NotificationBuffer.java+72−0

This diff is large: its 73 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/internal/NotificationBufferFilter.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/NotificationBufferFilter.java+40−0

This diff is large: its 41 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/internal/ProxyRef.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ProxyRef.java+103−0

This diff is large: its 104 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/internal/RMIExporter.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/RMIExporter.java+59−0

This diff is large: its 60 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/internal/ServerCommunicatorAdmin$1.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ServerCommunicatorAdmin$Timeout.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ServerCommunicatorAdmin.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ServerCommunicatorAdmin.java+232−0

This diff is large: its 233 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/internal/ServerNotifForwarder$1.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ServerNotifForwarder$2.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ServerNotifForwarder$3.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ServerNotifForwarder$IdAndFilter.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ServerNotifForwarder.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/internal/ServerNotifForwarder.java+494−0

This diff is large: its 495 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/internal/Unmarshal.java+34−0

This diff is large: its 35 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/internal/mkfile+21−0

This diff is large: its 22 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/internal/package.html+37−0

This diff is large: its 38 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/mkfile+9−0

This diff is large: its 10 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/protocol/iiop/ClientProvider.java+48−0

This diff is large: its 49 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/protocol/iiop/IIOPProxyImpl.java+119−0

This diff is large: its 120 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/protocol/iiop/ProxyInputStream.java+241−0

This diff is large: its 242 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/protocol/iiop/ServerProvider.java+51−0

This diff is large: its 52 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/protocol/iiop/mkfile+11−0

This diff is large: its 12 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/protocol/mkfile+7−0

This diff is large: its 8 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/protocol/rmi/ClientProvider.java+48−0

This diff is large: its 49 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/protocol/rmi/ServerProvider.java+51−0

This diff is large: its 52 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/protocol/rmi/mkfile+9−0

This diff is large: its 10 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/security/FileLoginModule.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/security/FileLoginModule.java+570−0

This diff is large: its 571 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/security/JMXPluggableAuthenticator$1.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/security/JMXPluggableAuthenticator$2.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/security/JMXPluggableAuthenticator$FileLoginConfig.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/security/JMXPluggableAuthenticator$JMXCallbackHandler.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/security/JMXPluggableAuthenticator.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/security/JMXPluggableAuthenticator.java+346−0

This diff is large: its 347 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/security/JMXSubjectDomainCombiner.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/security/JMXSubjectDomainCombiner.java+106−0

This diff is large: its 107 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/security/MBeanServerAccessController.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/security/MBeanServerAccessController.java+665−0

This diff is large: its 666 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/security/MBeanServerFileAccessController$1.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/security/MBeanServerFileAccessController$2.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/security/MBeanServerFileAccessController$Access.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/security/MBeanServerFileAccessController$AccessType.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/security/MBeanServerFileAccessController$Parser.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/security/MBeanServerFileAccessController.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/security/MBeanServerFileAccessController.java+544−0

This diff is large: its 545 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/security/NotificationAccessController.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/security/NotificationAccessController.java+110−0

This diff is large: its 111 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/security/SubjectDelegator$1.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/security/SubjectDelegator.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/security/SubjectDelegator.java+148−0

This diff is large: its 149 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/security/mkfile+14−0

This diff is large: its 15 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/util/CacheMap.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/util/CacheMap.java+121−0

This diff is large: its 122 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/util/ClassLoaderWithRepository.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/util/ClassLoaderWithRepository.java+55−0

This diff is large: its 56 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/util/ClassLogger.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/util/ClassLogger.java+246−0

This diff is large: its 247 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/util/EnvHelp$1.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/util/EnvHelp$SinkOutputStream.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/util/EnvHelp.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/util/EnvHelp.java+808−0

This diff is large: its 809 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/util/OrderClassLoaders.class+0−0

Binary file not shown.

java/pkg/com/sun/jmx/remote/util/OrderClassLoaders.java+48−0

This diff is large: its 49 lines aren’t shown here.

java/pkg/com/sun/jmx/remote/util/mkfile+12−0

This diff is large: its 13 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/BerDecoder.java+757−0

This diff is large: its 758 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/BerEncoder.java+477−0

This diff is large: its 478 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/BerException.java+63−0

This diff is large: its 64 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/EnumRowStatus.java+308−0

This diff is large: its 309 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/Enumerated.java+219−0

This diff is large: its 220 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/ASCII_CharStream.README+23−0

This diff is large: its 24 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/ASCII_CharStream.java+402−0

This diff is large: its 403 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/AclEntryImpl.java+263−0

This diff is large: its 264 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/AclImpl.java+287−0

This diff is large: its 288 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/GroupImpl.java+142−0

This diff is large: its 143 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/Host.java+181−0

This diff is large: its 182 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/JDMAccess.java+64−0

This diff is large: its 65 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/JDMAclBlock.java+61−0

This diff is large: its 62 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/JDMAclItem.java+58−0

This diff is large: its 59 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/JDMCommunities.java+53−0

This diff is large: its 54 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/JDMCommunity.java+53−0

This diff is large: its 54 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/JDMEnterprise.java+49−0

This diff is large: its 50 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/JDMHost.java+51−0

This diff is large: its 52 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/JDMHostInform.java+48−0

This diff is large: its 49 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/JDMHostName.java+62−0

This diff is large: its 63 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/JDMHostTrap.java+49−0

This diff is large: its 50 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/JDMInformBlock.java+60−0

This diff is large: its 61 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/JDMInformCommunity.java+51−0

This diff is large: its 52 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/JDMInformInterestedHost.java+46−0

This diff is large: its 47 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/JDMInformItem.java+51−0

This diff is large: its 52 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/JDMIpAddress.java+63−0

This diff is large: its 64 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/JDMIpMask.java+63−0

This diff is large: its 64 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/JDMIpV6Address.java+41−0

This diff is large: its 42 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/JDMManagers.java+47−0

This diff is large: its 48 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/JDMNetMask.java+58−0

This diff is large: its 59 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/JDMNetMaskV6.java+46−0

This diff is large: its 47 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/JDMSecurityDefs.java+47−0

This diff is large: its 48 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/JDMTrapBlock.java+61−0

This diff is large: its 62 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/JDMTrapCommunity.java+52−0

This diff is large: its 53 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/JDMTrapInterestedHost.java+47−0

This diff is large: its 48 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/JDMTrapItem.java+53−0

This diff is large: its 54 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/JDMTrapNum.java+50−0

This diff is large: its 51 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/JJTParserState.java+149−0

This diff is large: its 150 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/NetMaskImpl.java+266−0

This diff is large: its 267 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/Node.java+60−0

This diff is large: its 61 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/OwnerImpl.java+137−0

This diff is large: its 138 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/ParseError.java+38−0

This diff is large: its 39 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/ParseException.java+217−0

This diff is large: its 218 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/Parser.java+1285−0

This diff is large: its 1286 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/Parser.jj+948−0

This diff is large: its 949 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/Parser.jjt+380−0

This diff is large: its 381 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/ParserConstants.java+111−0

This diff is large: its 112 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/ParserTokenManager.java+1514−0

This diff is large: its 1515 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/ParserTreeConstants.java+88−0

This diff is large: its 89 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/PermissionImpl.java+89−0

This diff is large: its 90 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/PrincipalImpl.java+148−0

This diff is large: its 149 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/README.update+29−0

This diff is large: its 30 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/SimpleNode.java+155−0

This diff is large: its 156 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/SnmpAcl.java+486−0

This diff is large: its 487 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/Token.java+107−0

This diff is large: its 108 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/TokenMgrError.java+160−0

This diff is large: its 161 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/mkfile+54−0

This diff is large: its 55 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/IPAcl/package.html+34−0

This diff is large: its 35 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/InetAddressAcl.java+128−0

This diff is large: its 129 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/ServiceName.java+170−0

This diff is large: its 171 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpAckPdu.java+39−0

This diff is large: its 40 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpBadSecurityLevelException.java+38−0

This diff is large: its 39 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpCounter.java+99−0

This diff is large: its 100 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpCounter64.java+214−0

This diff is large: its 215 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpEngine.java+70−0

This diff is large: its 71 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpEngineFactory.java+58−0

This diff is large: its 59 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpEngineId.java+489−0

This diff is large: its 490 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpEngineParameters.java+117−0

This diff is large: its 118 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpGauge.java+99−0

This diff is large: its 100 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpInt.java+282−0

This diff is large: its 283 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpIpAddress.java+217−0

This diff is large: its 218 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpMessage.java+362−0

This diff is large: its 363 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpMsg.java+476−0

This diff is large: its 477 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpNull.java+183−0

This diff is large: its 184 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpOpaque.java+100−0

This diff is large: its 101 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpParams.java+76−0

This diff is large: its 77 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpPdu.java+124−0

This diff is large: its 125 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpPduBulk.java+119−0

This diff is large: its 120 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpPduBulkType.java+58−0

This diff is large: its 59 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpPduFactory.java+94−0

This diff is large: its 95 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpPduFactoryBER.java+131−0

This diff is large: its 132 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpPduRequest.java+109−0

This diff is large: its 110 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpPduRequestType.java+60−0

This diff is large: its 61 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpPduTrap.java+93−0

This diff is large: its 94 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpScopedPduBulk.java+110−0

This diff is large: its 111 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpScopedPduPacket.java+104−0

This diff is large: its 105 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpScopedPduRequest.java+95−0

This diff is large: its 96 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpSecurityException.java+67−0

This diff is large: its 68 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpSecurityParameters.java+54−0

This diff is large: its 55 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpStatusException.java+146−0

This diff is large: its 147 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpString.java+278−0

This diff is large: its 279 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpStringFixed.java+193−0

This diff is large: its 194 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpTooBigException.java+82−0

This diff is large: its 83 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpUnknownAccContrModelException.java+47−0

This diff is large: its 48 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpUnknownModelException.java+42−0

This diff is large: its 43 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpUnknownModelLcdException.java+42−0

This diff is large: its 43 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpUnknownMsgProcModelException.java+45−0

This diff is large: its 46 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpUnknownSecModelException.java+45−0

This diff is large: its 46 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpUnknownSubSystemException.java+42−0

This diff is large: its 43 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpUnsignedInt.java+125−0

This diff is large: its 126 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpUsmKeyHandler.java+98−0

This diff is large: its 99 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpV3Message.java+511−0

This diff is large: its 512 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/SnmpValue.java+96−0

This diff is large: its 97 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/ThreadContext.java+326−0

This diff is large: its 327 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/UserAcl.java+97−0

This diff is large: its 98 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/agent/SnmpEntryOid.java+51−0

This diff is large: its 52 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/agent/SnmpErrorHandlerAgent.java+206−0

This diff is large: its 207 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/agent/SnmpGenericMetaServer.java+132−0

This diff is large: its 133 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/agent/SnmpGenericObjectServer.java+573−0

This diff is large: its 574 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/agent/SnmpIndex.java+190−0

This diff is large: its 191 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/agent/SnmpMib.java+1026−0

This diff is large: its 1027 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/agent/SnmpMibAgent.java+757−0

This diff is large: its 758 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/agent/SnmpMibAgentMBean.java+316−0

This diff is large: its 317 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/agent/SnmpMibEntry.java+194−0

This diff is large: its 195 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/agent/SnmpMibGroup.java+519−0

This diff is large: its 520 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/agent/SnmpMibHandler.java+155−0

This diff is large: its 156 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/agent/SnmpMibNode.java+414−0

This diff is large: its 415 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/agent/SnmpMibOid.java+561−0

This diff is large: its 562 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/agent/SnmpMibRequest.java+175−0

This diff is large: its 176 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/agent/SnmpMibRequestImpl.java+242−0

This diff is large: its 243 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/agent/SnmpMibSubRequest.java+209−0

This diff is large: its 210 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/agent/SnmpMibTable.java+2570−0

This diff is large: its 2571 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/agent/SnmpRequestTree.java+1071−0

This diff is large: its 1072 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/agent/SnmpStandardMetaServer.java+119−0

This diff is large: its 120 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/agent/SnmpStandardObjectServer.java+264−0

This diff is large: its 265 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/agent/SnmpTableCallbackHandler.java+76−0

This diff is large: its 77 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/agent/SnmpTableEntryFactory.java+91−0

This diff is large: its 92 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/agent/SnmpTableEntryNotification.java+141−0

This diff is large: its 142 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/agent/SnmpTableSupport.java+571−0

This diff is large: its 572 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/agent/SnmpUserDataFactory.java+124−0

This diff is large: its 125 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/agent/mkfile+32−0

This diff is large: its 33 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/agent/package.html+34−0

This diff is large: its 35 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/daemon/ClientHandler.java+133−0

This diff is large: its 134 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/daemon/CommunicationException.java+77−0

This diff is large: its 78 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/daemon/CommunicatorServer.java+1375−0

This diff is large: its 1376 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/daemon/CommunicatorServerMBean.java+171−0

This diff is large: its 172 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/daemon/SnmpAdaptorServer.java+2659−0

This diff is large: its 2660 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/daemon/SnmpAdaptorServerMBean.java+700−0

This diff is large: its 701 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/daemon/SnmpInformHandler.java+80−0

This diff is large: its 81 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/daemon/SnmpMibTree.java+269−0

This diff is large: its 270 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/daemon/SnmpRequestHandler.java+1152−0

This diff is large: its 1153 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/daemon/SnmpSubBulkRequestHandler.java+345−0

This diff is large: its 346 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/daemon/SnmpSubNextRequestHandler.java+272−0

This diff is large: its 273 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/daemon/SnmpSubRequestHandler.java+630−0

This diff is large: its 631 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/daemon/mkfile+19−0

This diff is large: its 20 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/daemon/package.html+34−0

This diff is large: its 35 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/defaults/DefaultPaths.java+245−0

This diff is large: its 246 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/defaults/SnmpProperties.java+178−0

This diff is large: its 179 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/defaults/mkfile+9−0

This diff is large: its 10 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/defaults/package.html+34−0

This diff is large: its 35 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/internal/SnmpAccessControlModel.java+92−0

This diff is large: its 93 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/internal/SnmpAccessControlSubSystem.java+76−0

This diff is large: its 77 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/internal/SnmpDecryptedPdu.java+50−0

This diff is large: its 51 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/internal/SnmpEngineImpl.java+424−0

This diff is large: its 425 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/internal/SnmpIncomingRequest.java+164−0

This diff is large: its 165 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/internal/SnmpIncomingResponse.java+122−0

This diff is large: its 123 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/internal/SnmpLcd.java+136−0

This diff is large: its 137 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/internal/SnmpModel.java+44−0

This diff is large: its 45 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/internal/SnmpModelLcd.java+35−0

This diff is large: its 36 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/internal/SnmpMsgProcessingModel.java+147−0

This diff is large: its 148 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/internal/SnmpMsgProcessingSubSystem.java+162−0

This diff is large: its 163 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/internal/SnmpOutgoingRequest.java+88−0

This diff is large: its 89 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/internal/SnmpSecurityCache.java+34−0

This diff is large: its 35 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/internal/SnmpSecurityModel.java+176−0

This diff is large: its 177 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/internal/SnmpSecuritySubSystem.java+178−0

This diff is large: its 179 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/internal/SnmpSubSystem.java+73−0

This diff is large: its 74 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/internal/SnmpTools.java+125−0

This diff is large: its 126 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/internal/mkfile+24−0

This diff is large: its 25 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/internal/package.html+34−0

This diff is large: its 35 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/mkfile+69−0

This diff is large: its 70 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/mpm/SnmpMsgTranslator.java+92−0

This diff is large: its 93 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/mpm/mkfile+8−0

This diff is large: its 9 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/mpm/package.html+34−0

This diff is large: its 35 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/package.html+34−0

This diff is large: its 35 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/tasks/Task.java+67−0

This diff is large: its 68 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/tasks/TaskServer.java+57−0

This diff is large: its 58 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/tasks/ThreadService.java+246−0

This diff is large: its 247 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/tasks/mkfile+10−0

This diff is large: its 11 lines aren’t shown here.

java/pkg/com/sun/jmx/snmp/tasks/package.html+34−0

This diff is large: its 35 lines aren’t shown here.

java/pkg/com/sun/jndi/cosnaming/CNBindingEnumeration.java+236−0

This diff is large: its 237 lines aren’t shown here.

java/pkg/com/sun/jndi/cosnaming/CNCtx.java+1160−0

This diff is large: its 1161 lines aren’t shown here.

java/pkg/com/sun/jndi/cosnaming/CNCtxFactory.java+51−0

This diff is large: its 52 lines aren’t shown here.

java/pkg/com/sun/jndi/cosnaming/CNNameParser.java+500−0

This diff is large: its 501 lines aren’t shown here.

java/pkg/com/sun/jndi/cosnaming/CorbanameUrl.java+128−0

This diff is large: its 129 lines aren’t shown here.

java/pkg/com/sun/jndi/cosnaming/ExceptionMapper.java+242−0

This diff is large: its 243 lines aren’t shown here.

java/pkg/com/sun/jndi/cosnaming/IiopUrl.java+223−0

This diff is large: its 224 lines aren’t shown here.

java/pkg/com/sun/jndi/cosnaming/OrbReuseTracker.java+70−0

This diff is large: its 71 lines aren’t shown here.

java/pkg/com/sun/jndi/cosnaming/RemoteToCorba.java+88−0

This diff is large: its 89 lines aren’t shown here.

java/pkg/com/sun/jndi/cosnaming/jndiprovider.properties+4−0

This diff is large: its 5 lines aren’t shown here.

java/pkg/com/sun/jndi/cosnaming/mkfile+16−0

This diff is large: its 17 lines aren’t shown here.

java/pkg/com/sun/jndi/dns/DnsClient.java+699−0

This diff is large: its 700 lines aren’t shown here.

java/pkg/com/sun/jndi/dns/DnsContext.java+1068−0

This diff is large: its 1069 lines aren’t shown here.

java/pkg/com/sun/jndi/dns/DnsContextFactory.java+259−0

This diff is large: its 260 lines aren’t shown here.

java/pkg/com/sun/jndi/dns/DnsName.java+608−0

This diff is large: its 609 lines aren’t shown here.

java/pkg/com/sun/jndi/dns/DnsNameParser.java+55−0

This diff is large: its 56 lines aren’t shown here.

java/pkg/com/sun/jndi/dns/DnsUrl.java+119−0

This diff is large: its 120 lines aren’t shown here.

java/pkg/com/sun/jndi/dns/Header.java+126−0

This diff is large: its 127 lines aren’t shown here.

java/pkg/com/sun/jndi/dns/NameNode.java+156−0

This diff is large: its 157 lines aren’t shown here.

java/pkg/com/sun/jndi/dns/Resolver.java+192−0

This diff is large: its 193 lines aren’t shown here.

java/pkg/com/sun/jndi/dns/ResourceRecord.java+589−0

This diff is large: its 590 lines aren’t shown here.

java/pkg/com/sun/jndi/dns/ResourceRecords.java+140−0

This diff is large: its 141 lines aren’t shown here.

java/pkg/com/sun/jndi/dns/ZoneNode.java+205−0

This diff is large: its 206 lines aren’t shown here.

java/pkg/com/sun/jndi/dns/mkfile+19−0

This diff is large: its 20 lines aren’t shown here.

java/pkg/com/sun/jndi/ldap/BasicControl.class+0−0

Binary file not shown.

java/pkg/com/sun/jndi/ldap/BasicControl.java+118−0

This diff is large: its 119 lines aren’t shown here.

java/pkg/com/sun/jndi/ldap/Ber$DecodeException.class+0−0

Binary file not shown.

java/pkg/com/sun/jndi/ldap/Ber$EncodeException.class+0−0

Binary file not shown.

java/pkg/com/sun/jndi/ldap/Ber.class+0−0

Binary file not shown.

java/pkg/com/sun/jndi/ldap/Ber.java+107−0

This diff is large: its 108 lines aren’t shown here.

java/pkg/com/sun/jndi/ldap/BerDecoder.class+0−0

Binary file not shown.

This diff is larger than a page shows: the files after these aren’t listed. Clone the repository to see all of it.