Showing the changes to java/pkg/sun (1875 of 18352 files). Show all
Unified · Split
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1,151 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1995, 2003, 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 | +package sun.applet; | |
| 27 | + | |
| 28 | +import java.io.IOException; | |
| 29 | +import java.io.InputStream; | |
| 30 | +import java.io.ByteArrayInputStream; | |
| 31 | +import java.net.URL; | |
| 32 | +import java.net.URLConnection; | |
| 33 | +import java.applet.AudioClip; | |
| 34 | + | |
| 35 | +import com.sun.media.sound.JavaSoundAudioClip; | |
| 36 | + | |
| 37 | + | |
| 38 | +/** | |
| 39 | + * Applet audio clip; | |
| 40 | + * | |
| 41 | + * @author Arthur van Hoff, Kara Kytle | |
| 42 | + */ | |
| 43 | + | |
| 44 | +public class AppletAudioClip implements AudioClip { | |
| 45 | + | |
| 46 | + // url that this AudioClip is based on | |
| 47 | + private URL url = null; | |
| 48 | + | |
| 49 | + // the audio clip implementation | |
| 50 | + private AudioClip audioClip = null; | |
| 51 | + | |
| 52 | + boolean DEBUG = false /*true*/; | |
| 53 | + | |
| 54 | + /** | |
| 55 | + * Constructs an AppletAudioClip from an URL. | |
| 56 | + */ | |
| 57 | + public AppletAudioClip(URL url) { | |
| 58 | + | |
| 59 | + // store the url | |
| 60 | + this.url = url; | |
| 61 | + | |
| 62 | + try { | |
| 63 | + // create a stream from the url, and use it | |
| 64 | + // in the clip. | |
| 65 | + InputStream in = url.openStream(); | |
| 66 | + createAppletAudioClip(in); | |
| 67 | + | |
| 68 | + } catch (IOException e) { | |
| 69 | + /* just quell it */ | |
| 70 | + if (DEBUG) { | |
| 71 | + System.err.println("IOException creating AppletAudioClip" + e); | |
| 72 | + } | |
| 73 | + } | |
| 74 | + } | |
| 75 | + | |
| 76 | + /** | |
| 77 | + * Constructs an AppletAudioClip from a URLConnection. | |
| 78 | + */ | |
| 79 | + public AppletAudioClip(URLConnection uc) { | |
| 80 | + | |
| 81 | + try { | |
| 82 | + // create a stream from the url, and use it | |
| 83 | + // in the clip. | |
| 84 | + createAppletAudioClip(uc.getInputStream()); | |
| 85 | + | |
| 86 | + } catch (IOException e) { | |
| 87 | + /* just quell it */ | |
| 88 | + if (DEBUG) { | |
| 89 | + System.err.println("IOException creating AppletAudioClip" + e); | |
| 90 | + } | |
| 91 | + } | |
| 92 | + } | |
| 93 | + | |
| 94 | + | |
| 95 | + /** | |
| 96 | + * For constructing directly from Jar entries, or any other | |
| 97 | + * raw Audio data. Note that the data provided must include the format | |
| 98 | + * header. | |
| 99 | + */ | |
| 100 | + public AppletAudioClip(byte [] data) { | |
| 101 | + | |
| 102 | + try { | |
| 103 | + | |
| 104 | + // construct a stream from the byte array | |
| 105 | + InputStream in = new ByteArrayInputStream(data); | |
| 106 | + | |
| 107 | + createAppletAudioClip(in); | |
| 108 | + | |
| 109 | + } catch (IOException e) { | |
| 110 | + /* just quell it */ | |
| 111 | + if (DEBUG) { | |
| 112 | + System.err.println("IOException creating AppletAudioClip " + e); | |
| 113 | + } | |
| 114 | + } | |
| 115 | + } | |
| 116 | + | |
| 117 | + | |
| 118 | + /* | |
| 119 | + * Does the real work of creating an AppletAudioClip from an InputStream. | |
| 120 | + * This function is used by both constructors. | |
| 121 | + */ | |
| 122 | + void createAppletAudioClip(InputStream in) throws IOException { | |
| 123 | + | |
| 124 | + try { | |
| 125 | + audioClip = new JavaSoundAudioClip(in); | |
| 126 | + } catch (Exception e3) { | |
| 127 | + // no matter what happened, we throw an IOException to avoid changing the interfaces.... | |
| 128 | + throw new IOException("Failed to construct the AudioClip: " + e3); | |
| 129 | + } | |
| 130 | + } | |
| 131 | + | |
| 132 | + | |
| 133 | + public synchronized void play() { | |
| 134 | + | |
| 135 | + if (audioClip != null) | |
| 136 | + audioClip.play(); | |
| 137 | + } | |
| 138 | + | |
| 139 | + | |
| 140 | + public synchronized void loop() { | |
| 141 | + | |
| 142 | + if (audioClip != null) | |
| 143 | + audioClip.loop(); | |
| 144 | + } | |
| 145 | + | |
| 146 | + public synchronized void stop() { | |
| 147 | + | |
| 148 | + if (audioClip != null) | |
| 149 | + audioClip.stop(); | |
| 150 | + } | |
| 151 | +} | |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1,873 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1995, 2011, 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 | +package sun.applet; | |
| 27 | + | |
| 28 | +import java.lang.NullPointerException; | |
| 29 | +import java.net.URL; | |
| 30 | +import java.net.URLClassLoader; | |
| 31 | +import java.net.SocketPermission; | |
| 32 | +import java.net.URLConnection; | |
| 33 | +import java.net.MalformedURLException; | |
| 34 | +import java.net.InetAddress; | |
| 35 | +import java.net.UnknownHostException; | |
| 36 | +import java.io.File; | |
| 37 | +import java.io.FilePermission; | |
| 38 | +import java.io.IOException; | |
| 39 | +import java.io.BufferedInputStream; | |
| 40 | +import java.io.InputStream; | |
| 41 | +import java.util.Enumeration; | |
| 42 | +import java.util.HashMap; | |
| 43 | +import java.util.NoSuchElementException; | |
| 44 | +import java.security.AccessController; | |
| 45 | +import java.security.AccessControlContext; | |
| 46 | +import java.security.PrivilegedAction; | |
| 47 | +import java.security.PrivilegedExceptionAction; | |
| 48 | +import java.security.PrivilegedActionException; | |
| 49 | +import java.security.CodeSource; | |
| 50 | +import java.security.Permission; | |
| 51 | +import java.security.PermissionCollection; | |
| 52 | +import sun.awt.AppContext; | |
| 53 | +import sun.awt.SunToolkit; | |
| 54 | +import sun.misc.IOUtils; | |
| 55 | +import sun.net.www.ParseUtil; | |
| 56 | +import sun.security.util.SecurityConstants; | |
| 57 | + | |
| 58 | +/** | |
| 59 | + * This class defines the class loader for loading applet classes and | |
| 60 | + * resources. It extends URLClassLoader to search the applet code base | |
| 61 | + * for the class or resource after checking any loaded JAR files. | |
| 62 | + */ | |
| 63 | +public class AppletClassLoader extends URLClassLoader { | |
| 64 | + private URL base; /* applet code base URL */ | |
| 65 | + private CodeSource codesource; /* codesource for the base URL */ | |
| 66 | + private AccessControlContext acc; | |
| 67 | + private boolean exceptionStatus = false; | |
| 68 | + | |
| 69 | + private final Object threadGroupSynchronizer = new Object(); | |
| 70 | + private final Object grabReleaseSynchronizer = new Object(); | |
| 71 | + | |
| 72 | + private boolean codebaseLookup = true; | |
| 73 | + private volatile boolean allowRecursiveDirectoryRead = true; | |
| 74 | + | |
| 75 | + /* | |
| 76 | + * Creates a new AppletClassLoader for the specified base URL. | |
| 77 | + */ | |
| 78 | + protected AppletClassLoader(URL base) { | |
| 79 | + super(new URL[0]); | |
| 80 | + this.base = base; | |
| 81 | + this.codesource = | |
| 82 | + new CodeSource(base, (java.security.cert.Certificate[]) null); | |
| 83 | + acc = AccessController.getContext(); | |
| 84 | + } | |
| 85 | + | |
| 86 | + public void disableRecursiveDirectoryRead() { | |
| 87 | + allowRecursiveDirectoryRead = false; | |
| 88 | + } | |
| 89 | + | |
| 90 | + | |
| 91 | + /** | |
| 92 | + * Set the codebase lookup flag. | |
| 93 | + */ | |
| 94 | + void setCodebaseLookup(boolean codebaseLookup) { | |
| 95 | + this.codebaseLookup = codebaseLookup; | |
| 96 | + } | |
| 97 | + | |
| 98 | + /* | |
| 99 | + * Returns the applet code base URL. | |
| 100 | + */ | |
| 101 | + URL getBaseURL() { | |
| 102 | + return base; | |
| 103 | + } | |
| 104 | + | |
| 105 | + /* | |
| 106 | + * Returns the URLs used for loading classes and resources. | |
| 107 | + */ | |
| 108 | + public URL[] getURLs() { | |
| 109 | + URL[] jars = super.getURLs(); | |
| 110 | + URL[] urls = new URL[jars.length + 1]; | |
| 111 | + System.arraycopy(jars, 0, urls, 0, jars.length); | |
| 112 | + urls[urls.length - 1] = base; | |
| 113 | + return urls; | |
| 114 | + } | |
| 115 | + | |
| 116 | + /* | |
| 117 | + * Adds the specified JAR file to the search path of loaded JAR files. | |
| 118 | + * Changed modifier to protected in order to be able to overwrite addJar() | |
| 119 | + * in PluginClassLoader.java | |
| 120 | + */ | |
| 121 | + protected void addJar(String name) throws IOException { | |
| 122 | + URL url; | |
| 123 | + try { | |
| 124 | + url = new URL(base, name); | |
| 125 | + } catch (MalformedURLException e) { | |
| 126 | + throw new IllegalArgumentException("name"); | |
| 127 | + } | |
| 128 | + addURL(url); | |
| 129 | + // DEBUG | |
| 130 | + //URL[] urls = getURLs(); | |
| 131 | + //for (int i = 0; i < urls.length; i++) { | |
| 132 | + // System.out.println("url[" + i + "] = " + urls[i]); | |
| 133 | + //} | |
| 134 | + } | |
| 135 | + | |
| 136 | + /* | |
| 137 | + * Override loadClass so that class loading errors can be caught in | |
| 138 | + * order to print better error messages. | |
| 139 | + */ | |
| 140 | + public synchronized Class loadClass(String name, boolean resolve) | |
| 141 | + throws ClassNotFoundException | |
| 142 | + { | |
| 143 | + // First check if we have permission to access the package. This | |
| 144 | + // should go away once we've added support for exported packages. | |
| 145 | + int i = name.lastIndexOf('.'); | |
| 146 | + if (i != -1) { | |
| 147 | + SecurityManager sm = System.getSecurityManager(); | |
| 148 | + if (sm != null) | |
| 149 | + sm.checkPackageAccess(name.substring(0, i)); | |
| 150 | + } | |
| 151 | + try { | |
| 152 | + return super.loadClass(name, resolve); | |
| 153 | + } catch (ClassNotFoundException e) { | |
| 154 | + //printError(name, e.getException()); | |
| 155 | + throw e; | |
| 156 | + } catch (RuntimeException e) { | |
| 157 | + //printError(name, e); | |
| 158 | + throw e; | |
| 159 | + } catch (Error e) { | |
| 160 | + //printError(name, e); | |
| 161 | + throw e; | |
| 162 | + } | |
| 163 | + } | |
| 164 | + | |
| 165 | + /* | |
| 166 | + * Finds the applet class with the specified name. First searches | |
| 167 | + * loaded JAR files then the applet code base for the class. | |
| 168 | + */ | |
| 169 | + protected Class findClass(String name) throws ClassNotFoundException { | |
| 170 | + | |
| 171 | + int index = name.indexOf(";"); | |
| 172 | + String cookie = ""; | |
| 173 | + if(index != -1) { | |
| 174 | + cookie = name.substring(index, name.length()); | |
| 175 | + name = name.substring(0, index); | |
| 176 | + } | |
| 177 | + | |
| 178 | + // check loaded JAR files | |
| 179 | + try { | |
| 180 | + return super.findClass(name); | |
| 181 | + } catch (ClassNotFoundException e) { | |
| 182 | + } | |
| 183 | + | |
| 184 | + // Otherwise, try loading the class from the code base URL | |
| 185 | + | |
| 186 | + // 4668479: Option to turn off codebase lookup in AppletClassLoader | |
| 187 | + // during resource requests. [stanley.ho] | |
| 188 | + if (codebaseLookup == false) | |
| 189 | + throw new ClassNotFoundException(name); | |
| 190 | + | |
| 191 | +// final String path = name.replace('.', '/').concat(".class").concat(cookie); | |
| 192 | + String encodedName = ParseUtil.encodePath(name.replace('.', '/'), false); | |
| 193 | + final String path = (new StringBuffer(encodedName)).append(".class").append(cookie).toString(); | |
| 194 | + try { | |
| 195 | + byte[] b = (byte[]) AccessController.doPrivileged( | |
| 196 | + new PrivilegedExceptionAction() { | |
| 197 | + public Object run() throws IOException { | |
| 198 | + try { | |
| 199 | + URL finalURL = new URL(base, path); | |
| 200 | + | |
| 201 | + // Make sure the codebase won't be modified | |
| 202 | + if (base.getProtocol().equals(finalURL.getProtocol()) && | |
| 203 | + base.getHost().equals(finalURL.getHost()) && | |
| 204 | + base.getPort() == finalURL.getPort()) { | |
| 205 | + return getBytes(finalURL); | |
| 206 | + } | |
| 207 | + else { | |
| 208 | + return null; | |
| 209 | + } | |
| 210 | + } catch (Exception e) { | |
| 211 | + return null; | |
| 212 | + } | |
| 213 | + } | |
| 214 | + }, acc); | |
| 215 | + | |
| 216 | + if (b != null) { | |
| 217 | + return defineClass(name, b, 0, b.length, codesource); | |
| 218 | + } else { | |
| 219 | + throw new ClassNotFoundException(name); | |
| 220 | + } | |
| 221 | + } catch (PrivilegedActionException e) { | |
| 222 | + throw new ClassNotFoundException(name, e.getException()); | |
| 223 | + } | |
| 224 | + } | |
| 225 | + | |
| 226 | + /** | |
| 227 | + * Returns the permissions for the given codesource object. | |
| 228 | + * The implementation of this method first calls super.getPermissions, | |
| 229 | + * to get the permissions | |
| 230 | + * granted by the super class, and then adds additional permissions | |
| 231 | + * based on the URL of the codesource. | |
| 232 | + * <p> | |
| 233 | + * If the protocol is "file" | |
| 234 | + * and the path specifies a file, permission is granted to read all files | |
| 235 | + * and (recursively) all files and subdirectories contained in | |
| 236 | + * that directory. This is so applets with a codebase of | |
| 237 | + * file:/blah/some.jar can read in file:/blah/, which is needed to | |
| 238 | + * be backward compatible. We also add permission to connect back to | |
| 239 | + * the "localhost". | |
| 240 | + * | |
| 241 | + * @param codesource the codesource | |
| 242 | + * @return the permissions granted to the codesource | |
| 243 | + */ | |
| 244 | + protected PermissionCollection getPermissions(CodeSource codesource) | |
| 245 | + { | |
| 246 | + final PermissionCollection perms = super.getPermissions(codesource); | |
| 247 | + | |
| 248 | + URL url = codesource.getLocation(); | |
| 249 | + | |
| 250 | + String path = null; | |
| 251 | + Permission p; | |
| 252 | + | |
| 253 | + try { | |
| 254 | + p = url.openConnection().getPermission(); | |
| 255 | + } catch (java.io.IOException ioe) { | |
| 256 | + p = null; | |
| 257 | + } | |
| 258 | + | |
| 259 | + if (p instanceof FilePermission) { | |
| 260 | + path = p.getName(); | |
| 261 | + } else if ((p == null) && (url.getProtocol().equals("file"))) { | |
| 262 | + path = url.getFile().replace('/', File.separatorChar); | |
| 263 | + path = ParseUtil.decode(path); | |
| 264 | + } | |
| 265 | + | |
| 266 | + if (path != null) { | |
| 267 | + final String rawPath = path; | |
| 268 | + if (!path.endsWith(File.separator)) { | |
| 269 | + int endIndex = path.lastIndexOf(File.separatorChar); | |
| 270 | + if (endIndex != -1) { | |
| 271 | + path = path.substring(0, endIndex + 1) + "-"; | |
| 272 | + perms.add(new FilePermission(path, | |
| 273 | + SecurityConstants.FILE_READ_ACTION)); | |
| 274 | + } | |
| 275 | + } | |
| 276 | + final File f = new File(rawPath); | |
| 277 | + final boolean isDirectory = f.isDirectory(); | |
| 278 | + // grant codebase recursive read permission | |
| 279 | + // this should only be granted to non-UNC file URL codebase and | |
| 280 | + // the codesource path must either be a directory, or a file | |
| 281 | + // that ends with .jar or .zip | |
| 282 | + if (allowRecursiveDirectoryRead && (isDirectory || | |
| 283 | + rawPath.toLowerCase().endsWith(".jar") || | |
| 284 | + rawPath.toLowerCase().endsWith(".zip"))) { | |
| 285 | + | |
| 286 | + Permission bperm; | |
| 287 | + try { | |
| 288 | + bperm = base.openConnection().getPermission(); | |
| 289 | + } catch (java.io.IOException ioe) { | |
| 290 | + bperm = null; | |
| 291 | + } | |
| 292 | + if (bperm instanceof FilePermission) { | |
| 293 | + String bpath = bperm.getName(); | |
| 294 | + if (bpath.endsWith(File.separator)) { | |
| 295 | + bpath += "-"; | |
| 296 | + } | |
| 297 | + perms.add(new FilePermission(bpath, | |
| 298 | + SecurityConstants.FILE_READ_ACTION)); | |
| 299 | + } else if ((bperm == null) && (base.getProtocol().equals("file"))) { | |
| 300 | + String bpath = base.getFile().replace('/', File.separatorChar); | |
| 301 | + bpath = ParseUtil.decode(bpath); | |
| 302 | + if (bpath.endsWith(File.separator)) { | |
| 303 | + bpath += "-"; | |
| 304 | + } | |
| 305 | + perms.add(new FilePermission(bpath, SecurityConstants.FILE_READ_ACTION)); | |
| 306 | + } | |
| 307 | + | |
| 308 | + } | |
| 309 | + } | |
| 310 | + return perms; | |
| 311 | + } | |
| 312 | + | |
| 313 | + /* | |
| 314 | + * Returns the contents of the specified URL as an array of bytes. | |
| 315 | + */ | |
| 316 | + private static byte[] getBytes(URL url) throws IOException { | |
| 317 | + URLConnection uc = url.openConnection(); | |
| 318 | + if (uc instanceof java.net.HttpURLConnection) { | |
| 319 | + java.net.HttpURLConnection huc = (java.net.HttpURLConnection) uc; | |
| 320 | + int code = huc.getResponseCode(); | |
| 321 | + if (code >= java.net.HttpURLConnection.HTTP_BAD_REQUEST) { | |
| 322 | + throw new IOException("open HTTP connection failed."); | |
| 323 | + } | |
| 324 | + } | |
| 325 | + int len = uc.getContentLength(); | |
| 326 | + | |
| 327 | + // Fixed #4507227: Slow performance to load | |
| 328 | + // class and resources. [stanleyh] | |
| 329 | + // | |
| 330 | + // Use buffered input stream [stanleyh] | |
| 331 | + InputStream in = new BufferedInputStream(uc.getInputStream()); | |
| 332 | + | |
| 333 | + byte[] b; | |
| 334 | + try { | |
| 335 | + b = IOUtils.readFully(in, len, true); | |
| 336 | + } finally { | |
| 337 | + in.close(); | |
| 338 | + } | |
| 339 | + return b; | |
| 340 | + } | |
| 341 | + | |
| 342 | + // Object for synchronization around getResourceAsStream() | |
| 343 | + private Object syncResourceAsStream = new Object(); | |
| 344 | + private Object syncResourceAsStreamFromJar = new Object(); | |
| 345 | + | |
| 346 | + // Flag to indicate getResourceAsStream() is in call | |
| 347 | + private boolean resourceAsStreamInCall = false; | |
| 348 | + private boolean resourceAsStreamFromJarInCall = false; | |
| 349 | + | |
| 350 | + /** | |
| 351 | + * Returns an input stream for reading the specified resource. | |
| 352 | + * | |
| 353 | + * The search order is described in the documentation for {@link | |
| 354 | + * #getResource(String)}.<p> | |
| 355 | + * | |
| 356 | + * @param name the resource name | |
| 357 | + * @return an input stream for reading the resource, or <code>null</code> | |
| 358 | + * if the resource could not be found | |
| 359 | + * @since JDK1.1 | |
| 360 | + */ | |
| 361 | + public InputStream getResourceAsStream(String name) | |
| 362 | + { | |
| 363 | + | |
| 364 | + if (name == null) { | |
| 365 | + throw new NullPointerException("name"); | |
| 366 | + } | |
| 367 | + | |
| 368 | + try | |
| 369 | + { | |
| 370 | + InputStream is = null; | |
| 371 | + | |
| 372 | + // Fixed #4507227: Slow performance to load | |
| 373 | + // class and resources. [stanleyh] | |
| 374 | + // | |
| 375 | + // The following is used to avoid calling | |
| 376 | + // AppletClassLoader.findResource() in | |
| 377 | + // super.getResourceAsStream(). Otherwise, | |
| 378 | + // unnecessary connection will be made. | |
| 379 | + // | |
| 380 | + synchronized(syncResourceAsStream) | |
| 381 | + { | |
| 382 | + resourceAsStreamInCall = true; | |
| 383 | + | |
| 384 | + // Call super class | |
| 385 | + is = super.getResourceAsStream(name); | |
| 386 | + | |
| 387 | + resourceAsStreamInCall = false; | |
| 388 | + } | |
| 389 | + | |
| 390 | + // 4668479: Option to turn off codebase lookup in AppletClassLoader | |
| 391 | + // during resource requests. [stanley.ho] | |
| 392 | + if (codebaseLookup == true && is == null) | |
| 393 | + { | |
| 394 | + // If resource cannot be obtained, | |
| 395 | + // try to download it from codebase | |
| 396 | + URL url = new URL(base, ParseUtil.encodePath(name, false)); | |
| 397 | + is = url.openStream(); | |
| 398 | + } | |
| 399 | + | |
| 400 | + return is; | |
| 401 | + } | |
| 402 | + catch (Exception e) | |
| 403 | + { | |
| 404 | + return null; | |
| 405 | + } | |
| 406 | + } | |
| 407 | + | |
| 408 | + | |
| 409 | + /** | |
| 410 | + * Returns an input stream for reading the specified resource from the | |
| 411 | + * the loaded jar files. | |
| 412 | + * | |
| 413 | + * The search order is described in the documentation for {@link | |
| 414 | + * #getResource(String)}.<p> | |
| 415 | + * | |
| 416 | + * @param name the resource name | |
| 417 | + * @return an input stream for reading the resource, or <code>null</code> | |
| 418 | + * if the resource could not be found | |
| 419 | + * @since JDK1.1 | |
| 420 | + */ | |
| 421 | + public InputStream getResourceAsStreamFromJar(String name) { | |
| 422 | + | |
| 423 | + if (name == null) { | |
| 424 | + throw new NullPointerException("name"); | |
| 425 | + } | |
| 426 | + | |
| 427 | + try { | |
| 428 | + InputStream is = null; | |
| 429 | + synchronized(syncResourceAsStreamFromJar) { | |
| 430 | + resourceAsStreamFromJarInCall = true; | |
| 431 | + // Call super class | |
| 432 | + is = super.getResourceAsStream(name); | |
| 433 | + resourceAsStreamFromJarInCall = false; | |
| 434 | + } | |
| 435 | + | |
| 436 | + return is; | |
| 437 | + } catch (Exception e) { | |
| 438 | + return null; | |
| 439 | + } | |
| 440 | + } | |
| 441 | + | |
| 442 | + | |
| 443 | + /* | |
| 444 | + * Finds the applet resource with the specified name. First checks | |
| 445 | + * loaded JAR files then the applet code base for the resource. | |
| 446 | + */ | |
| 447 | + public URL findResource(String name) { | |
| 448 | + // check loaded JAR files | |
| 449 | + URL url = super.findResource(name); | |
| 450 | + | |
| 451 | + // 6215746: Disable META-INF/* lookup from codebase in | |
| 452 | + // applet/plugin classloader. [stanley.ho] | |
| 453 | + if (name.startsWith("META-INF/")) | |
| 454 | + return url; | |
| 455 | + | |
| 456 | + // 4668479: Option to turn off codebase lookup in AppletClassLoader | |
| 457 | + // during resource requests. [stanley.ho] | |
| 458 | + if (codebaseLookup == false) | |
| 459 | + return url; | |
| 460 | + | |
| 461 | + if (url == null) | |
| 462 | + { | |
| 463 | + //#4805170, if it is a call from Applet.getImage() | |
| 464 | + //we should check for the image only in the archives | |
| 465 | + boolean insideGetResourceAsStreamFromJar = false; | |
| 466 | + synchronized(syncResourceAsStreamFromJar) { | |
| 467 | + insideGetResourceAsStreamFromJar = resourceAsStreamFromJarInCall; | |
| 468 | + } | |
| 469 | + | |
| 470 | + if (insideGetResourceAsStreamFromJar) { | |
| 471 | + return null; | |
| 472 | + } | |
| 473 | + | |
| 474 | + // Fixed #4507227: Slow performance to load | |
| 475 | + // class and resources. [stanleyh] | |
| 476 | + // | |
| 477 | + // Check if getResourceAsStream is called. | |
| 478 | + // | |
| 479 | + boolean insideGetResourceAsStream = false; | |
| 480 | + | |
| 481 | + synchronized(syncResourceAsStream) | |
| 482 | + { | |
| 483 | + insideGetResourceAsStream = resourceAsStreamInCall; | |
| 484 | + } | |
| 485 | + | |
| 486 | + // If getResourceAsStream is called, don't | |
| 487 | + // trigger the following code. Otherwise, | |
| 488 | + // unnecessary connection will be made. | |
| 489 | + // | |
| 490 | + if (insideGetResourceAsStream == false) | |
| 491 | + { | |
| 492 | + // otherwise, try the code base | |
| 493 | + try { | |
| 494 | + url = new URL(base, ParseUtil.encodePath(name, false)); | |
| 495 | + // check if resource exists | |
| 496 | + if(!resourceExists(url)) | |
| 497 | + url = null; | |
| 498 | + } catch (Exception e) { | |
| 499 | + // all exceptions, including security exceptions, are caught | |
| 500 | + url = null; | |
| 501 | + } | |
| 502 | + } | |
| 503 | + } | |
| 504 | + return url; | |
| 505 | + } | |
| 506 | + | |
| 507 | + | |
| 508 | + private boolean resourceExists(URL url) { | |
| 509 | + // Check if the resource exists. | |
| 510 | + // It almost works to just try to do an openConnection() but | |
| 511 | + // HttpURLConnection will return true on HTTP_BAD_REQUEST | |
| 512 | + // when the requested name ends in ".html", ".htm", and ".txt" | |
| 513 | + // and we want to be able to handle these | |
| 514 | + // | |
| 515 | + // Also, cannot just open a connection for things like FileURLConnection, | |
| 516 | + // because they succeed when connecting to a nonexistent file. | |
| 517 | + // So, in those cases we open and close an input stream. | |
| 518 | + boolean ok = true; | |
| 519 | + try { | |
| 520 | + URLConnection conn = url.openConnection(); | |
| 521 | + if (conn instanceof java.net.HttpURLConnection) { | |
| 522 | + java.net.HttpURLConnection hconn = | |
| 523 | + (java.net.HttpURLConnection) conn; | |
| 524 | + | |
| 525 | + // To reduce overhead, using http HEAD method instead of GET method | |
| 526 | + hconn.setRequestMethod("HEAD"); | |
| 527 | + | |
| 528 | + int code = hconn.getResponseCode(); | |
| 529 | + if (code == java.net.HttpURLConnection.HTTP_OK) { | |
| 530 | + return true; | |
| 531 | + } | |
| 532 | + if (code >= java.net.HttpURLConnection.HTTP_BAD_REQUEST) { | |
| 533 | + return false; | |
| 534 | + } | |
| 535 | + } else { | |
| 536 | + /** | |
| 537 | + * Fix for #4182052 - stanleyh | |
| 538 | + * | |
| 539 | + * The same connection should be reused to avoid multiple | |
| 540 | + * HTTP connections | |
| 541 | + */ | |
| 542 | + | |
| 543 | + // our best guess for the other cases | |
| 544 | + InputStream is = conn.getInputStream(); | |
| 545 | + is.close(); | |
| 546 | + } | |
| 547 | + } catch (Exception ex) { | |
| 548 | + ok = false; | |
| 549 | + } | |
| 550 | + return ok; | |
| 551 | + } | |
| 552 | + | |
| 553 | + /* | |
| 554 | + * Returns an enumeration of all the applet resources with the specified | |
| 555 | + * name. First checks loaded JAR files then the applet code base for all | |
| 556 | + * available resources. | |
| 557 | + */ | |
| 558 | + public Enumeration findResources(String name) throws IOException { | |
| 559 | + | |
| 560 | + final Enumeration e = super.findResources(name); | |
| 561 | + | |
| 562 | + // 6215746: Disable META-INF/* lookup from codebase in | |
| 563 | + // applet/plugin classloader. [stanley.ho] | |
| 564 | + if (name.startsWith("META-INF/")) | |
| 565 | + return e; | |
| 566 | + | |
| 567 | + // 4668479: Option to turn off codebase lookup in AppletClassLoader | |
| 568 | + // during resource requests. [stanley.ho] | |
| 569 | + if (codebaseLookup == false) | |
| 570 | + return e; | |
| 571 | + | |
| 572 | + URL u = new URL(base, ParseUtil.encodePath(name, false)); | |
| 573 | + if (!resourceExists(u)) { | |
| 574 | + u = null; | |
| 575 | + } | |
| 576 | + | |
| 577 | + final URL url = u; | |
| 578 | + return new Enumeration() { | |
| 579 | + private boolean done; | |
| 580 | + public Object nextElement() { | |
| 581 | + if (!done) { | |
| 582 | + if (e.hasMoreElements()) { | |
| 583 | + return e.nextElement(); | |
| 584 | + } | |
| 585 | + done = true; | |
| 586 | + if (url != null) { | |
| 587 | + return url; | |
| 588 | + } | |
| 589 | + } | |
| 590 | + throw new NoSuchElementException(); | |
| 591 | + } | |
| 592 | + public boolean hasMoreElements() { | |
| 593 | + return !done && (e.hasMoreElements() || url != null); | |
| 594 | + } | |
| 595 | + }; | |
| 596 | + } | |
| 597 | + | |
| 598 | + /* | |
| 599 | + * Load and resolve the file specified by the applet tag CODE | |
| 600 | + * attribute. The argument can either be the relative path | |
| 601 | + * of the class file itself or just the name of the class. | |
| 602 | + */ | |
| 603 | + Class loadCode(String name) throws ClassNotFoundException { | |
| 604 | + // first convert any '/' or native file separator to . | |
| 605 | + name = name.replace('/', '.'); | |
| 606 | + name = name.replace(File.separatorChar, '.'); | |
| 607 | + | |
| 608 | + // deal with URL rewriting | |
| 609 | + String cookie = null; | |
| 610 | + int index = name.indexOf(";"); | |
| 611 | + if(index != -1) { | |
| 612 | + cookie = name.substring(index, name.length()); | |
| 613 | + name = name.substring(0, index); | |
| 614 | + } | |
| 615 | + | |
| 616 | + // save that name for later | |
| 617 | + String fullName = name; | |
| 618 | + // then strip off any suffixes | |
| 619 | + if (name.endsWith(".class") || name.endsWith(".java")) { | |
| 620 | + name = name.substring(0, name.lastIndexOf('.')); | |
| 621 | + } | |
| 622 | + try { | |
| 623 | + if(cookie != null) | |
| 624 | + name = (new StringBuffer(name)).append(cookie).toString(); | |
| 625 | + return loadClass(name); | |
| 626 | + } catch (ClassNotFoundException e) { | |
| 627 | + } | |
| 628 | + // then if it didn't end with .java or .class, or in the | |
| 629 | + // really pathological case of a class named class or java | |
| 630 | + if(cookie != null) | |
| 631 | + fullName = (new StringBuffer(fullName)).append(cookie).toString(); | |
| 632 | + | |
| 633 | + return loadClass(fullName); | |
| 634 | + } | |
| 635 | + | |
| 636 | + /* | |
| 637 | + * The threadgroup that the applets loaded by this classloader live | |
| 638 | + * in. In the sun.* implementation of applets, the security manager's | |
| 639 | + * (AppletSecurity) getThreadGroup returns the thread group of the | |
| 640 | + * first applet on the stack, which is the applet's thread group. | |
| 641 | + */ | |
| 642 | + private AppletThreadGroup threadGroup; | |
| 643 | + private AppContext appContext; | |
| 644 | + | |
| 645 | + public ThreadGroup getThreadGroup() { | |
| 646 | + synchronized (threadGroupSynchronizer) { | |
| 647 | + if (threadGroup == null || threadGroup.isDestroyed()) { | |
| 648 | + AccessController.doPrivileged(new PrivilegedAction() { | |
| 649 | + public Object run() { | |
| 650 | + threadGroup = new AppletThreadGroup(base + "-threadGroup"); | |
| 651 | + // threadGroup.setDaemon(true); | |
| 652 | + // threadGroup is now destroyed by AppContext.dispose() | |
| 653 | + | |
| 654 | + // Create the new AppContext from within a Thread belonging | |
| 655 | + // to the newly created ThreadGroup, and wait for the | |
| 656 | + // creation to complete before returning from this method. | |
| 657 | + AppContextCreator creatorThread = new AppContextCreator(threadGroup); | |
| 658 | + | |
| 659 | + // Since this thread will later be used to launch the | |
| 660 | + // applet's AWT-event dispatch thread and we want the applet | |
| 661 | + // code executing the AWT callbacks to use their own class | |
| 662 | + // loader rather than the system class loader, explicitly | |
| 663 | + // set the context class loader to the AppletClassLoader. | |
| 664 | + creatorThread.setContextClassLoader(AppletClassLoader.this); | |
| 665 | + | |
| 666 | + creatorThread.start(); | |
| 667 | + try { | |
| 668 | + synchronized(creatorThread.syncObject) { | |
| 669 | + while (!creatorThread.created) { | |
| 670 | + creatorThread.syncObject.wait(); | |
| 671 | + } | |
| 672 | + } | |
| 673 | + } catch (InterruptedException e) { } | |
| 674 | + appContext = creatorThread.appContext; | |
| 675 | + return null; | |
| 676 | + } | |
| 677 | + }); | |
| 678 | + } | |
| 679 | + return threadGroup; | |
| 680 | + } | |
| 681 | + } | |
| 682 | + | |
| 683 | + /* | |
| 684 | + * Get the AppContext, if any, corresponding to this AppletClassLoader. | |
| 685 | + */ | |
| 686 | + public AppContext getAppContext() { | |
| 687 | + return appContext; | |
| 688 | + } | |
| 689 | + | |
| 690 | + int usageCount = 0; | |
| 691 | + | |
| 692 | + /** | |
| 693 | + * Grab this AppletClassLoader and its ThreadGroup/AppContext, so they | |
| 694 | + * won't be destroyed. | |
| 695 | + */ | |
| 696 | +public void grab() { | |
| 697 | + synchronized(grabReleaseSynchronizer) { | |
| 698 | + usageCount++; | |
| 699 | + } | |
| 700 | + getThreadGroup(); // Make sure ThreadGroup/AppContext exist | |
| 701 | + } | |
| 702 | + | |
| 703 | + protected void setExceptionStatus() | |
| 704 | + { | |
| 705 | + exceptionStatus = true; | |
| 706 | + } | |
| 707 | + | |
| 708 | + public boolean getExceptionStatus() | |
| 709 | + { | |
| 710 | + return exceptionStatus; | |
| 711 | + } | |
| 712 | + | |
| 713 | + /** | |
| 714 | + * Release this AppletClassLoader and its ThreadGroup/AppContext. | |
| 715 | + * If nothing else has grabbed this AppletClassLoader, its ThreadGroup | |
| 716 | + * and AppContext will be destroyed. | |
| 717 | + * | |
| 718 | + * Because this method may destroy the AppletClassLoader's ThreadGroup, | |
| 719 | + * this method should NOT be called from within the AppletClassLoader's | |
| 720 | + * ThreadGroup. | |
| 721 | + * | |
| 722 | + * Changed modifier to protected in order to be able to overwrite this | |
| 723 | + * function in PluginClassLoader.java | |
| 724 | + */ | |
| 725 | + protected void release() { | |
| 726 | + | |
| 727 | + AppContext tempAppContext = null; | |
| 728 | + | |
| 729 | + synchronized(grabReleaseSynchronizer) { | |
| 730 | + if (usageCount > 1) { | |
| 731 | + --usageCount; | |
| 732 | + } else { | |
| 733 | + synchronized(threadGroupSynchronizer) { | |
| 734 | + tempAppContext = resetAppContext(); | |
| 735 | + } | |
| 736 | + } | |
| 737 | + } | |
| 738 | + | |
| 739 | + // Dispose appContext outside any sync block to | |
| 740 | + // prevent potential deadlock. | |
| 741 | + if (tempAppContext != null) { | |
| 742 | + try { | |
| 743 | + tempAppContext.dispose(); // nuke the world! | |
| 744 | + } catch (IllegalThreadStateException e) { } | |
| 745 | + } | |
| 746 | + } | |
| 747 | + | |
| 748 | + /* | |
| 749 | + * reset classloader's AppContext and ThreadGroup | |
| 750 | + * This method is for subclass PluginClassLoader to | |
| 751 | + * reset superclass's AppContext and ThreadGroup but do | |
| 752 | + * not dispose the AppContext. PluginClassLoader does not | |
| 753 | + * use UsageCount to decide whether to dispose AppContext | |
| 754 | + * | |
| 755 | + * @return previous AppContext | |
| 756 | + */ | |
| 757 | + protected AppContext resetAppContext() { | |
| 758 | + AppContext tempAppContext = null; | |
| 759 | + | |
| 760 | + synchronized(threadGroupSynchronizer) { | |
| 761 | + // Store app context in temp variable | |
| 762 | + tempAppContext = appContext; | |
| 763 | + usageCount = 0; | |
| 764 | + appContext = null; | |
| 765 | + threadGroup = null; | |
| 766 | + } | |
| 767 | + return tempAppContext; | |
| 768 | + } | |
| 769 | + | |
| 770 | + | |
| 771 | + // Hash map to store applet compatibility info | |
| 772 | + private HashMap jdk11AppletInfo = new HashMap(); | |
| 773 | + private HashMap jdk12AppletInfo = new HashMap(); | |
| 774 | + | |
| 775 | + /** | |
| 776 | + * Set applet target level as JDK 1.1. | |
| 777 | + * | |
| 778 | + * @param clazz Applet class. | |
| 779 | + * @param bool true if JDK is targeted for JDK 1.1; | |
| 780 | + * false otherwise. | |
| 781 | + */ | |
| 782 | + void setJDK11Target(Class clazz, boolean bool) | |
| 783 | + { | |
| 784 | + jdk11AppletInfo.put(clazz.toString(), Boolean.valueOf(bool)); | |
| 785 | + } | |
| 786 | + | |
| 787 | + /** | |
| 788 | + * Set applet target level as JDK 1.2. | |
| 789 | + * | |
| 790 | + * @param clazz Applet class. | |
| 791 | + * @param bool true if JDK is targeted for JDK 1.2; | |
| 792 | + * false otherwise. | |
| 793 | + */ | |
| 794 | + void setJDK12Target(Class clazz, boolean bool) | |
| 795 | + { | |
| 796 | + jdk12AppletInfo.put(clazz.toString(), Boolean.valueOf(bool)); | |
| 797 | + } | |
| 798 | + | |
| 799 | + /** | |
| 800 | + * Determine if applet is targeted for JDK 1.1. | |
| 801 | + * | |
| 802 | + * @param applet Applet class. | |
| 803 | + * @return TRUE if applet is targeted for JDK 1.1; | |
| 804 | + * FALSE if applet is not; | |
| 805 | + * null if applet is unknown. | |
| 806 | + */ | |
| 807 | + Boolean isJDK11Target(Class clazz) | |
| 808 | + { | |
| 809 | + return (Boolean) jdk11AppletInfo.get(clazz.toString()); | |
| 810 | + } | |
| 811 | + | |
| 812 | + /** | |
| 813 | + * Determine if applet is targeted for JDK 1.2. | |
| 814 | + * | |
| 815 | + * @param applet Applet class. | |
| 816 | + * @return TRUE if applet is targeted for JDK 1.2; | |
| 817 | + * FALSE if applet is not; | |
| 818 | + * null if applet is unknown. | |
| 819 | + */ | |
| 820 | + Boolean isJDK12Target(Class clazz) | |
| 821 | + { | |
| 822 | + return (Boolean) jdk12AppletInfo.get(clazz.toString()); | |
| 823 | + } | |
| 824 | + | |
| 825 | + private static AppletMessageHandler mh = | |
| 826 | + new AppletMessageHandler("appletclassloader"); | |
| 827 | + | |
| 828 | + /* | |
| 829 | + * Prints a class loading error message. | |
| 830 | + */ | |
| 831 | + private static void printError(String name, Throwable e) { | |
| 832 | + String s = null; | |
| 833 | + if (e == null) { | |
| 834 | + s = mh.getMessage("filenotfound", name); | |
| 835 | + } else if (e instanceof IOException) { | |
| 836 | + s = mh.getMessage("fileioexception", name); | |
| 837 | + } else if (e instanceof ClassFormatError) { | |
| 838 | + s = mh.getMessage("fileformat", name); | |
| 839 | + } else if (e instanceof ThreadDeath) { | |
| 840 | + s = mh.getMessage("filedeath", name); | |
| 841 | + } else if (e instanceof Error) { | |
| 842 | + s = mh.getMessage("fileerror", e.toString(), name); | |
| 843 | + } | |
| 844 | + if (s != null) { | |
| 845 | + System.err.println(s); | |
| 846 | + } | |
| 847 | + } | |
| 848 | +} | |
| 849 | + | |
| 850 | +/* | |
| 851 | + * The AppContextCreator class is used to create an AppContext from within | |
| 852 | + * a Thread belonging to the new AppContext's ThreadGroup. To wait for | |
| 853 | + * this operation to complete before continuing, wait for the notifyAll() | |
| 854 | + * operation on the syncObject to occur. | |
| 855 | + */ | |
| 856 | +class AppContextCreator extends Thread { | |
| 857 | + Object syncObject = new Object(); | |
| 858 | + AppContext appContext = null; | |
| 859 | + volatile boolean created = false; | |
| 860 | + | |
| 861 | + AppContextCreator(ThreadGroup group) { | |
| 862 | + super(group, "AppContextCreator"); | |
| 863 | + } | |
| 864 | + | |
| 865 | + public void run() { | |
| 866 | + appContext = SunToolkit.createNewAppContext(); | |
| 867 | + created = true; | |
| 868 | + synchronized(syncObject) { | |
| 869 | + syncObject.notifyAll(); | |
| 870 | + } | |
| 871 | + } // run() | |
| 872 | + | |
| 873 | +} // class AppContextCreator | |
Binary file not shown.
| @@ -0,0 +1,65 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1997, 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 | +package sun.applet; | |
| 27 | + | |
| 28 | +import java.util.EventObject; | |
| 29 | + | |
| 30 | + | |
| 31 | +/** | |
| 32 | + * AppletEvent class. | |
| 33 | + * | |
| 34 | + * @author Sunita Mani | |
| 35 | + */ | |
| 36 | + | |
| 37 | +public class AppletEvent extends EventObject { | |
| 38 | + | |
| 39 | + private Object arg; | |
| 40 | + private int id; | |
| 41 | + | |
| 42 | + | |
| 43 | + public AppletEvent(Object source, int id, Object argument) { | |
| 44 | + super(source); | |
| 45 | + this.arg = argument; | |
| 46 | + this.id = id; | |
| 47 | + } | |
| 48 | + | |
| 49 | + public int getID() { | |
| 50 | + return id; | |
| 51 | + } | |
| 52 | + | |
| 53 | + public Object getArgument() { | |
| 54 | + return arg; | |
| 55 | + } | |
| 56 | + | |
| 57 | + public String toString() { | |
| 58 | + String str = getClass().getName() + "[source=" + source + " + id="+ id; | |
| 59 | + if (arg != null) { | |
| 60 | + str += " + arg=" + arg; | |
| 61 | + } | |
| 62 | + str += " ]"; | |
| 63 | + return str; | |
| 64 | + } | |
| 65 | +} | |
Binary file not shown.
| @@ -0,0 +1,127 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1997, 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 | +package sun.applet; | |
| 27 | + | |
| 28 | +import java.util.EventListener; | |
| 29 | +import java.io.Serializable; | |
| 30 | +import java.io.ObjectOutputStream; | |
| 31 | +import java.io.IOException; | |
| 32 | + | |
| 33 | +/** | |
| 34 | + * AppletEventMulticaster class. This class manages an immutable | |
| 35 | + * structure consisting of a chain of AppletListeners and is | |
| 36 | + * responsible for dispatching events to them. | |
| 37 | + * | |
| 38 | + * @author Sunita Mani | |
| 39 | + */ | |
| 40 | +public class AppletEventMulticaster implements AppletListener { | |
| 41 | + | |
| 42 | + private final AppletListener a, b; | |
| 43 | + | |
| 44 | + public AppletEventMulticaster(AppletListener a, AppletListener b) { | |
| 45 | + this.a = a; this.b = b; | |
| 46 | + } | |
| 47 | + | |
| 48 | + public void appletStateChanged(AppletEvent e) { | |
| 49 | + a.appletStateChanged(e); | |
| 50 | + b.appletStateChanged(e); | |
| 51 | + } | |
| 52 | + | |
| 53 | + /** | |
| 54 | + * Adds Applet-listener-a with Applet-listener-b and | |
| 55 | + * returns the resulting multicast listener. | |
| 56 | + * @param a Applet-listener-a | |
| 57 | + * @param b Applet-listener-b | |
| 58 | + */ | |
| 59 | + public static AppletListener add(AppletListener a, AppletListener b) { | |
| 60 | + return addInternal(a, b); | |
| 61 | + } | |
| 62 | + | |
| 63 | + /** | |
| 64 | + * Removes the old Applet-listener from Applet-listener-l and | |
| 65 | + * returns the resulting multicast listener. | |
| 66 | + * @param l Applet-listener-l | |
| 67 | + * @param oldl the Applet-listener being removed | |
| 68 | + */ | |
| 69 | + public static AppletListener remove(AppletListener l, AppletListener oldl) { | |
| 70 | + return removeInternal(l, oldl); | |
| 71 | + } | |
| 72 | + | |
| 73 | + /** | |
| 74 | + * Returns the resulting multicast listener from adding listener-a | |
| 75 | + * and listener-b together. | |
| 76 | + * If listener-a is null, it returns listener-b; | |
| 77 | + * If listener-b is null, it returns listener-a | |
| 78 | + * If neither are null, then it creates and returns | |
| 79 | + * a new AppletEventMulticaster instance which chains a with b. | |
| 80 | + * @param a event listener-a | |
| 81 | + * @param b event listener-b | |
| 82 | + */ | |
| 83 | + private static AppletListener addInternal(AppletListener a, AppletListener b) { | |
| 84 | + if (a == null) return b; | |
| 85 | + if (b == null) return a; | |
| 86 | + return new AppletEventMulticaster(a, b); | |
| 87 | + } | |
| 88 | + | |
| 89 | + | |
| 90 | + /** | |
| 91 | + * Removes a listener from this multicaster and returns the | |
| 92 | + * resulting multicast listener. | |
| 93 | + * @param oldl the listener to be removed | |
| 94 | + */ | |
| 95 | + protected AppletListener remove(AppletListener oldl) { | |
| 96 | + if (oldl == a) return b; | |
| 97 | + if (oldl == b) return a; | |
| 98 | + AppletListener a2 = removeInternal(a, oldl); | |
| 99 | + AppletListener b2 = removeInternal(b, oldl); | |
| 100 | + if (a2 == a && b2 == b) { | |
| 101 | + return this; // it's not here | |
| 102 | + } | |
| 103 | + return addInternal(a2, b2); | |
| 104 | + } | |
| 105 | + | |
| 106 | + | |
| 107 | + /** | |
| 108 | + * Returns the resulting multicast listener after removing the | |
| 109 | + * old listener from listener-l. | |
| 110 | + * If listener-l equals the old listener OR listener-l is null, | |
| 111 | + * returns null. | |
| 112 | + * Else if listener-l is an instance of AppletEventMulticaster | |
| 113 | + * then it removes the old listener from it. | |
| 114 | + * Else, returns listener l. | |
| 115 | + * @param l the listener being removed from | |
| 116 | + * @param oldl the listener being removed | |
| 117 | + */ | |
| 118 | + private static AppletListener removeInternal(AppletListener l, AppletListener oldl) { | |
| 119 | + if (l == oldl || l == null) { | |
| 120 | + return null; | |
| 121 | + } else if (l instanceof AppletEventMulticaster) { | |
| 122 | + return ((AppletEventMulticaster)l).remove(oldl); | |
| 123 | + } else { | |
| 124 | + return l; // it's not here | |
| 125 | + } | |
| 126 | + } | |
| 127 | +} | |
| @@ -0,0 +1,59 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1996, 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 | +package sun.applet; | |
| 27 | + | |
| 28 | +import java.io.IOException; | |
| 29 | + | |
| 30 | +/** | |
| 31 | + * An applet IO exception. | |
| 32 | + * | |
| 33 | + * @author Koji Uno | |
| 34 | + */ | |
| 35 | +public | |
| 36 | +class AppletIOException extends IOException { | |
| 37 | + private String key = null; | |
| 38 | + private Object msgobj = null; | |
| 39 | + | |
| 40 | + public AppletIOException(String key) { | |
| 41 | + super(key); | |
| 42 | + this.key = key; | |
| 43 | + | |
| 44 | + } | |
| 45 | + public AppletIOException(String key, Object arg) { | |
| 46 | + this(key); | |
| 47 | + msgobj = arg; | |
| 48 | + } | |
| 49 | + | |
| 50 | + public String getLocalizedMessage() { | |
| 51 | + if( msgobj != null) | |
| 52 | + return amh.getMessage(key, msgobj); | |
| 53 | + else | |
| 54 | + return amh.getMessage(key); | |
| 55 | + } | |
| 56 | + | |
| 57 | + private static AppletMessageHandler amh = new AppletMessageHandler("appletioexception"); | |
| 58 | + | |
| 59 | +} | |
Binary file not shown.
| @@ -0,0 +1,48 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1996, 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 | +package sun.applet; | |
| 27 | + | |
| 28 | +/** | |
| 29 | + * An applet security exception. | |
| 30 | + * | |
| 31 | + * @author Arthur van Hoff | |
| 32 | + */ | |
| 33 | +public | |
| 34 | +class AppletIllegalArgumentException extends IllegalArgumentException { | |
| 35 | + private String key = null; | |
| 36 | + | |
| 37 | + public AppletIllegalArgumentException(String key) { | |
| 38 | + super(key); | |
| 39 | + this.key = key; | |
| 40 | + | |
| 41 | + } | |
| 42 | + | |
| 43 | + public String getLocalizedMessage() { | |
| 44 | + return amh.getMessage(key); | |
| 45 | + } | |
| 46 | + | |
| 47 | + private static AppletMessageHandler amh = new AppletMessageHandler("appletillegalargumentexception"); | |
| 48 | +} | |
| @@ -0,0 +1,54 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1996, 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 | +package sun.applet; | |
| 27 | + | |
| 28 | +import java.awt.Toolkit; | |
| 29 | +import java.awt.Image; | |
| 30 | +import sun.awt.image.URLImageSource; | |
| 31 | +import java.net.URL; | |
| 32 | + | |
| 33 | +class AppletImageRef extends sun.misc.Ref { | |
| 34 | + URL url; | |
| 35 | + | |
| 36 | + /** | |
| 37 | + * Create the Ref | |
| 38 | + */ | |
| 39 | + AppletImageRef(URL url) { | |
| 40 | + this.url = url; | |
| 41 | + } | |
| 42 | + | |
| 43 | + public void flush() { | |
| 44 | + super.flush(); | |
| 45 | + } | |
| 46 | + | |
| 47 | + /** | |
| 48 | + * Reconsitute the image. Only called when the ref has been flushed. | |
| 49 | + */ | |
| 50 | + public Object reconstitute() { | |
| 51 | + Image img = Toolkit.getDefaultToolkit().createImage(new URLImageSource(url)); | |
| 52 | + return img; | |
| 53 | + } | |
| 54 | +} | |
Binary file not shown.
| @@ -0,0 +1,39 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1997, 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 | +package sun.applet; | |
| 27 | + | |
| 28 | +import java.util.EventListener; | |
| 29 | + | |
| 30 | +/** | |
| 31 | + * Applet Listener interface. This interface is to be implemented | |
| 32 | + * by objects interested in AppletEvents. | |
| 33 | + * | |
| 34 | + * @author Sunita Mani | |
| 35 | + */ | |
| 36 | + | |
| 37 | +public interface AppletListener extends EventListener { | |
| 38 | + public void appletStateChanged(AppletEvent e); | |
| 39 | +} | |
Binary file not shown.
| @@ -0,0 +1,113 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1996, 1997, 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 | +package sun.applet; | |
| 27 | + | |
| 28 | +import java.util.ResourceBundle; | |
| 29 | +import java.util.MissingResourceException; | |
| 30 | +import java.text.MessageFormat; | |
| 31 | + | |
| 32 | +/** | |
| 33 | + * An hanlder of localized messages. | |
| 34 | + * | |
| 35 | + * @author Koji Uno | |
| 36 | + */ | |
| 37 | +class AppletMessageHandler { | |
| 38 | + private static ResourceBundle rb; | |
| 39 | + private String baseKey = null; | |
| 40 | + | |
| 41 | + static { | |
| 42 | + try { | |
| 43 | + rb = ResourceBundle.getBundle | |
| 44 | + ("sun.applet.resources.MsgAppletViewer"); | |
| 45 | + } catch (MissingResourceException e) { | |
| 46 | + System.out.println(e.getMessage()); | |
| 47 | + System.exit(1); | |
| 48 | + } | |
| 49 | + } | |
| 50 | + | |
| 51 | + AppletMessageHandler(String baseKey) { | |
| 52 | + this.baseKey = baseKey; | |
| 53 | + } | |
| 54 | + | |
| 55 | + String getMessage(String key) { | |
| 56 | + return (String)rb.getString(getQualifiedKey(key)); | |
| 57 | + } | |
| 58 | + | |
| 59 | + String getMessage(String key, Object arg){ | |
| 60 | + String basemsgfmt = (String)rb.getString(getQualifiedKey(key)); | |
| 61 | + MessageFormat msgfmt = new MessageFormat(basemsgfmt); | |
| 62 | + Object msgobj[] = new Object[1]; | |
| 63 | + if (arg == null) { | |
| 64 | + arg = "null"; // mimic java.io.PrintStream.print(String) | |
| 65 | + } | |
| 66 | + msgobj[0] = arg; | |
| 67 | + return msgfmt.format(msgobj); | |
| 68 | + } | |
| 69 | + | |
| 70 | + String getMessage(String key, Object arg1, Object arg2) { | |
| 71 | + String basemsgfmt = (String)rb.getString(getQualifiedKey(key)); | |
| 72 | + MessageFormat msgfmt = new MessageFormat(basemsgfmt); | |
| 73 | + Object msgobj[] = new Object[2]; | |
| 74 | + if (arg1 == null) { | |
| 75 | + arg1 = "null"; | |
| 76 | + } | |
| 77 | + if (arg2 == null) { | |
| 78 | + arg2 = "null"; | |
| 79 | + } | |
| 80 | + msgobj[0] = arg1; | |
| 81 | + msgobj[1] = arg2; | |
| 82 | + return msgfmt.format(msgobj); | |
| 83 | + } | |
| 84 | + | |
| 85 | + String getMessage(String key, Object arg1, Object arg2, Object arg3) { | |
| 86 | + String basemsgfmt = (String)rb.getString(getQualifiedKey(key)); | |
| 87 | + MessageFormat msgfmt = new MessageFormat(basemsgfmt); | |
| 88 | + Object msgobj[] = new Object[3]; | |
| 89 | + if (arg1 == null) { | |
| 90 | + arg1 = "null"; | |
| 91 | + } | |
| 92 | + if (arg2 == null) { | |
| 93 | + arg2 = "null"; | |
| 94 | + } | |
| 95 | + if (arg3 == null) { | |
| 96 | + arg3 = "null"; | |
| 97 | + } | |
| 98 | + msgobj[0] = arg1; | |
| 99 | + msgobj[1] = arg2; | |
| 100 | + msgobj[2] = arg3; | |
| 101 | + return msgfmt.format(msgobj); | |
| 102 | + } | |
| 103 | + | |
| 104 | + String getMessage(String key, Object arg[]) { | |
| 105 | + String basemsgfmt = (String)rb.getString(getQualifiedKey(key)); | |
| 106 | + MessageFormat msgfmt = new MessageFormat(basemsgfmt); | |
| 107 | + return msgfmt.format(arg); | |
| 108 | + } | |
| 109 | + | |
| 110 | + String getQualifiedKey(String subKey) { | |
| 111 | + return baseKey + "." + subKey; | |
| 112 | + } | |
| 113 | +} | |
Binary file not shown.
| @@ -0,0 +1,106 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1996, 1997, 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 | + * COPYRIGHT goes here | |
| 27 | + */ | |
| 28 | + | |
| 29 | +package sun.applet; | |
| 30 | + | |
| 31 | +import java.io.*; | |
| 32 | +import java.lang.reflect.Array; | |
| 33 | + | |
| 34 | +/** | |
| 35 | + * This subclass of ObjectInputStream delegates loading of classes to | |
| 36 | + * an existing ClassLoader. | |
| 37 | + */ | |
| 38 | + | |
| 39 | +class AppletObjectInputStream extends ObjectInputStream | |
| 40 | +{ | |
| 41 | + private AppletClassLoader loader; | |
| 42 | + | |
| 43 | + /** | |
| 44 | + * Loader must be non-null; | |
| 45 | + */ | |
| 46 | + | |
| 47 | + public AppletObjectInputStream(InputStream in, AppletClassLoader loader) | |
| 48 | + throws IOException, StreamCorruptedException { | |
| 49 | + | |
| 50 | + super(in); | |
| 51 | + if (loader == null) { | |
| 52 | + throw new AppletIllegalArgumentException("appletillegalargumentexception.objectinputstream"); | |
| 53 | + | |
| 54 | + } | |
| 55 | + this.loader = loader; | |
| 56 | + } | |
| 57 | + | |
| 58 | + /** | |
| 59 | + * Make a primitive array class | |
| 60 | + */ | |
| 61 | + | |
| 62 | + private Class primitiveType(char type) { | |
| 63 | + switch (type) { | |
| 64 | + case 'B': return byte.class; | |
| 65 | + case 'C': return char.class; | |
| 66 | + case 'D': return double.class; | |
| 67 | + case 'F': return float.class; | |
| 68 | + case 'I': return int.class; | |
| 69 | + case 'J': return long.class; | |
| 70 | + case 'S': return short.class; | |
| 71 | + case 'Z': return boolean.class; | |
| 72 | + default: return null; | |
| 73 | + } | |
| 74 | + } | |
| 75 | + | |
| 76 | + /** | |
| 77 | + * Use the given ClassLoader rather than using the system class | |
| 78 | + */ | |
| 79 | + protected Class resolveClass(ObjectStreamClass classDesc) | |
| 80 | + throws IOException, ClassNotFoundException { | |
| 81 | + | |
| 82 | + String cname = classDesc.getName(); | |
| 83 | + if (cname.startsWith("[")) { | |
| 84 | + // An array | |
| 85 | + Class component; // component class | |
| 86 | + int dcount; // dimension | |
| 87 | + for (dcount=1; cname.charAt(dcount)=='['; dcount++) ; | |
| 88 | + if (cname.charAt(dcount) == 'L') { | |
| 89 | + component = loader.loadClass(cname.substring(dcount+1, | |
| 90 | + cname.length()-1)); | |
| 91 | + } else { | |
| 92 | + if (cname.length() != dcount+1) { | |
| 93 | + throw new ClassNotFoundException(cname);// malformed | |
| 94 | + } | |
| 95 | + component = primitiveType(cname.charAt(dcount)); | |
| 96 | + } | |
| 97 | + int dim[] = new int[dcount]; | |
| 98 | + for (int i=0; i<dcount; i++) { | |
| 99 | + dim[i]=0; | |
| 100 | + } | |
| 101 | + return Array.newInstance(component, dim).getClass(); | |
| 102 | + } else { | |
| 103 | + return loader.loadClass(cname); | |
| 104 | + } | |
| 105 | + } | |
| 106 | +} | |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1,1318 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1995, 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 | + */ | |
| 25 | + | |
| 26 | +package sun.applet; | |
| 27 | + | |
| 28 | +import java.applet.*; | |
| 29 | +import java.awt.*; | |
| 30 | +import java.awt.event.*; | |
| 31 | +import java.awt.image.ColorModel; | |
| 32 | +import java.awt.image.MemoryImageSource; | |
| 33 | +import java.io.*; | |
| 34 | +import java.lang.ref.WeakReference; | |
| 35 | +import java.lang.reflect.InvocationTargetException; | |
| 36 | +import java.lang.reflect.Method; | |
| 37 | +import java.net.InetAddress; | |
| 38 | +import java.net.JarURLConnection; | |
| 39 | +import java.net.MalformedURLException; | |
| 40 | +import java.net.SocketPermission; | |
| 41 | +import java.net.URL; | |
| 42 | +import java.net.UnknownHostException; | |
| 43 | +import java.security.*; | |
| 44 | +import java.util.*; | |
| 45 | +import java.util.Collections; | |
| 46 | +import java.util.Locale; | |
| 47 | +import java.util.WeakHashMap; | |
| 48 | +import sun.awt.AppContext; | |
| 49 | +import sun.awt.EmbeddedFrame; | |
| 50 | +import sun.awt.SunToolkit; | |
| 51 | +import sun.misc.MessageUtils; | |
| 52 | +import sun.misc.PerformanceLogger; | |
| 53 | +import sun.misc.Queue; | |
| 54 | +import sun.security.util.SecurityConstants; | |
| 55 | + | |
| 56 | +/** | |
| 57 | + * Applet panel class. The panel manages and manipulates the | |
| 58 | + * applet as it is being loaded. It forks a separate thread in a new | |
| 59 | + * thread group to call the applet's init(), start(), stop(), and | |
| 60 | + * destroy() methods. | |
| 61 | + * | |
| 62 | + * @author Arthur van Hoff | |
| 63 | + */ | |
| 64 | +public | |
| 65 | +abstract class AppletPanel extends Panel implements AppletStub, Runnable { | |
| 66 | + | |
| 67 | + /** | |
| 68 | + * The applet (if loaded). | |
| 69 | + */ | |
| 70 | + Applet applet; | |
| 71 | + | |
| 72 | + /** | |
| 73 | + * Applet will allow initialization. Should be | |
| 74 | + * set to false if loading a serialized applet | |
| 75 | + * that was pickled in the init=true state. | |
| 76 | + */ | |
| 77 | + protected boolean doInit = true; | |
| 78 | + | |
| 79 | + | |
| 80 | + /** | |
| 81 | + * The classloader for the applet. | |
| 82 | + */ | |
| 83 | + protected AppletClassLoader loader; | |
| 84 | + | |
| 85 | + /* applet event ids */ | |
| 86 | + public final static int APPLET_DISPOSE = 0; | |
| 87 | + public final static int APPLET_LOAD = 1; | |
| 88 | + public final static int APPLET_INIT = 2; | |
| 89 | + public final static int APPLET_START = 3; | |
| 90 | + public final static int APPLET_STOP = 4; | |
| 91 | + public final static int APPLET_DESTROY = 5; | |
| 92 | + public final static int APPLET_QUIT = 6; | |
| 93 | + public final static int APPLET_ERROR = 7; | |
| 94 | + | |
| 95 | + /* send to the parent to force relayout */ | |
| 96 | + public final static int APPLET_RESIZE = 51234; | |
| 97 | + | |
| 98 | + /* sent to a (distant) parent to indicate that the applet is being | |
| 99 | + * loaded or as completed loading | |
| 100 | + */ | |
| 101 | + public final static int APPLET_LOADING = 51235; | |
| 102 | + public final static int APPLET_LOADING_COMPLETED = 51236; | |
| 103 | + | |
| 104 | + /** | |
| 105 | + * The current status. One of: | |
| 106 | + * APPLET_DISPOSE, | |
| 107 | + * APPLET_LOAD, | |
| 108 | + * APPLET_INIT, | |
| 109 | + * APPLET_START, | |
| 110 | + * APPLET_STOP, | |
| 111 | + * APPLET_DESTROY, | |
| 112 | + * APPLET_ERROR. | |
| 113 | + */ | |
| 114 | + protected int status; | |
| 115 | + | |
| 116 | + /** | |
| 117 | + * The thread for the applet. | |
| 118 | + */ | |
| 119 | + protected Thread handler; | |
| 120 | + | |
| 121 | + | |
| 122 | + /** | |
| 123 | + * The initial applet size. | |
| 124 | + */ | |
| 125 | + Dimension defaultAppletSize = new Dimension(10, 10); | |
| 126 | + | |
| 127 | + /** | |
| 128 | + * The current applet size. | |
| 129 | + */ | |
| 130 | + Dimension currentAppletSize = new Dimension(10, 10); | |
| 131 | + | |
| 132 | + MessageUtils mu = new MessageUtils(); | |
| 133 | + | |
| 134 | + /** | |
| 135 | + * The thread to use during applet loading | |
| 136 | + */ | |
| 137 | + | |
| 138 | + Thread loaderThread = null; | |
| 139 | + | |
| 140 | + /** | |
| 141 | + * Flag to indicate that a loading has been cancelled | |
| 142 | + */ | |
| 143 | + boolean loadAbortRequest = false; | |
| 144 | + | |
| 145 | + /* abstract classes */ | |
| 146 | + abstract protected String getCode(); | |
| 147 | + abstract protected String getJarFiles(); | |
| 148 | + abstract protected String getSerializedObject(); | |
| 149 | + | |
| 150 | + abstract public int getWidth(); | |
| 151 | + abstract public int getHeight(); | |
| 152 | + abstract public boolean hasInitialFocus(); | |
| 153 | + | |
| 154 | + private static int threadGroupNumber = 0; | |
| 155 | + | |
| 156 | + protected void setupAppletAppContext() { | |
| 157 | + // do nothing | |
| 158 | + } | |
| 159 | + | |
| 160 | + /* | |
| 161 | + * Creates a thread to run the applet. This method is called | |
| 162 | + * each time an applet is loaded and reloaded. | |
| 163 | + */ | |
| 164 | + synchronized void createAppletThread() { | |
| 165 | + // Create a thread group for the applet, and start a new | |
| 166 | + // thread to load the applet. | |
| 167 | + String nm = "applet-" + getCode(); | |
| 168 | + loader = getClassLoader(getCodeBase(), getClassLoaderCacheKey()); | |
| 169 | + loader.grab(); // Keep this puppy around! | |
| 170 | + | |
| 171 | + // 4668479: Option to turn off codebase lookup in AppletClassLoader | |
| 172 | + // during resource requests. [stanley.ho] | |
| 173 | + String param = getParameter("codebase_lookup"); | |
| 174 | + | |
| 175 | + if (param != null && param.equals("false")) | |
| 176 | + loader.setCodebaseLookup(false); | |
| 177 | + else | |
| 178 | + loader.setCodebaseLookup(true); | |
| 179 | + | |
| 180 | + | |
| 181 | + ThreadGroup appletGroup = loader.getThreadGroup(); | |
| 182 | + | |
| 183 | + handler = new Thread(appletGroup, this, "thread " + nm); | |
| 184 | + // set the context class loader for this thread | |
| 185 | + AccessController.doPrivileged(new PrivilegedAction() { | |
| 186 | + public Object run() { | |
| 187 | + handler.setContextClassLoader(loader); | |
| 188 | + return null; | |
| 189 | + } | |
| 190 | + }); | |
| 191 | + handler.start(); | |
| 192 | + } | |
| 193 | + | |
| 194 | + void joinAppletThread() throws InterruptedException { | |
| 195 | + if (handler != null) { | |
| 196 | + handler.join(); | |
| 197 | + handler = null; | |
| 198 | + } | |
| 199 | + } | |
| 200 | + | |
| 201 | + void release() { | |
| 202 | + if (loader != null) { | |
| 203 | + loader.release(); | |
| 204 | + loader = null; | |
| 205 | + } | |
| 206 | + } | |
| 207 | + | |
| 208 | + /** | |
| 209 | + * Construct an applet viewer and start the applet. | |
| 210 | + */ | |
| 211 | + public void init() { | |
| 212 | + try { | |
| 213 | + // Get the width (if any) | |
| 214 | + defaultAppletSize.width = getWidth(); | |
| 215 | + currentAppletSize.width = defaultAppletSize.width; | |
| 216 | + | |
| 217 | + // Get the height (if any) | |
| 218 | + defaultAppletSize.height = getHeight(); | |
| 219 | + currentAppletSize.height = defaultAppletSize.height; | |
| 220 | + | |
| 221 | + } catch (NumberFormatException e) { | |
| 222 | + // Turn on the error flag and let TagAppletPanel | |
| 223 | + // do the right thing. | |
| 224 | + status = APPLET_ERROR; | |
| 225 | + showAppletStatus("badattribute.exception"); | |
| 226 | + showAppletLog("badattribute.exception"); | |
| 227 | + showAppletException(e); | |
| 228 | + } | |
| 229 | + | |
| 230 | + setLayout(new BorderLayout()); | |
| 231 | + | |
| 232 | + createAppletThread(); | |
| 233 | + } | |
| 234 | + | |
| 235 | + /** | |
| 236 | + * Minimum size | |
| 237 | + */ | |
| 238 | + public Dimension minimumSize() { | |
| 239 | + return new Dimension(defaultAppletSize.width, | |
| 240 | + defaultAppletSize.height); | |
| 241 | + } | |
| 242 | + | |
| 243 | + /** | |
| 244 | + * Preferred size | |
| 245 | + */ | |
| 246 | + public Dimension preferredSize() { | |
| 247 | + return new Dimension(currentAppletSize.width, | |
| 248 | + currentAppletSize.height); | |
| 249 | + } | |
| 250 | + | |
| 251 | + private AppletListener listeners; | |
| 252 | + | |
| 253 | + /** | |
| 254 | + * AppletEvent Queue | |
| 255 | + */ | |
| 256 | + private Queue queue = null; | |
| 257 | + | |
| 258 | + | |
| 259 | + synchronized public void addAppletListener(AppletListener l) { | |
| 260 | + listeners = AppletEventMulticaster.add(listeners, l); | |
| 261 | + } | |
| 262 | + | |
| 263 | + synchronized public void removeAppletListener(AppletListener l) { | |
| 264 | + listeners = AppletEventMulticaster.remove(listeners, l); | |
| 265 | + } | |
| 266 | + | |
| 267 | + /** | |
| 268 | + * Dispatch event to the listeners.. | |
| 269 | + */ | |
| 270 | + public void dispatchAppletEvent(int id, Object argument) { | |
| 271 | + //System.out.println("SEND= " + id); | |
| 272 | + if (listeners != null) { | |
| 273 | + AppletEvent evt = new AppletEvent(this, id, argument); | |
| 274 | + listeners.appletStateChanged(evt); | |
| 275 | + } | |
| 276 | + } | |
| 277 | + | |
| 278 | + /** | |
| 279 | + * Send an event. Queue it for execution by the handler thread. | |
| 280 | + */ | |
| 281 | + public void sendEvent(int id) { | |
| 282 | + synchronized(this) { | |
| 283 | + if (queue == null) { | |
| 284 | + //System.out.println("SEND0= " + id); | |
| 285 | + queue = new Queue(); | |
| 286 | + } | |
| 287 | + Integer eventId = Integer.valueOf(id); | |
| 288 | + queue.enqueue(eventId); | |
| 289 | + notifyAll(); | |
| 290 | + } | |
| 291 | + if (id == APPLET_QUIT) { | |
| 292 | + try { | |
| 293 | + joinAppletThread(); // Let the applet event handler exit | |
| 294 | + } catch (InterruptedException e) { | |
| 295 | + } | |
| 296 | + | |
| 297 | + // AppletClassLoader.release() must be called by a Thread | |
| 298 | + // not within the applet's ThreadGroup | |
| 299 | + if (loader == null) | |
| 300 | + loader = getClassLoader(getCodeBase(), getClassLoaderCacheKey()); | |
| 301 | + release(); | |
| 302 | + } | |
| 303 | + } | |
| 304 | + | |
| 305 | + /** | |
| 306 | + * Get an event from the queue. | |
| 307 | + */ | |
| 308 | + synchronized AppletEvent getNextEvent() throws InterruptedException { | |
| 309 | + while (queue == null || queue.isEmpty()) { | |
| 310 | + wait(); | |
| 311 | + } | |
| 312 | + Integer eventId = (Integer)queue.dequeue(); | |
| 313 | + return new AppletEvent(this, eventId.intValue(), null); | |
| 314 | + } | |
| 315 | + | |
| 316 | + boolean emptyEventQueue() { | |
| 317 | + if ((queue == null) || (queue.isEmpty())) | |
| 318 | + return true; | |
| 319 | + else | |
| 320 | + return false; | |
| 321 | + } | |
| 322 | + | |
| 323 | + /** | |
| 324 | + * This kludge is specific to get over AccessControlException thrown during | |
| 325 | + * Applet.stop() or destroy() when static thread is suspended. Set a flag | |
| 326 | + * in AppletClassLoader to indicate that an | |
| 327 | + * AccessControlException for RuntimePermission "modifyThread" or | |
| 328 | + * "modifyThreadGroup" had occurred. | |
| 329 | + */ | |
| 330 | + private void setExceptionStatus(AccessControlException e) { | |
| 331 | + Permission p = e.getPermission(); | |
| 332 | + if (p instanceof RuntimePermission) { | |
| 333 | + if (p.getName().startsWith("modifyThread")) { | |
| 334 | + if (loader == null) | |
| 335 | + loader = getClassLoader(getCodeBase(), getClassLoaderCacheKey()); | |
| 336 | + loader.setExceptionStatus(); | |
| 337 | + } | |
| 338 | + } | |
| 339 | + } | |
| 340 | + | |
| 341 | + /** | |
| 342 | + * Execute applet events. | |
| 343 | + * Here is the state transition diagram | |
| 344 | + * | |
| 345 | + * Note: (XXX) is the action | |
| 346 | + * APPLET_XXX is the state | |
| 347 | + * (applet code loaded) --> APPLET_LOAD -- (applet init called)--> APPLET_INIT -- ( | |
| 348 | + * applet start called) --> APPLET_START -- (applet stop called) -->APPLET_STOP --(applet | |
| 349 | + * destroyed called) --> APPLET_DESTROY -->(applet gets disposed) --> | |
| 350 | + * APPLET_DISPOSE -->.... | |
| 351 | + * | |
| 352 | + * In the legacy lifecycle model. The applet gets loaded, inited and started. So it stays | |
| 353 | + * in the APPLET_START state unless the applet goes away(refresh page or leave the page). | |
| 354 | + * So the applet stop method called and the applet enters APPLET_STOP state. Then if the applet | |
| 355 | + * is revisited, it will call applet start method and enter the APPLET_START state and stay there. | |
| 356 | + * | |
| 357 | + * In the modern lifecycle model. When the applet first time visited, it is same as legacy lifecycle | |
| 358 | + * model. However, when the applet page goes away. It calls applet stop method and enters APPLET_STOP | |
| 359 | + * state and then applet destroyed method gets called and enters APPLET_DESTROY state. | |
| 360 | + * | |
| 361 | + * This code is also called by AppletViewer. In AppletViewer "Restart" menu, the applet is jump from | |
| 362 | + * APPLET_STOP to APPLET_DESTROY and to APPLET_INIT . | |
| 363 | + * | |
| 364 | + * Also, the applet can jump from APPLET_INIT state to APPLET_DESTROY (in Netscape/Mozilla case). | |
| 365 | + * Same as APPLET_LOAD to | |
| 366 | + * APPLET_DISPOSE since all of this are triggered by browser. | |
| 367 | + * | |
| 368 | + * | |
| 369 | + */ | |
| 370 | + public void run() { | |
| 371 | + | |
| 372 | + Thread curThread = Thread.currentThread(); | |
| 373 | + if (curThread == loaderThread) { | |
| 374 | + // if we are in the loader thread, cause | |
| 375 | + // loading to occur. We may exit this with | |
| 376 | + // status being APPLET_DISPOSE, APPLET_ERROR, | |
| 377 | + // or APPLET_LOAD | |
| 378 | + runLoader(); | |
| 379 | + return; | |
| 380 | + } | |
| 381 | + | |
| 382 | + boolean disposed = false; | |
| 383 | + while (!disposed && !curThread.isInterrupted()) { | |
| 384 | + AppletEvent evt; | |
| 385 | + try { | |
| 386 | + evt = getNextEvent(); | |
| 387 | + } catch (InterruptedException e) { | |
| 388 | + showAppletStatus("bail"); | |
| 389 | + return; | |
| 390 | + } | |
| 391 | + | |
| 392 | + //showAppletStatus("EVENT = " + evt.getID()); | |
| 393 | + try { | |
| 394 | + switch (evt.getID()) { | |
| 395 | + case APPLET_LOAD: | |
| 396 | + if (!okToLoad()) { | |
| 397 | + break; | |
| 398 | + } | |
| 399 | + // This complexity allows loading of applets to be | |
| 400 | + // interruptable. The actual thread loading runs | |
| 401 | + // in a separate thread, so it can be interrupted | |
| 402 | + // without harming the applet thread. | |
| 403 | + // So that we don't have to worry about | |
| 404 | + // concurrency issues, the main applet thread waits | |
| 405 | + // until the loader thread terminates. | |
| 406 | + // (one way or another). | |
| 407 | + if (loaderThread == null) { | |
| 408 | + // REMIND: do we want a name? | |
| 409 | + //System.out.println("------------------- loading applet"); | |
| 410 | + setLoaderThread(new Thread(this)); | |
| 411 | + loaderThread.start(); | |
| 412 | + // we get to go to sleep while this runs | |
| 413 | + loaderThread.join(); | |
| 414 | + setLoaderThread(null); | |
| 415 | + } else { | |
| 416 | + // REMIND: issue an error -- this case should never | |
| 417 | + // occur. | |
| 418 | + } | |
| 419 | + break; | |
| 420 | + | |
| 421 | + case APPLET_INIT: | |
| 422 | + // AppletViewer "Restart" will jump from destroy method to | |
| 423 | + // init, that is why we need to check status w/ APPLET_DESTROY | |
| 424 | + if (status != APPLET_LOAD && status != APPLET_DESTROY) { | |
| 425 | + showAppletStatus("notloaded"); | |
| 426 | + break; | |
| 427 | + } | |
| 428 | + applet.resize(defaultAppletSize); | |
| 429 | + if (doInit) { | |
| 430 | + if (PerformanceLogger.loggingEnabled()) { | |
| 431 | + PerformanceLogger.setTime("Applet Init"); | |
| 432 | + PerformanceLogger.outputLog(); | |
| 433 | + } | |
| 434 | + applet.init(); | |
| 435 | + } | |
| 436 | + | |
| 437 | + //Need the default(fallback) font to be created in this AppContext | |
| 438 | + Font f = getFont(); | |
| 439 | + if (f == null || | |
| 440 | + "dialog".equals(f.getFamily().toLowerCase(Locale.ENGLISH)) && | |
| 441 | + f.getSize() == 12 && f.getStyle() == Font.PLAIN) { | |
| 442 | + setFont(new Font(Font.DIALOG, Font.PLAIN, 12)); | |
| 443 | + } | |
| 444 | + | |
| 445 | + doInit = true; // allow restarts | |
| 446 | + | |
| 447 | + // Validate the applet in event dispatch thread | |
| 448 | + // to avoid deadlock. | |
| 449 | + try { | |
| 450 | + final AppletPanel p = this; | |
| 451 | + | |
| 452 | + EventQueue.invokeAndWait(new Runnable() { | |
| 453 | + public void run() { | |
| 454 | + p.validate(); | |
| 455 | + } | |
| 456 | + }); | |
| 457 | + } | |
| 458 | + catch(InterruptedException ie) { | |
| 459 | + } | |
| 460 | + catch(InvocationTargetException ite) { | |
| 461 | + } | |
| 462 | + | |
| 463 | + status = APPLET_INIT; | |
| 464 | + showAppletStatus("inited"); | |
| 465 | + break; | |
| 466 | + | |
| 467 | + case APPLET_START: | |
| 468 | + { | |
| 469 | + if (status != APPLET_INIT && status != APPLET_STOP) { | |
| 470 | + showAppletStatus("notinited"); | |
| 471 | + break; | |
| 472 | + } | |
| 473 | + applet.resize(currentAppletSize); | |
| 474 | + applet.start(); | |
| 475 | + | |
| 476 | + // Validate and show the applet in event dispatch thread | |
| 477 | + // to avoid deadlock. | |
| 478 | + try { | |
| 479 | + final AppletPanel p = this; | |
| 480 | + final Applet a = applet; | |
| 481 | + | |
| 482 | + EventQueue.invokeAndWait(new Runnable() { | |
| 483 | + public void run() { | |
| 484 | + p.validate(); | |
| 485 | + a.setVisible(true); | |
| 486 | + | |
| 487 | + // Fix for BugTraq ID 4041703. | |
| 488 | + // Set the default focus for an applet. | |
| 489 | + if (hasInitialFocus()) | |
| 490 | + setDefaultFocus(); | |
| 491 | + } | |
| 492 | + }); | |
| 493 | + } | |
| 494 | + catch(InterruptedException ie) { | |
| 495 | + } | |
| 496 | + catch(InvocationTargetException ite) { | |
| 497 | + } | |
| 498 | + | |
| 499 | + status = APPLET_START; | |
| 500 | + showAppletStatus("started"); | |
| 501 | + break; | |
| 502 | + } | |
| 503 | + | |
| 504 | + case APPLET_STOP: | |
| 505 | + if (status != APPLET_START) { | |
| 506 | + showAppletStatus("notstarted"); | |
| 507 | + break; | |
| 508 | + } | |
| 509 | + status = APPLET_STOP; | |
| 510 | + | |
| 511 | + // Hide the applet in event dispatch thread | |
| 512 | + // to avoid deadlock. | |
| 513 | + try { | |
| 514 | + final Applet a = applet; | |
| 515 | + | |
| 516 | + EventQueue.invokeAndWait(new Runnable() { | |
| 517 | + public void run() | |
| 518 | + { | |
| 519 | + a.setVisible(false); | |
| 520 | + } | |
| 521 | + }); | |
| 522 | + } | |
| 523 | + catch(InterruptedException ie) { | |
| 524 | + } | |
| 525 | + catch(InvocationTargetException ite) { | |
| 526 | + } | |
| 527 | + | |
| 528 | + | |
| 529 | + // During Applet.stop(), any AccessControlException on an involved Class remains in | |
| 530 | + // the "memory" of the AppletClassLoader. If the same instance of the ClassLoader is | |
| 531 | + // reused, the same exception will occur during class loading. Set the AppletClassLoader's | |
| 532 | + // exceptionStatusSet flag to allow recognition of what had happened | |
| 533 | + // when reusing AppletClassLoader object. | |
| 534 | + try { | |
| 535 | + applet.stop(); | |
| 536 | + } catch (java.security.AccessControlException e) { | |
| 537 | + setExceptionStatus(e); | |
| 538 | + // rethrow exception to be handled as it normally would be. | |
| 539 | + throw e; | |
| 540 | + } | |
| 541 | + showAppletStatus("stopped"); | |
| 542 | + break; | |
| 543 | + | |
| 544 | + case APPLET_DESTROY: | |
| 545 | + if (status != APPLET_STOP && status != APPLET_INIT) { | |
| 546 | + showAppletStatus("notstopped"); | |
| 547 | + break; | |
| 548 | + } | |
| 549 | + status = APPLET_DESTROY; | |
| 550 | + | |
| 551 | + // During Applet.destroy(), any AccessControlException on an involved Class remains in | |
| 552 | + // the "memory" of the AppletClassLoader. If the same instance of the ClassLoader is | |
| 553 | + // reused, the same exception will occur during class loading. Set the AppletClassLoader's | |
| 554 | + // exceptionStatusSet flag to allow recognition of what had happened | |
| 555 | + // when reusing AppletClassLoader object. | |
| 556 | + try { | |
| 557 | + applet.destroy(); | |
| 558 | + } catch (java.security.AccessControlException e) { | |
| 559 | + setExceptionStatus(e); | |
| 560 | + // rethrow exception to be handled as it normally would be. | |
| 561 | + throw e; | |
| 562 | + } | |
| 563 | + showAppletStatus("destroyed"); | |
| 564 | + break; | |
| 565 | + | |
| 566 | + case APPLET_DISPOSE: | |
| 567 | + if (status != APPLET_DESTROY && status != APPLET_LOAD) { | |
| 568 | + showAppletStatus("notdestroyed"); | |
| 569 | + break; | |
| 570 | + } | |
| 571 | + status = APPLET_DISPOSE; | |
| 572 | + | |
| 573 | + try | |
| 574 | + { | |
| 575 | + final Applet a = applet; | |
| 576 | + | |
| 577 | + EventQueue.invokeAndWait(new Runnable() | |
| 578 | + { | |
| 579 | + public void run() | |
| 580 | + { | |
| 581 | + remove(a); | |
| 582 | + } | |
| 583 | + }); | |
| 584 | + } | |
| 585 | + catch(InterruptedException ie) | |
| 586 | + { | |
| 587 | + } | |
| 588 | + catch(InvocationTargetException ite) | |
| 589 | + { | |
| 590 | + } | |
| 591 | + applet = null; | |
| 592 | + showAppletStatus("disposed"); | |
| 593 | + disposed = true; | |
| 594 | + break; | |
| 595 | + | |
| 596 | + case APPLET_QUIT: | |
| 597 | + return; | |
| 598 | + } | |
| 599 | + } catch (Exception e) { | |
| 600 | + status = APPLET_ERROR; | |
| 601 | + if (e.getMessage() != null) { | |
| 602 | + showAppletStatus("exception2", e.getClass().getName(), | |
| 603 | + e.getMessage()); | |
| 604 | + } else { | |
| 605 | + showAppletStatus("exception", e.getClass().getName()); | |
| 606 | + } | |
| 607 | + showAppletException(e); | |
| 608 | + } catch (ThreadDeath e) { | |
| 609 | + showAppletStatus("death"); | |
| 610 | + return; | |
| 611 | + } catch (Error e) { | |
| 612 | + status = APPLET_ERROR; | |
| 613 | + if (e.getMessage() != null) { | |
| 614 | + showAppletStatus("error2", e.getClass().getName(), | |
| 615 | + e.getMessage()); | |
| 616 | + } else { | |
| 617 | + showAppletStatus("error", e.getClass().getName()); | |
| 618 | + } | |
| 619 | + showAppletException(e); | |
| 620 | + } | |
| 621 | + clearLoadAbortRequest(); | |
| 622 | + } | |
| 623 | + } | |
| 624 | + | |
| 625 | + /** | |
| 626 | + * Gets most recent focus owner component associated with the given window. | |
| 627 | + * It does that without calling Window.getMostRecentFocusOwner since it | |
| 628 | + * provides its own logic contradicting with setDefautlFocus. Instead, it | |
| 629 | + * calls KeyboardFocusManager directly. | |
| 630 | + */ | |
| 631 | + private Component getMostRecentFocusOwnerForWindow(Window w) { | |
| 632 | + Method meth = (Method)AccessController.doPrivileged(new PrivilegedAction() { | |
| 633 | + public Object run() { | |
| 634 | + Method meth = null; | |
| 635 | + try { | |
| 636 | + meth = KeyboardFocusManager.class.getDeclaredMethod("getMostRecentFocusOwner", new Class[] {Window.class}); | |
| 637 | + meth.setAccessible(true); | |
| 638 | + } catch (Exception e) { | |
| 639 | + // Must never happen | |
| 640 | + e.printStackTrace(); | |
| 641 | + } | |
| 642 | + return meth; | |
| 643 | + } | |
| 644 | + }); | |
| 645 | + if (meth != null) { | |
| 646 | + // Meth refers static method | |
| 647 | + try { | |
| 648 | + return (Component)meth.invoke(null, new Object[] {w}); | |
| 649 | + } catch (Exception e) { | |
| 650 | + // Must never happen | |
| 651 | + e.printStackTrace(); | |
| 652 | + } | |
| 653 | + } | |
| 654 | + // Will get here if exception was thrown or meth is null | |
| 655 | + return w.getMostRecentFocusOwner(); | |
| 656 | + } | |
| 657 | + | |
| 658 | + /* | |
| 659 | + * Fix for BugTraq ID 4041703. | |
| 660 | + * Set the focus to a reasonable default for an Applet. | |
| 661 | + */ | |
| 662 | + private void setDefaultFocus() { | |
| 663 | + Component toFocus = null; | |
| 664 | + Container parent = getParent(); | |
| 665 | + | |
| 666 | + if(parent != null) { | |
| 667 | + if (parent instanceof Window) { | |
| 668 | + toFocus = getMostRecentFocusOwnerForWindow((Window)parent); | |
| 669 | + if (toFocus == parent || toFocus == null) { | |
| 670 | + toFocus = parent.getFocusTraversalPolicy(). | |
| 671 | + getInitialComponent((Window)parent); | |
| 672 | + } | |
| 673 | + } else if (parent.isFocusCycleRoot()) { | |
| 674 | + toFocus = parent.getFocusTraversalPolicy(). | |
| 675 | + getDefaultComponent(parent); | |
| 676 | + } | |
| 677 | + } | |
| 678 | + | |
| 679 | + if (toFocus != null) { | |
| 680 | + if (parent instanceof EmbeddedFrame) { | |
| 681 | + ((EmbeddedFrame)parent).synthesizeWindowActivation(true); | |
| 682 | + } | |
| 683 | + // EmbeddedFrame might have focus before the applet was added. | |
| 684 | + // Thus after its activation the most recent focus owner will be | |
| 685 | + // restored. We need the applet's initial focusabled component to | |
| 686 | + // be focused here. | |
| 687 | + toFocus.requestFocusInWindow(); | |
| 688 | + } | |
| 689 | + } | |
| 690 | + | |
| 691 | + /** | |
| 692 | + * Load the applet into memory. | |
| 693 | + * Runs in a seperate (and interruptible) thread from the rest of the | |
| 694 | + * applet event processing so that it can be gracefully interrupted from | |
| 695 | + * things like HotJava. | |
| 696 | + */ | |
| 697 | + private void runLoader() { | |
| 698 | + if (status != APPLET_DISPOSE) { | |
| 699 | + showAppletStatus("notdisposed"); | |
| 700 | + return; | |
| 701 | + } | |
| 702 | + | |
| 703 | + dispatchAppletEvent(APPLET_LOADING, null); | |
| 704 | + | |
| 705 | + // REMIND -- might be cool to visually indicate loading here -- | |
| 706 | + // maybe do animation? | |
| 707 | + status = APPLET_LOAD; | |
| 708 | + | |
| 709 | + // Create a class loader | |
| 710 | + loader = getClassLoader(getCodeBase(), getClassLoaderCacheKey()); | |
| 711 | + | |
| 712 | + // Load the archives if present. | |
| 713 | + // REMIND - this probably should be done in a separate thread, | |
| 714 | + // or at least the additional archives (epll). | |
| 715 | + | |
| 716 | + String code = getCode(); | |
| 717 | + | |
| 718 | + // setup applet AppContext | |
| 719 | + // this must be called before loadJarFiles | |
| 720 | + setupAppletAppContext(); | |
| 721 | + | |
| 722 | + try { | |
| 723 | + loadJarFiles(loader); | |
| 724 | + applet = createApplet(loader); | |
| 725 | + } catch (ClassNotFoundException e) { | |
| 726 | + status = APPLET_ERROR; | |
| 727 | + showAppletStatus("notfound", code); | |
| 728 | + showAppletLog("notfound", code); | |
| 729 | + showAppletException(e); | |
| 730 | + return; | |
| 731 | + } catch (InstantiationException e) { | |
| 732 | + status = APPLET_ERROR; | |
| 733 | + showAppletStatus("nocreate", code); | |
| 734 | + showAppletLog("nocreate", code); | |
| 735 | + showAppletException(e); | |
| 736 | + return; | |
| 737 | + } catch (IllegalAccessException e) { | |
| 738 | + status = APPLET_ERROR; | |
| 739 | + showAppletStatus("noconstruct", code); | |
| 740 | + showAppletLog("noconstruct", code); | |
| 741 | + showAppletException(e); | |
| 742 | + // sbb -- I added a return here | |
| 743 | + return; | |
| 744 | + } catch (Exception e) { | |
| 745 | + status = APPLET_ERROR; | |
| 746 | + showAppletStatus("exception", e.getMessage()); | |
| 747 | + showAppletException(e); | |
| 748 | + return; | |
| 749 | + } catch (ThreadDeath e) { | |
| 750 | + status = APPLET_ERROR; | |
| 751 | + showAppletStatus("death"); | |
| 752 | + return; | |
| 753 | + } catch (Error e) { | |
| 754 | + status = APPLET_ERROR; | |
| 755 | + showAppletStatus("error", e.getMessage()); | |
| 756 | + showAppletException(e); | |
| 757 | + return; | |
| 758 | + } finally { | |
| 759 | + // notify that loading is no longer going on | |
| 760 | + dispatchAppletEvent(APPLET_LOADING_COMPLETED, null); | |
| 761 | + } | |
| 762 | + | |
| 763 | + // Fixed #4508194: NullPointerException thrown during | |
| 764 | + // quick page switch | |
| 765 | + // | |
| 766 | + if (applet != null) | |
| 767 | + { | |
| 768 | + // Stick it in the frame | |
| 769 | + applet.setStub(this); | |
| 770 | + applet.hide(); | |
| 771 | + add("Center", applet); | |
| 772 | + showAppletStatus("loaded"); | |
| 773 | + validate(); | |
| 774 | + } | |
| 775 | + } | |
| 776 | + | |
| 777 | + protected Applet createApplet(final AppletClassLoader loader) throws ClassNotFoundException, | |
| 778 | + IllegalAccessException, IOException, InstantiationException, InterruptedException { | |
| 779 | + final String serName = getSerializedObject(); | |
| 780 | + String code = getCode(); | |
| 781 | + | |
| 782 | + if (code != null && serName != null) { | |
| 783 | + System.err.println(amh.getMessage("runloader.err")); | |
| 784 | +// return null; | |
| 785 | + throw new InstantiationException("Either \"code\" or \"object\" should be specified, but not both."); | |
| 786 | + } | |
| 787 | + if (code == null && serName == null) { | |
| 788 | + String msg = "nocode"; | |
| 789 | + status = APPLET_ERROR; | |
| 790 | + showAppletStatus(msg); | |
| 791 | + showAppletLog(msg); | |
| 792 | + repaint(); | |
| 793 | + } | |
| 794 | + if (code != null) { | |
| 795 | + applet = (Applet)loader.loadCode(code).newInstance(); | |
| 796 | + doInit = true; | |
| 797 | + } else { | |
| 798 | + // serName is not null; | |
| 799 | + InputStream is = (InputStream) | |
| 800 | + java.security.AccessController.doPrivileged( | |
| 801 | + new java.security.PrivilegedAction() { | |
| 802 | + public Object run() { | |
| 803 | + return loader.getResourceAsStream(serName); | |
| 804 | + } | |
| 805 | + }); | |
| 806 | + ObjectInputStream ois = | |
| 807 | + new AppletObjectInputStream(is, loader); | |
| 808 | + Object serObject = ois.readObject(); | |
| 809 | + applet = (Applet) serObject; | |
| 810 | + doInit = false; // skip over the first init | |
| 811 | + } | |
| 812 | + | |
| 813 | + // Determine the JDK level that the applet targets. | |
| 814 | + // This is critical for enabling certain backward | |
| 815 | + // compatibility switch if an applet is a JDK 1.1 | |
| 816 | + // applet. [stanley.ho] | |
| 817 | + findAppletJDKLevel(applet); | |
| 818 | + | |
| 819 | + if (Thread.interrupted()) { | |
| 820 | + try { | |
| 821 | + status = APPLET_DISPOSE; // APPLET_ERROR? | |
| 822 | + applet = null; | |
| 823 | + // REMIND: This may not be exactly the right thing: the | |
| 824 | + // status is set by the stop button and not necessarily | |
| 825 | + // here. | |
| 826 | + showAppletStatus("death"); | |
| 827 | + } finally { | |
| 828 | + Thread.currentThread().interrupt(); // resignal interrupt | |
| 829 | + } | |
| 830 | + return null; | |
| 831 | + } | |
| 832 | + return applet; | |
| 833 | + } | |
| 834 | + | |
| 835 | + protected void loadJarFiles(AppletClassLoader loader) throws IOException, | |
| 836 | + InterruptedException { | |
| 837 | + // Load the archives if present. | |
| 838 | + // REMIND - this probably should be done in a separate thread, | |
| 839 | + // or at least the additional archives (epll). | |
| 840 | + String jarFiles = getJarFiles(); | |
| 841 | + | |
| 842 | + if (jarFiles != null) { | |
| 843 | + StringTokenizer st = new StringTokenizer(jarFiles, ",", false); | |
| 844 | + while(st.hasMoreTokens()) { | |
| 845 | + String tok = st.nextToken().trim(); | |
| 846 | + try { | |
| 847 | + loader.addJar(tok); | |
| 848 | + } catch (IllegalArgumentException e) { | |
| 849 | + // bad archive name | |
| 850 | + continue; | |
| 851 | + } | |
| 852 | + } | |
| 853 | + } | |
| 854 | + } | |
| 855 | + | |
| 856 | + /** | |
| 857 | + * Request that the loading of the applet be stopped. | |
| 858 | + */ | |
| 859 | + protected synchronized void stopLoading() { | |
| 860 | + // REMIND: fill in the body | |
| 861 | + if (loaderThread != null) { | |
| 862 | + //System.out.println("Interrupting applet loader thread: " + loaderThread); | |
| 863 | + loaderThread.interrupt(); | |
| 864 | + } else { | |
| 865 | + setLoadAbortRequest(); | |
| 866 | + } | |
| 867 | + } | |
| 868 | + | |
| 869 | + | |
| 870 | + protected synchronized boolean okToLoad() { | |
| 871 | + return !loadAbortRequest; | |
| 872 | + } | |
| 873 | + | |
| 874 | + protected synchronized void clearLoadAbortRequest() { | |
| 875 | + loadAbortRequest = false; | |
| 876 | + } | |
| 877 | + | |
| 878 | + protected synchronized void setLoadAbortRequest() { | |
| 879 | + loadAbortRequest = true; | |
| 880 | + } | |
| 881 | + | |
| 882 | + | |
| 883 | + private synchronized void setLoaderThread(Thread loaderThread) { | |
| 884 | + this.loaderThread = loaderThread; | |
| 885 | + } | |
| 886 | + | |
| 887 | + /** | |
| 888 | + * Return true when the applet has been started. | |
| 889 | + */ | |
| 890 | + public boolean isActive() { | |
| 891 | + return status == APPLET_START; | |
| 892 | + } | |
| 893 | + | |
| 894 | + | |
| 895 | + private EventQueue appEvtQ = null; | |
| 896 | + /** | |
| 897 | + * Is called when the applet wants to be resized. | |
| 898 | + */ | |
| 899 | + public void appletResize(int width, int height) { | |
| 900 | + currentAppletSize.width = width; | |
| 901 | + currentAppletSize.height = height; | |
| 902 | + final Dimension currentSize = new Dimension(currentAppletSize.width, | |
| 903 | + currentAppletSize.height); | |
| 904 | + | |
| 905 | + if(loader != null) { | |
| 906 | + AppContext appCtxt = loader.getAppContext(); | |
| 907 | + if(appCtxt != null) | |
| 908 | + appEvtQ = (java.awt.EventQueue)appCtxt.get(AppContext.EVENT_QUEUE_KEY); | |
| 909 | + } | |
| 910 | + | |
| 911 | + final AppletPanel ap = this; | |
| 912 | + if (appEvtQ != null){ | |
| 913 | + appEvtQ.postEvent(new InvocationEvent(Toolkit.getDefaultToolkit(), | |
| 914 | + new Runnable(){ | |
| 915 | + public void run(){ | |
| 916 | + if(ap != null) | |
| 917 | + { | |
| 918 | + ap.dispatchAppletEvent(APPLET_RESIZE, currentSize); | |
| 919 | + } | |
| 920 | + } | |
| 921 | + })); | |
| 922 | + } | |
| 923 | + } | |
| 924 | + | |
| 925 | + public void setBounds(int x, int y, int width, int height) { | |
| 926 | + super.setBounds(x, y, width, height); | |
| 927 | + currentAppletSize.width = width; | |
| 928 | + currentAppletSize.height = height; | |
| 929 | + } | |
| 930 | + | |
| 931 | + public Applet getApplet() { | |
| 932 | + return applet; | |
| 933 | + } | |
| 934 | + | |
| 935 | + /** | |
| 936 | + * Status line. Called by the AppletPanel to provide | |
| 937 | + * feedback on the Applet's state. | |
| 938 | + */ | |
| 939 | + protected void showAppletStatus(String status) { | |
| 940 | + getAppletContext().showStatus(amh.getMessage(status)); | |
| 941 | + } | |
| 942 | + | |
| 943 | + protected void showAppletStatus(String status, Object arg) { | |
| 944 | + getAppletContext().showStatus(amh.getMessage(status, arg)); | |
| 945 | + } | |
| 946 | + protected void showAppletStatus(String status, Object arg1, Object arg2) { | |
| 947 | + getAppletContext().showStatus(amh.getMessage(status, arg1, arg2)); | |
| 948 | + } | |
| 949 | + | |
| 950 | + /** | |
| 951 | + * Called by the AppletPanel to print to the log. | |
| 952 | + */ | |
| 953 | + protected void showAppletLog(String msg) { | |
| 954 | + System.out.println(amh.getMessage(msg)); | |
| 955 | + } | |
| 956 | + | |
| 957 | + protected void showAppletLog(String msg, Object arg) { | |
| 958 | + System.out.println(amh.getMessage(msg, arg)); | |
| 959 | + } | |
| 960 | + | |
| 961 | + /** | |
| 962 | + * Called by the AppletPanel to provide | |
| 963 | + * feedback when an exception has happened. | |
| 964 | + */ | |
| 965 | + protected void showAppletException(Throwable t) { | |
| 966 | + t.printStackTrace(); | |
| 967 | + repaint(); | |
| 968 | + } | |
| 969 | + | |
| 970 | + /** | |
| 971 | + * Get caching key for classloader cache | |
| 972 | + */ | |
| 973 | + public String getClassLoaderCacheKey() | |
| 974 | + { | |
| 975 | + /** | |
| 976 | + * Fixed #4501142: Classlaoder sharing policy doesn't | |
| 977 | + * take "archive" into account. This will be overridden | |
| 978 | + * by Java Plug-in. [stanleyh] | |
| 979 | + */ | |
| 980 | + return getCodeBase().toString(); | |
| 981 | + } | |
| 982 | + | |
| 983 | + /** | |
| 984 | + * The class loaders | |
| 985 | + */ | |
| 986 | + private static HashMap classloaders = new HashMap(); | |
| 987 | + | |
| 988 | + /** | |
| 989 | + * Flush a class loader. | |
| 990 | + */ | |
| 991 | + public static synchronized void flushClassLoader(String key) { | |
| 992 | + classloaders.remove(key); | |
| 993 | + } | |
| 994 | + | |
| 995 | + /** | |
| 996 | + * Flush all class loaders. | |
| 997 | + */ | |
| 998 | + public static synchronized void flushClassLoaders() { | |
| 999 | + classloaders = new HashMap(); | |
| 1000 | + } | |
| 1001 | + | |
| 1002 | + /** | |
| 1003 | + * This method actually creates an AppletClassLoader. | |
| 1004 | + * | |
| 1005 | + * It can be override by subclasses (such as the Plug-in) | |
| 1006 | + * to provide different classloaders. | |
| 1007 | + */ | |
| 1008 | + protected AppletClassLoader createClassLoader(final URL codebase) { | |
| 1009 | + return new AppletClassLoader(codebase); | |
| 1010 | + } | |
| 1011 | + | |
| 1012 | + /** | |
| 1013 | + * Get a class loader. Create in a restricted context | |
| 1014 | + */ | |
| 1015 | + synchronized AppletClassLoader getClassLoader(final URL codebase, final String key) { | |
| 1016 | + AppletClassLoader c = (AppletClassLoader)classloaders.get(key); | |
| 1017 | + if (c == null) { | |
| 1018 | + AccessControlContext acc = | |
| 1019 | + getAccessControlContext(codebase); | |
| 1020 | + c = (AppletClassLoader) | |
| 1021 | + AccessController.doPrivileged(new PrivilegedAction() { | |
| 1022 | + public Object run() { | |
| 1023 | + AppletClassLoader ac = createClassLoader(codebase); | |
| 1024 | + /* Should the creation of the classloader be | |
| 1025 | + * within the class synchronized block? Since | |
| 1026 | + * this class is used by the plugin, take care | |
| 1027 | + * to avoid deadlocks, or specialize | |
| 1028 | + * AppletPanel within the plugin. It may take | |
| 1029 | + * an arbitrary amount of time to create a | |
| 1030 | + * class loader (involving getting Jar files | |
| 1031 | + * etc.) and may block unrelated applets from | |
| 1032 | + * finishing createAppletThread (due to the | |
| 1033 | + * class synchronization). If | |
| 1034 | + * createAppletThread does not finish quickly, | |
| 1035 | + * the applet cannot process other messages, | |
| 1036 | + * particularly messages such as destroy | |
| 1037 | + * (which timeout when called from the browser). | |
| 1038 | + */ | |
| 1039 | + synchronized (getClass()) { | |
| 1040 | + AppletClassLoader res = | |
| 1041 | + (AppletClassLoader)classloaders.get(key); | |
| 1042 | + if (res == null) { | |
| 1043 | + classloaders.put(key, ac); | |
| 1044 | + return ac; | |
| 1045 | + } else { | |
| 1046 | + return res; | |
| 1047 | + } | |
| 1048 | + } | |
| 1049 | + } | |
| 1050 | + },acc); | |
| 1051 | + } | |
| 1052 | + return c; | |
| 1053 | + } | |
| 1054 | + | |
| 1055 | + /** | |
| 1056 | + * get the context for the AppletClassLoader we are creating. | |
| 1057 | + * the context is granted permission to create the class loader, | |
| 1058 | + * connnect to the codebase, and whatever else the policy grants | |
| 1059 | + * to all codebases. | |
| 1060 | + */ | |
| 1061 | + private AccessControlContext getAccessControlContext(final URL codebase) { | |
| 1062 | + | |
| 1063 | + PermissionCollection perms = (PermissionCollection) | |
| 1064 | + AccessController.doPrivileged(new PrivilegedAction() { | |
| 1065 | + public Object run() { | |
| 1066 | + Policy p = java.security.Policy.getPolicy(); | |
| 1067 | + if (p != null) { | |
| 1068 | + return p.getPermissions(new CodeSource(null, | |
| 1069 | + (java.security.cert.Certificate[]) null)); | |
| 1070 | + } else { | |
| 1071 | + return null; | |
| 1072 | + } | |
| 1073 | + } | |
| 1074 | + }); | |
| 1075 | + | |
| 1076 | + if (perms == null) | |
| 1077 | + perms = new Permissions(); | |
| 1078 | + | |
| 1079 | + //XXX: this is needed to be able to create the classloader itself! | |
| 1080 | + | |
| 1081 | + perms.add(SecurityConstants.CREATE_CLASSLOADER_PERMISSION); | |
| 1082 | + | |
| 1083 | + Permission p; | |
| 1084 | + java.net.URLConnection urlConnection = null; | |
| 1085 | + try { | |
| 1086 | + urlConnection = codebase.openConnection(); | |
| 1087 | + p = urlConnection.getPermission(); | |
| 1088 | + } catch (java.io.IOException ioe) { | |
| 1089 | + p = null; | |
| 1090 | + } | |
| 1091 | + | |
| 1092 | + if (p != null) | |
| 1093 | + perms.add(p); | |
| 1094 | + | |
| 1095 | + if (p instanceof FilePermission) { | |
| 1096 | + | |
| 1097 | + String path = p.getName(); | |
| 1098 | + | |
| 1099 | + int endIndex = path.lastIndexOf(File.separatorChar); | |
| 1100 | + | |
| 1101 | + if (endIndex != -1) { | |
| 1102 | + path = path.substring(0, endIndex+1); | |
| 1103 | + | |
| 1104 | + if (path.endsWith(File.separator)) { | |
| 1105 | + path += "-"; | |
| 1106 | + } | |
| 1107 | + perms.add(new FilePermission(path, | |
| 1108 | + SecurityConstants.FILE_READ_ACTION)); | |
| 1109 | + } | |
| 1110 | + } else { | |
| 1111 | + URL locUrl = codebase; | |
| 1112 | + if (urlConnection instanceof JarURLConnection) { | |
| 1113 | + locUrl = ((JarURLConnection)urlConnection).getJarFileURL(); | |
| 1114 | + } | |
| 1115 | + String host = locUrl.getHost(); | |
| 1116 | + if (host != null && (host.length() > 0)) | |
| 1117 | + perms.add(new SocketPermission(host, | |
| 1118 | + SecurityConstants.SOCKET_CONNECT_ACCEPT_ACTION)); | |
| 1119 | + } | |
| 1120 | + | |
| 1121 | + ProtectionDomain domain = | |
| 1122 | + new ProtectionDomain(new CodeSource(codebase, | |
| 1123 | + (java.security.cert.Certificate[]) null), perms); | |
| 1124 | + AccessControlContext acc = | |
| 1125 | + new AccessControlContext(new ProtectionDomain[] { domain }); | |
| 1126 | + | |
| 1127 | + return acc; | |
| 1128 | + } | |
| 1129 | + | |
| 1130 | + public Thread getAppletHandlerThread() { | |
| 1131 | + return handler; | |
| 1132 | + } | |
| 1133 | + | |
| 1134 | + public int getAppletWidth() { | |
| 1135 | + return currentAppletSize.width; | |
| 1136 | + } | |
| 1137 | + | |
| 1138 | + public int getAppletHeight() { | |
| 1139 | + return currentAppletSize.height; | |
| 1140 | + } | |
| 1141 | + | |
| 1142 | + public static void changeFrameAppContext(Frame frame, AppContext newAppContext) | |
| 1143 | + { | |
| 1144 | + // Fixed #4754451: Applet can have methods running on main | |
| 1145 | + // thread event queue. | |
| 1146 | + // | |
| 1147 | + // The cause of this bug is that the frame of the applet | |
| 1148 | + // is created in main thread group. Thus, when certain | |
| 1149 | + // AWT/Swing events are generated, the events will be | |
| 1150 | + // dispatched through the wrong event dispatch thread. | |
| 1151 | + // | |
| 1152 | + // To fix this, we rearrange the AppContext with the frame, | |
| 1153 | + // so the proper event queue will be looked up. | |
| 1154 | + // | |
| 1155 | + // Swing also maintains a Frame list for the AppContext, | |
| 1156 | + // so we will have to rearrange it as well. | |
| 1157 | + | |
| 1158 | + // Check if frame's AppContext has already been set properly | |
| 1159 | + AppContext oldAppContext = SunToolkit.targetToAppContext(frame); | |
| 1160 | + | |
| 1161 | + if (oldAppContext == newAppContext) | |
| 1162 | + return; | |
| 1163 | + | |
| 1164 | + // Synchronization on Window.class is needed for locking the | |
| 1165 | + // critical section of the window list in AppContext. | |
| 1166 | + synchronized (Window.class) | |
| 1167 | + { | |
| 1168 | + WeakReference weakRef = null; | |
| 1169 | + // Remove frame from the Window list in wrong AppContext | |
| 1170 | + { | |
| 1171 | + // Lookup current frame's AppContext | |
| 1172 | + Vector<WeakReference<Window>> windowList = (Vector<WeakReference<Window>>)oldAppContext.get(Window.class); | |
| 1173 | + if (windowList != null) { | |
| 1174 | + for (WeakReference ref : windowList) { | |
| 1175 | + if (ref.get() == frame) { | |
| 1176 | + weakRef = ref; | |
| 1177 | + break; | |
| 1178 | + } | |
| 1179 | + } | |
| 1180 | + // Remove frame from wrong AppContext | |
| 1181 | + if (weakRef != null) | |
| 1182 | + windowList.remove(weakRef); | |
| 1183 | + } | |
| 1184 | + } | |
| 1185 | + | |
| 1186 | + // Put the frame into the applet's AppContext map | |
| 1187 | + SunToolkit.insertTargetMapping(frame, newAppContext); | |
| 1188 | + | |
| 1189 | + // Insert frame into the Window list in the applet's AppContext map | |
| 1190 | + { | |
| 1191 | + Vector<WeakReference<Window>> windowList = (Vector)newAppContext.get(Window.class); | |
| 1192 | + if (windowList == null) { | |
| 1193 | + windowList = new Vector<WeakReference<Window>>(); | |
| 1194 | + newAppContext.put(Window.class, windowList); | |
| 1195 | + } | |
| 1196 | + // use the same weakRef here as it is used elsewhere | |
| 1197 | + windowList.add(weakRef); | |
| 1198 | + } | |
| 1199 | + } | |
| 1200 | + } | |
| 1201 | + | |
| 1202 | + // Flag to indicate if applet is targeted for JDK 1.1. | |
| 1203 | + private boolean jdk11Applet = false; | |
| 1204 | + | |
| 1205 | + // Flag to indicate if applet is targeted for JDK 1.2. | |
| 1206 | + private boolean jdk12Applet = false; | |
| 1207 | + | |
| 1208 | + /** | |
| 1209 | + * Determine JDK level of an applet. | |
| 1210 | + */ | |
| 1211 | + private void findAppletJDKLevel(Applet applet) | |
| 1212 | + { | |
| 1213 | + // To determine the JDK level of an applet, the | |
| 1214 | + // most reliable way is to check the major version | |
| 1215 | + // of the applet class file. | |
| 1216 | + | |
| 1217 | + // synchronized on applet class object, so calling from | |
| 1218 | + // different instances of the same applet will be | |
| 1219 | + // serialized. | |
| 1220 | + Class appletClass = applet.getClass(); | |
| 1221 | + | |
| 1222 | + synchronized(appletClass) { | |
| 1223 | + // Determine if the JDK level of an applet has been | |
| 1224 | + // checked before. | |
| 1225 | + Boolean jdk11Target = (Boolean) loader.isJDK11Target(appletClass); | |
| 1226 | + Boolean jdk12Target = (Boolean) loader.isJDK12Target(appletClass); | |
| 1227 | + | |
| 1228 | + // if applet JDK level has been checked before, retrieve | |
| 1229 | + // value and return. | |
| 1230 | + if (jdk11Target != null || jdk12Target != null) { | |
| 1231 | + jdk11Applet = (jdk11Target == null) ? false : jdk11Target.booleanValue(); | |
| 1232 | + jdk12Applet = (jdk12Target == null) ? false : jdk12Target.booleanValue(); | |
| 1233 | + return; | |
| 1234 | + } | |
| 1235 | + | |
| 1236 | + String name = appletClass.getName(); | |
| 1237 | + | |
| 1238 | + // first convert any '.' to '/' | |
| 1239 | + name = name.replace('.', '/'); | |
| 1240 | + | |
| 1241 | + // append .class | |
| 1242 | + final String resourceName = name + ".class"; | |
| 1243 | + | |
| 1244 | + InputStream is = null; | |
| 1245 | + byte[] classHeader = new byte[8]; | |
| 1246 | + | |
| 1247 | + try { | |
| 1248 | + is = (InputStream) java.security.AccessController.doPrivileged( | |
| 1249 | + new java.security.PrivilegedAction() { | |
| 1250 | + public Object run() { | |
| 1251 | + return loader.getResourceAsStream(resourceName); | |
| 1252 | + } | |
| 1253 | + }); | |
| 1254 | + | |
| 1255 | + // Read the first 8 bytes of the class file | |
| 1256 | + int byteRead = is.read(classHeader, 0, 8); | |
| 1257 | + is.close(); | |
| 1258 | + | |
| 1259 | + // return if the header is not read in entirely | |
| 1260 | + // for some reasons. | |
| 1261 | + if (byteRead != 8) | |
| 1262 | + return; | |
| 1263 | + } | |
| 1264 | + catch (IOException e) { | |
| 1265 | + return; | |
| 1266 | + } | |
| 1267 | + | |
| 1268 | + // Check major version in class file header | |
| 1269 | + int major_version = readShort(classHeader, 6); | |
| 1270 | + | |
| 1271 | + // Major version in class file is as follows: | |
| 1272 | + // 45 - JDK 1.1 | |
| 1273 | + // 46 - JDK 1.2 | |
| 1274 | + // 47 - JDK 1.3 | |
| 1275 | + // 48 - JDK 1.4 | |
| 1276 | + // 49 - JDK 1.5 | |
| 1277 | + if (major_version < 46) | |
| 1278 | + jdk11Applet = true; | |
| 1279 | + else if (major_version == 46) | |
| 1280 | + jdk12Applet = true; | |
| 1281 | + | |
| 1282 | + // Store applet JDK level in AppContext for later lookup, | |
| 1283 | + // e.g. page switch. | |
| 1284 | + loader.setJDK11Target(appletClass, jdk11Applet); | |
| 1285 | + loader.setJDK12Target(appletClass, jdk12Applet); | |
| 1286 | + } | |
| 1287 | + } | |
| 1288 | + | |
| 1289 | + /** | |
| 1290 | + * Return true if applet is targeted to JDK 1.1. | |
| 1291 | + */ | |
| 1292 | + protected boolean isJDK11Applet() { | |
| 1293 | + return jdk11Applet; | |
| 1294 | + } | |
| 1295 | + | |
| 1296 | + /** | |
| 1297 | + * Return true if applet is targeted to JDK1.2. | |
| 1298 | + */ | |
| 1299 | + protected boolean isJDK12Applet() { | |
| 1300 | + return jdk12Applet; | |
| 1301 | + } | |
| 1302 | + | |
| 1303 | + /** | |
| 1304 | + * Read short from byte array. | |
| 1305 | + */ | |
| 1306 | + private int readShort(byte[] b, int off) { | |
| 1307 | + int hi = readByte(b[off]); | |
| 1308 | + int lo = readByte(b[off + 1]); | |
| 1309 | + return (hi << 8) | lo; | |
| 1310 | + } | |
| 1311 | + | |
| 1312 | + private int readByte(byte b) { | |
| 1313 | + return ((int)b) & 0xFF; | |
| 1314 | + } | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + private static AppletMessageHandler amh = new AppletMessageHandler("appletpanel"); | |
| 1318 | +} | |
| @@ -0,0 +1,221 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1995, 2003, 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 | +package sun.applet; | |
| 27 | + | |
| 28 | +import java.awt.*; | |
| 29 | +import java.io.*; | |
| 30 | +import java.util.Properties; | |
| 31 | +import sun.net.www.http.HttpClient; | |
| 32 | +import sun.net.ftp.FtpClient; | |
| 33 | +import java.security.AccessController; | |
| 34 | +import java.security.PrivilegedAction; | |
| 35 | +import java.security.PrivilegedExceptionAction; | |
| 36 | +import java.security.PrivilegedActionException; | |
| 37 | + | |
| 38 | +import sun.security.action.*; | |
| 39 | + | |
| 40 | +class AppletProps extends Frame { | |
| 41 | + | |
| 42 | + TextField proxyHost; | |
| 43 | + TextField proxyPort; | |
| 44 | + Choice accessMode; | |
| 45 | + | |
| 46 | + AppletProps() { | |
| 47 | + setTitle(amh.getMessage("title")); | |
| 48 | + Panel p = new Panel(); | |
| 49 | + p.setLayout(new GridLayout(0, 2)); | |
| 50 | + | |
| 51 | + p.add(new Label(amh.getMessage("label.http.server", "Http proxy server:"))); | |
| 52 | + p.add(proxyHost = new TextField()); | |
| 53 | + | |
| 54 | + p.add(new Label(amh.getMessage("label.http.proxy"))); | |
| 55 | + p.add(proxyPort = new TextField()); | |
| 56 | + | |
| 57 | + p.add(new Label(amh.getMessage("label.class"))); | |
| 58 | + p.add(accessMode = new Choice()); | |
| 59 | + accessMode.addItem(amh.getMessage("choice.class.item.restricted")); | |
| 60 | + accessMode.addItem(amh.getMessage("choice.class.item.unrestricted")); | |
| 61 | + | |
| 62 | + add("Center", p); | |
| 63 | + p = new Panel(); | |
| 64 | + p.add(new Button(amh.getMessage("button.apply"))); | |
| 65 | + p.add(new Button(amh.getMessage("button.reset"))); | |
| 66 | + p.add(new Button(amh.getMessage("button.cancel"))); | |
| 67 | + add("South", p); | |
| 68 | + move(200, 150); | |
| 69 | + pack(); | |
| 70 | + reset(); | |
| 71 | + } | |
| 72 | + | |
| 73 | + void reset() { | |
| 74 | + AppletSecurity security = (AppletSecurity) System.getSecurityManager(); | |
| 75 | + if (security != null) | |
| 76 | + security.reset(); | |
| 77 | + | |
| 78 | + String proxyhost = (String) AccessController.doPrivileged( | |
| 79 | + new GetPropertyAction("http.proxyHost")); | |
| 80 | + String proxyport = (String) AccessController.doPrivileged( | |
| 81 | + new GetPropertyAction("http.proxyPort")); | |
| 82 | + | |
| 83 | + Boolean tmp = (Boolean) AccessController.doPrivileged( | |
| 84 | + new GetBooleanAction("package.restrict.access.sun")); | |
| 85 | + | |
| 86 | + boolean packageRestrict = tmp.booleanValue(); | |
| 87 | + if (packageRestrict) { | |
| 88 | + accessMode.select(amh.getMessage("choice.class.item.restricted")); | |
| 89 | + } else { | |
| 90 | + accessMode.select(amh.getMessage("choice.class.item.unrestricted")); | |
| 91 | + } | |
| 92 | + | |
| 93 | + if (proxyhost != null) { | |
| 94 | + proxyHost.setText(proxyhost); | |
| 95 | + proxyPort.setText(proxyport); | |
| 96 | + } else { | |
| 97 | + proxyHost.setText(""); | |
| 98 | + proxyPort.setText(""); | |
| 99 | + } | |
| 100 | + } | |
| 101 | + | |
| 102 | + void apply() { | |
| 103 | + String proxyHostValue = proxyHost.getText().trim(); | |
| 104 | + String proxyPortValue = proxyPort.getText().trim(); | |
| 105 | + | |
| 106 | + // Get properties | |
| 107 | + final Properties props = (Properties) AccessController.doPrivileged( | |
| 108 | + new PrivilegedAction() { | |
| 109 | + public Object run() { | |
| 110 | + return System.getProperties(); | |
| 111 | + } | |
| 112 | + }); | |
| 113 | + | |
| 114 | + if (proxyHostValue.length() != 0) { | |
| 115 | + /* 4066402 */ | |
| 116 | + /* Check for parsable value in proxy port number field before */ | |
| 117 | + /* applying. Display warning to user until parsable value is */ | |
| 118 | + /* entered. */ | |
| 119 | + int proxyPortNumber = 0; | |
| 120 | + try { | |
| 121 | + proxyPortNumber = Integer.parseInt(proxyPortValue); | |
| 122 | + } catch (NumberFormatException e) {} | |
| 123 | + | |
| 124 | + if (proxyPortNumber <= 0) { | |
| 125 | + proxyPort.selectAll(); | |
| 126 | + proxyPort.requestFocus(); | |
| 127 | + (new AppletPropsErrorDialog(this, | |
| 128 | + amh.getMessage("title.invalidproxy"), | |
| 129 | + amh.getMessage("label.invalidproxy"), | |
| 130 | + amh.getMessage("button.ok"))).show(); | |
| 131 | + return; | |
| 132 | + } | |
| 133 | + /* end 4066402 */ | |
| 134 | + | |
| 135 | + props.put("http.proxyHost", proxyHostValue); | |
| 136 | + props.put("http.proxyPort", proxyPortValue); | |
| 137 | + } else { | |
| 138 | + props.put("http.proxyHost", ""); | |
| 139 | + } | |
| 140 | + | |
| 141 | + if (amh.getMessage("choice.class.item.restricted").equals(accessMode.getSelectedItem())) { | |
| 142 | + props.put("package.restrict.access.sun", "true"); | |
| 143 | + } else { | |
| 144 | + props.put("package.restrict.access.sun", "false"); | |
| 145 | + } | |
| 146 | + | |
| 147 | + // Save properties | |
| 148 | + try { | |
| 149 | + reset(); | |
| 150 | + AccessController.doPrivileged(new PrivilegedExceptionAction() { | |
| 151 | + public Object run() throws IOException { | |
| 152 | + File dotAV = Main.theUserPropertiesFile; | |
| 153 | + FileOutputStream out = new FileOutputStream(dotAV); | |
| 154 | + Properties avProps = new Properties(); | |
| 155 | + for (int i = 0; i < Main.avDefaultUserProps.length; i++) { | |
| 156 | + String avKey = Main.avDefaultUserProps[i][0]; | |
| 157 | + avProps.setProperty(avKey, props.getProperty(avKey)); | |
| 158 | + } | |
| 159 | + avProps.store(out, amh.getMessage("prop.store")); | |
| 160 | + out.close(); | |
| 161 | + return null; | |
| 162 | + } | |
| 163 | + }); | |
| 164 | + hide(); | |
| 165 | + } catch (java.security.PrivilegedActionException e) { | |
| 166 | + System.out.println(amh.getMessage("apply.exception", | |
| 167 | + e.getException())); | |
| 168 | + // XXX what's the general feeling on stack traces to System.out? | |
| 169 | + e.printStackTrace(); | |
| 170 | + reset(); | |
| 171 | + } | |
| 172 | + } | |
| 173 | + | |
| 174 | + public boolean action(Event evt, Object obj) { | |
| 175 | + if (amh.getMessage("button.apply").equals(obj)) { | |
| 176 | + apply(); | |
| 177 | + return true; | |
| 178 | + } | |
| 179 | + if (amh.getMessage("button.reset").equals(obj)) { | |
| 180 | + reset(); | |
| 181 | + return true; | |
| 182 | + } | |
| 183 | + if (amh.getMessage("button.cancel").equals(obj)) { | |
| 184 | + reset(); | |
| 185 | + hide(); | |
| 186 | + return true; | |
| 187 | + } | |
| 188 | + return false; | |
| 189 | + } | |
| 190 | + | |
| 191 | + private static AppletMessageHandler amh = new AppletMessageHandler("appletprops"); | |
| 192 | + | |
| 193 | +} | |
| 194 | + | |
| 195 | +/* 4066432 */ | |
| 196 | +/* Dialog class to display property-related errors to user */ | |
| 197 | + | |
| 198 | +class AppletPropsErrorDialog extends Dialog { | |
| 199 | + public AppletPropsErrorDialog(Frame parent, String title, String message, | |
| 200 | + String buttonText) { | |
| 201 | + super(parent, title, true); | |
| 202 | + Panel p = new Panel(); | |
| 203 | + add("Center", new Label(message)); | |
| 204 | + p.add(new Button(buttonText)); | |
| 205 | + add("South", p); | |
| 206 | + pack(); | |
| 207 | + | |
| 208 | + Dimension dDim = size(); | |
| 209 | + Rectangle fRect = parent.bounds(); | |
| 210 | + move(fRect.x + ((fRect.width - dDim.width) / 2), | |
| 211 | + fRect.y + ((fRect.height - dDim.height) / 2)); | |
| 212 | + } | |
| 213 | + | |
| 214 | + public boolean action(Event event, Object object) { | |
| 215 | + hide(); | |
| 216 | + dispose(); | |
| 217 | + return true; | |
| 218 | + } | |
| 219 | +} | |
| 220 | + | |
| 221 | +/* end 4066432 */ | |
| @@ -0,0 +1,48 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1996, 1998, 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 | +package sun.applet; | |
| 27 | + | |
| 28 | +import java.net.URL; | |
| 29 | +import java.awt.Image; | |
| 30 | +import sun.misc.Ref; | |
| 31 | + | |
| 32 | +/** | |
| 33 | + * Part of this class still remains only to support legacy, 100%-impure | |
| 34 | + * applications such as HotJava 1.0.1. | |
| 35 | + */ | |
| 36 | +public class AppletResourceLoader { | |
| 37 | + public static Image getImage(URL url) { | |
| 38 | + return AppletViewer.getCachedImage(url); | |
| 39 | + } | |
| 40 | + | |
| 41 | + public static Ref getImageRef(URL url) { | |
| 42 | + return AppletViewer.getCachedImageRef(url); | |
| 43 | + } | |
| 44 | + | |
| 45 | + public static void flushImages() { | |
| 46 | + AppletViewer.flushImageCache(); | |
| 47 | + } | |
| 48 | +} | |
Binary file not shown.
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1,371 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1995, 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 | + */ | |
| 25 | + | |
| 26 | +package sun.applet; | |
| 27 | + | |
| 28 | +import java.io.File; | |
| 29 | +import java.io.FilePermission; | |
| 30 | +import java.io.IOException; | |
| 31 | +import java.io.FileDescriptor; | |
| 32 | +import java.net.URL; | |
| 33 | +import java.net.URLClassLoader; | |
| 34 | +import java.net.InetAddress; | |
| 35 | +import java.net.UnknownHostException; | |
| 36 | +import java.net.SocketPermission; | |
| 37 | +import java.util.Enumeration; | |
| 38 | +import java.util.Iterator; | |
| 39 | +import java.util.HashSet; | |
| 40 | +import java.util.StringTokenizer; | |
| 41 | +import java.security.*; | |
| 42 | +import java.lang.reflect.*; | |
| 43 | +import sun.awt.AWTSecurityManager; | |
| 44 | +import sun.awt.AppContext; | |
| 45 | +import sun.security.provider.*; | |
| 46 | +import sun.security.util.SecurityConstants; | |
| 47 | + | |
| 48 | + | |
| 49 | +/** | |
| 50 | + * This class defines an applet security policy | |
| 51 | + * | |
| 52 | + */ | |
| 53 | +public | |
| 54 | +class AppletSecurity extends AWTSecurityManager { | |
| 55 | + private AppContext mainAppContext; | |
| 56 | + | |
| 57 | + //URLClassLoader.acc | |
| 58 | + private static Field facc = null; | |
| 59 | + | |
| 60 | + //AccessControlContext.context; | |
| 61 | + private static Field fcontext = null; | |
| 62 | + | |
| 63 | + static { | |
| 64 | + try { | |
| 65 | + facc = URLClassLoader.class.getDeclaredField("acc"); | |
| 66 | + facc.setAccessible(true); | |
| 67 | + fcontext = AccessControlContext.class.getDeclaredField("context"); | |
| 68 | + fcontext.setAccessible(true); | |
| 69 | + } catch (NoSuchFieldException e) { | |
| 70 | + throw new UnsupportedOperationException(e); | |
| 71 | + } | |
| 72 | + } | |
| 73 | + | |
| 74 | + | |
| 75 | + /** | |
| 76 | + * Construct and initialize. | |
| 77 | + */ | |
| 78 | + public AppletSecurity() { | |
| 79 | + reset(); | |
| 80 | + mainAppContext = AppContext.getAppContext(); | |
| 81 | + } | |
| 82 | + | |
| 83 | + // Cache to store known restricted packages | |
| 84 | + private HashSet restrictedPackages = new HashSet(); | |
| 85 | + | |
| 86 | + /** | |
| 87 | + * Reset from Properties | |
| 88 | + */ | |
| 89 | + public void reset() | |
| 90 | + { | |
| 91 | + // Clear cache | |
| 92 | + restrictedPackages.clear(); | |
| 93 | + | |
| 94 | + AccessController.doPrivileged(new PrivilegedAction() { | |
| 95 | + public Object run() | |
| 96 | + { | |
| 97 | + // Enumerate system properties | |
| 98 | + Enumeration e = System.getProperties().propertyNames(); | |
| 99 | + | |
| 100 | + while (e.hasMoreElements()) | |
| 101 | + { | |
| 102 | + String name = (String) e.nextElement(); | |
| 103 | + | |
| 104 | + if (name != null && name.startsWith("package.restrict.access.")) | |
| 105 | + { | |
| 106 | + String value = System.getProperty(name); | |
| 107 | + | |
| 108 | + if (value != null && value.equalsIgnoreCase("true")) | |
| 109 | + { | |
| 110 | + String pkg = name.substring(24); | |
| 111 | + | |
| 112 | + // Cache restricted packages | |
| 113 | + restrictedPackages.add(pkg); | |
| 114 | + } | |
| 115 | + } | |
| 116 | + } | |
| 117 | + return null; | |
| 118 | + } | |
| 119 | + }); | |
| 120 | + } | |
| 121 | + | |
| 122 | + /** | |
| 123 | + * get the current (first) instance of an AppletClassLoader on the stack. | |
| 124 | + */ | |
| 125 | + private AppletClassLoader currentAppletClassLoader() | |
| 126 | + { | |
| 127 | + // try currentClassLoader first | |
| 128 | + ClassLoader loader = currentClassLoader(); | |
| 129 | + | |
| 130 | + if ((loader == null) || (loader instanceof AppletClassLoader)) | |
| 131 | + return (AppletClassLoader)loader; | |
| 132 | + | |
| 133 | + // if that fails, get all the classes on the stack and check them. | |
| 134 | + Class[] context = getClassContext(); | |
| 135 | + for (int i = 0; i < context.length; i++) { | |
| 136 | + loader = context[i].getClassLoader(); | |
| 137 | + if (loader instanceof AppletClassLoader) | |
| 138 | + return (AppletClassLoader)loader; | |
| 139 | + } | |
| 140 | + | |
| 141 | + /* | |
| 142 | + * fix bug # 6433620 the logic here is : try to find URLClassLoader from | |
| 143 | + * class context, check its AccessControlContext to see if | |
| 144 | + * AppletClassLoader is in stack when it's created. for this kind of | |
| 145 | + * URLClassLoader, return the AppContext assocated with the | |
| 146 | + * AppletClassLoader. | |
| 147 | + */ | |
| 148 | + for (int i = 0; i < context.length; i++) { | |
| 149 | + final ClassLoader currentLoader = context[i].getClassLoader(); | |
| 150 | + | |
| 151 | + if (currentLoader instanceof URLClassLoader) { | |
| 152 | + loader = (ClassLoader) AccessController.doPrivileged(new PrivilegedAction() { | |
| 153 | + public Object run() { | |
| 154 | + | |
| 155 | + AccessControlContext acc = null; | |
| 156 | + ProtectionDomain[] pds = null; | |
| 157 | + | |
| 158 | + try { | |
| 159 | + acc = (AccessControlContext) facc.get(currentLoader); | |
| 160 | + if (acc == null) { | |
| 161 | + return null; | |
| 162 | + } | |
| 163 | + | |
| 164 | + pds = (ProtectionDomain[]) fcontext.get(acc); | |
| 165 | + if (pds == null) { | |
| 166 | + return null; | |
| 167 | + } | |
| 168 | + } catch (Exception e) { | |
| 169 | + throw new UnsupportedOperationException(e); | |
| 170 | + } | |
| 171 | + | |
| 172 | + for (int i=0; i<pds.length; i++) { | |
| 173 | + ClassLoader cl = pds[i].getClassLoader(); | |
| 174 | + | |
| 175 | + if (cl instanceof AppletClassLoader) { | |
| 176 | + return cl; | |
| 177 | + } | |
| 178 | + } | |
| 179 | + | |
| 180 | + return null; | |
| 181 | + } | |
| 182 | + }); | |
| 183 | + | |
| 184 | + if (loader != null) { | |
| 185 | + return (AppletClassLoader) loader; | |
| 186 | + } | |
| 187 | + } | |
| 188 | + } | |
| 189 | + | |
| 190 | + // if that fails, try the context class loader | |
| 191 | + loader = Thread.currentThread().getContextClassLoader(); | |
| 192 | + if (loader instanceof AppletClassLoader) | |
| 193 | + return (AppletClassLoader)loader; | |
| 194 | + | |
| 195 | + // no AppletClassLoaders on the stack | |
| 196 | + return (AppletClassLoader)null; | |
| 197 | + } | |
| 198 | + | |
| 199 | + /** | |
| 200 | + * Returns true if this threadgroup is in the applet's own thread | |
| 201 | + * group. This will return false if there is no current class | |
| 202 | + * loader. | |
| 203 | + */ | |
| 204 | + protected boolean inThreadGroup(ThreadGroup g) { | |
| 205 | + if (currentAppletClassLoader() == null) | |
| 206 | + return false; | |
| 207 | + else | |
| 208 | + return getThreadGroup().parentOf(g); | |
| 209 | + } | |
| 210 | + | |
| 211 | + /** | |
| 212 | + * Returns true of the threadgroup of thread is in the applet's | |
| 213 | + * own threadgroup. | |
| 214 | + */ | |
| 215 | + protected boolean inThreadGroup(Thread thread) { | |
| 216 | + return inThreadGroup(thread.getThreadGroup()); | |
| 217 | + } | |
| 218 | + | |
| 219 | + /** | |
| 220 | + * Applets are not allowed to manipulate threads outside | |
| 221 | + * applet thread groups. However a terminated thread no longer belongs | |
| 222 | + * to any group. | |
| 223 | + */ | |
| 224 | + public void checkAccess(Thread t) { | |
| 225 | + /* When multiple applets is reloaded simultaneously, there will be | |
| 226 | + * multiple invocations to this method from plugin's SecurityManager. | |
| 227 | + * This method should not be synchronized to avoid deadlock when | |
| 228 | + * a page with multiple applets is reloaded | |
| 229 | + */ | |
| 230 | + if ((t.getState() != Thread.State.TERMINATED) && !inThreadGroup(t)) { | |
| 231 | + checkPermission(SecurityConstants.MODIFY_THREAD_PERMISSION); | |
| 232 | + } | |
| 233 | + } | |
| 234 | + | |
| 235 | + private boolean inThreadGroupCheck = false; | |
| 236 | + | |
| 237 | + /** | |
| 238 | + * Applets are not allowed to manipulate thread groups outside | |
| 239 | + * applet thread groups. | |
| 240 | + */ | |
| 241 | + public synchronized void checkAccess(ThreadGroup g) { | |
| 242 | + if (inThreadGroupCheck) { | |
| 243 | + // if we are in a recursive check, it is because | |
| 244 | + // inThreadGroup is calling appletLoader.getThreadGroup | |
| 245 | + // in that case, only do the super check, as appletLoader | |
| 246 | + // has a begin/endPrivileged | |
| 247 | + checkPermission(SecurityConstants.MODIFY_THREADGROUP_PERMISSION); | |
| 248 | + } else { | |
| 249 | + try { | |
| 250 | + inThreadGroupCheck = true; | |
| 251 | + if (!inThreadGroup(g)) { | |
| 252 | + checkPermission(SecurityConstants.MODIFY_THREADGROUP_PERMISSION); | |
| 253 | + } | |
| 254 | + } finally { | |
| 255 | + inThreadGroupCheck = false; | |
| 256 | + } | |
| 257 | + } | |
| 258 | + } | |
| 259 | + | |
| 260 | + | |
| 261 | + /** | |
| 262 | + * Throws a <code>SecurityException</code> if the | |
| 263 | + * calling thread is not allowed to access the package specified by | |
| 264 | + * the argument. | |
| 265 | + * <p> | |
| 266 | + * This method is used by the <code>loadClass</code> method of class | |
| 267 | + * loaders. | |
| 268 | + * <p> | |
| 269 | + * The <code>checkPackageAccess</code> method for class | |
| 270 | + * <code>SecurityManager</code> calls | |
| 271 | + * <code>checkPermission</code> with the | |
| 272 | + * <code>RuntimePermission("accessClassInPackage."+pkg)</code> | |
| 273 | + * permission. | |
| 274 | + * | |
| 275 | + * @param pkg the package name. | |
| 276 | + * @exception SecurityException if the caller does not have | |
| 277 | + * permission to access the specified package. | |
| 278 | + * @see java.lang.ClassLoader#loadClass(java.lang.String, boolean) | |
| 279 | + */ | |
| 280 | + public void checkPackageAccess(final String pkgname) { | |
| 281 | + | |
| 282 | + // first see if the VM-wide policy allows access to this package | |
| 283 | + super.checkPackageAccess(pkgname); | |
| 284 | + | |
| 285 | + // now check the list of restricted packages | |
| 286 | + for (Iterator iter = restrictedPackages.iterator(); iter.hasNext();) | |
| 287 | + { | |
| 288 | + String pkg = (String) iter.next(); | |
| 289 | + | |
| 290 | + // Prevent matching "sun" and "sunir" even if they | |
| 291 | + // starts with similar beginning characters | |
| 292 | + // | |
| 293 | + if (pkgname.equals(pkg) || pkgname.startsWith(pkg + ".")) | |
| 294 | + { | |
| 295 | + checkPermission(new java.lang.RuntimePermission | |
| 296 | + ("accessClassInPackage." + pkgname)); | |
| 297 | + } | |
| 298 | + } | |
| 299 | + } | |
| 300 | + | |
| 301 | + /** | |
| 302 | + * Tests if a client can get access to the AWT event queue. | |
| 303 | + * <p> | |
| 304 | + * This method calls <code>checkPermission</code> with the | |
| 305 | + * <code>AWTPermission("accessEventQueue")</code> permission. | |
| 306 | + * | |
| 307 | + * @since JDK1.1 | |
| 308 | + * @exception SecurityException if the caller does not have | |
| 309 | + * permission to accesss the AWT event queue. | |
| 310 | + */ | |
| 311 | + public void checkAwtEventQueueAccess() { | |
| 312 | + AppContext appContext = AppContext.getAppContext(); | |
| 313 | + AppletClassLoader appletClassLoader = currentAppletClassLoader(); | |
| 314 | + | |
| 315 | + if ((appContext == mainAppContext) && (appletClassLoader != null)) { | |
| 316 | + // If we're about to allow access to the main EventQueue, | |
| 317 | + // and anything untrusted is on the class context stack, | |
| 318 | + // disallow access. | |
| 319 | + super.checkAwtEventQueueAccess(); | |
| 320 | + } | |
| 321 | + } // checkAwtEventQueueAccess() | |
| 322 | + | |
| 323 | + /** | |
| 324 | + * Returns the thread group of the applet. We consult the classloader | |
| 325 | + * if there is one. | |
| 326 | + */ | |
| 327 | + public ThreadGroup getThreadGroup() { | |
| 328 | + /* If any applet code is on the execution stack, we return | |
| 329 | + that applet's ThreadGroup. Otherwise, we use the default | |
| 330 | + behavior. */ | |
| 331 | + AppletClassLoader appletLoader = currentAppletClassLoader(); | |
| 332 | + ThreadGroup loaderGroup = (appletLoader == null) ? null | |
| 333 | + : appletLoader.getThreadGroup(); | |
| 334 | + if (loaderGroup != null) { | |
| 335 | + return loaderGroup; | |
| 336 | + } else { | |
| 337 | + return super.getThreadGroup(); | |
| 338 | + } | |
| 339 | + } // getThreadGroup() | |
| 340 | + | |
| 341 | + /** | |
| 342 | + * Get the AppContext corresponding to the current context. | |
| 343 | + * The default implementation returns null, but this method | |
| 344 | + * may be overridden by various SecurityManagers | |
| 345 | + * (e.g. AppletSecurity) to index AppContext objects by the | |
| 346 | + * calling context. | |
| 347 | + * | |
| 348 | + * @return the AppContext corresponding to the current context. | |
| 349 | + * @see sun.awt.AppContext | |
| 350 | + * @see java.lang.SecurityManager | |
| 351 | + * @since JDK1.2.1 | |
| 352 | + */ | |
| 353 | + public AppContext getAppContext() { | |
| 354 | + AppletClassLoader appletLoader = currentAppletClassLoader(); | |
| 355 | + | |
| 356 | + if (appletLoader == null) { | |
| 357 | + return null; | |
| 358 | + } else { | |
| 359 | + AppContext context = appletLoader.getAppContext(); | |
| 360 | + | |
| 361 | + // context == null when some thread in applet thread group | |
| 362 | + // has not been destroyed in AppContext.dispose() | |
| 363 | + if (context == null) { | |
| 364 | + throw new SecurityException("Applet classloader has invalid AppContext"); | |
| 365 | + } | |
| 366 | + | |
| 367 | + return context; | |
| 368 | + } | |
| 369 | + } | |
| 370 | + | |
| 371 | +} // class AppletSecurity | |
| @@ -0,0 +1,65 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1995, 1998, 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 | +package sun.applet; | |
| 27 | + | |
| 28 | +/** | |
| 29 | + * An applet security exception. | |
| 30 | + * | |
| 31 | + * @author Arthur van Hoff | |
| 32 | + */ | |
| 33 | +public | |
| 34 | +class AppletSecurityException extends SecurityException { | |
| 35 | + private String key = null; | |
| 36 | + private Object msgobj[] = null; | |
| 37 | + | |
| 38 | + public AppletSecurityException(String name) { | |
| 39 | + super(name); | |
| 40 | + this.key = name; | |
| 41 | + } | |
| 42 | + | |
| 43 | + public AppletSecurityException(String name, String arg) { | |
| 44 | + this(name); | |
| 45 | + msgobj = new Object[1]; | |
| 46 | + msgobj[0] = (Object)arg; | |
| 47 | + } | |
| 48 | + | |
| 49 | + public AppletSecurityException(String name, String arg1, String arg2) { | |
| 50 | + this(name); | |
| 51 | + msgobj = new Object[2]; | |
| 52 | + msgobj[0] = (Object)arg1; | |
| 53 | + msgobj[1] = (Object)arg2; | |
| 54 | + } | |
| 55 | + | |
| 56 | + public String getLocalizedMessage() { | |
| 57 | + if( msgobj != null) | |
| 58 | + return amh.getMessage(key, msgobj); | |
| 59 | + else | |
| 60 | + return amh.getMessage(key); | |
| 61 | + } | |
| 62 | + | |
| 63 | + private static AppletMessageHandler amh = new AppletMessageHandler("appletsecurityexception"); | |
| 64 | + | |
| 65 | +} | |
Binary file not shown.
| @@ -0,0 +1,64 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1995, 1997, 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 | +package sun.applet; | |
| 27 | + | |
| 28 | +/** | |
| 29 | + * This class defines an applet thread group. | |
| 30 | + * | |
| 31 | + * @author Arthur van Hoff | |
| 32 | + */ | |
| 33 | +public class AppletThreadGroup extends ThreadGroup { | |
| 34 | + | |
| 35 | + /** | |
| 36 | + * Constructs a new thread group for an applet. | |
| 37 | + * The parent of this new group is the thread | |
| 38 | + * group of the currently running thread. | |
| 39 | + * | |
| 40 | + * @param name the name of the new thread group. | |
| 41 | + */ | |
| 42 | + public AppletThreadGroup(String name) { | |
| 43 | + this(Thread.currentThread().getThreadGroup(), name); | |
| 44 | + } | |
| 45 | + | |
| 46 | + /** | |
| 47 | + * Creates a new thread group for an applet. | |
| 48 | + * The parent of this new group is the specified | |
| 49 | + * thread group. | |
| 50 | + * | |
| 51 | + * @param parent the parent thread group. | |
| 52 | + * @param name the name of the new thread group. | |
| 53 | + * @exception NullPointerException if the thread group argument is | |
| 54 | + * <code>null</code>. | |
| 55 | + * @exception SecurityException if the current thread cannot create a | |
| 56 | + * thread in the specified thread group. | |
| 57 | + * @see java.lang.SecurityException | |
| 58 | + * @since JDK1.1.1 | |
| 59 | + */ | |
| 60 | + public AppletThreadGroup(ThreadGroup parent, String name) { | |
| 61 | + super(parent, name); | |
| 62 | + setMaxPriority(Thread.NORM_PRIORITY - 1); | |
| 63 | + } | |
| 64 | +} | |
| @@ -0,0 +1,1278 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1995, 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 | + */ | |
| 25 | + | |
| 26 | +package sun.applet; | |
| 27 | + | |
| 28 | +import java.util.*; | |
| 29 | +import java.io.*; | |
| 30 | +import java.awt.*; | |
| 31 | +import java.awt.event.*; | |
| 32 | +import java.awt.print.*; | |
| 33 | +import javax.print.attribute.*; | |
| 34 | +import java.applet.*; | |
| 35 | +import java.net.URL; | |
| 36 | +import java.net.MalformedURLException; | |
| 37 | +import java.net.SocketPermission; | |
| 38 | +import sun.misc.Ref; | |
| 39 | +import java.security.AccessController; | |
| 40 | +import java.security.PrivilegedAction; | |
| 41 | +import java.lang.reflect.InvocationTargetException; | |
| 42 | +import java.lang.reflect.Method; | |
| 43 | +import sun.awt.SunToolkit; | |
| 44 | +import sun.awt.AppContext; | |
| 45 | +import java.lang.ref.WeakReference; | |
| 46 | + | |
| 47 | +/** | |
| 48 | + * A frame to show the applet tag in. | |
| 49 | + */ | |
| 50 | +class TextFrame extends Frame { | |
| 51 | + | |
| 52 | + /** | |
| 53 | + * Create the tag frame. | |
| 54 | + */ | |
| 55 | + TextFrame(int x, int y, String title, String text) { | |
| 56 | + setTitle(title); | |
| 57 | + TextArea txt = new TextArea(20, 60); | |
| 58 | + txt.setText(text); | |
| 59 | + txt.setEditable(false); | |
| 60 | + | |
| 61 | + add("Center", txt); | |
| 62 | + | |
| 63 | + Panel p = new Panel(); | |
| 64 | + add("South", p); | |
| 65 | + Button b = new Button(amh.getMessage("button.dismiss", "Dismiss")); | |
| 66 | + p.add(b); | |
| 67 | + | |
| 68 | + class ActionEventListener implements ActionListener { | |
| 69 | + public void actionPerformed(ActionEvent evt) { | |
| 70 | + dispose(); | |
| 71 | + } | |
| 72 | + } | |
| 73 | + b.addActionListener(new ActionEventListener()); | |
| 74 | + | |
| 75 | + pack(); | |
| 76 | + move(x, y); | |
| 77 | + setVisible(true); | |
| 78 | + | |
| 79 | + WindowListener windowEventListener = new WindowAdapter() { | |
| 80 | + | |
| 81 | + public void windowClosing(WindowEvent evt) { | |
| 82 | + dispose(); | |
| 83 | + } | |
| 84 | + }; | |
| 85 | + | |
| 86 | + addWindowListener(windowEventListener); | |
| 87 | + } | |
| 88 | + private static AppletMessageHandler amh = new AppletMessageHandler("textframe"); | |
| 89 | + | |
| 90 | +} | |
| 91 | + | |
| 92 | +/** | |
| 93 | + * Lets us construct one using unix-style one shot behaviors | |
| 94 | + */ | |
| 95 | + | |
| 96 | +class StdAppletViewerFactory implements AppletViewerFactory | |
| 97 | +{ | |
| 98 | + public AppletViewer createAppletViewer(int x, int y, | |
| 99 | + URL doc, Hashtable atts) { | |
| 100 | + return new AppletViewer(x, y, doc, atts, System.out, this); | |
| 101 | + } | |
| 102 | + | |
| 103 | + public MenuBar getBaseMenuBar() { | |
| 104 | + return new MenuBar(); | |
| 105 | + } | |
| 106 | + | |
| 107 | + public boolean isStandalone() { | |
| 108 | + return true; | |
| 109 | + } | |
| 110 | +} | |
| 111 | + | |
| 112 | +/** | |
| 113 | + * The applet viewer makes it possible to run a Java applet without using a browser. | |
| 114 | + * For details on the syntax that <B>appletviewer</B> supports, see | |
| 115 | + * <a href="../../../docs/tooldocs/appletviewertags.html">AppletViewer Tags</a>. | |
| 116 | + * (The document named appletviewertags.html in the JDK's docs/tooldocs directory, | |
| 117 | + * once the JDK docs have been installed.) | |
| 118 | + */ | |
| 119 | +public class AppletViewer extends Frame implements AppletContext, | |
| 120 | + Printable { | |
| 121 | + | |
| 122 | + /** | |
| 123 | + * Some constants... | |
| 124 | + */ | |
| 125 | + private static String defaultSaveFile = "Applet.ser"; | |
| 126 | + | |
| 127 | + /** | |
| 128 | + * The panel in which the applet is being displayed. | |
| 129 | + */ | |
| 130 | + AppletViewerPanel panel; | |
| 131 | + | |
| 132 | + /** | |
| 133 | + * The status line. | |
| 134 | + */ | |
| 135 | + Label label; | |
| 136 | + | |
| 137 | + /** | |
| 138 | + * output status messages to this stream | |
| 139 | + */ | |
| 140 | + | |
| 141 | + PrintStream statusMsgStream; | |
| 142 | + | |
| 143 | + /** | |
| 144 | + * For cloning | |
| 145 | + */ | |
| 146 | + AppletViewerFactory factory; | |
| 147 | + | |
| 148 | + | |
| 149 | + private final class UserActionListener implements ActionListener { | |
| 150 | + public void actionPerformed(ActionEvent evt) { | |
| 151 | + processUserAction(evt); | |
| 152 | + } | |
| 153 | + } | |
| 154 | + | |
| 155 | + /** | |
| 156 | + * Create the applet viewer | |
| 157 | + */ | |
| 158 | + public AppletViewer(int x, int y, URL doc, Hashtable atts, | |
| 159 | + PrintStream statusMsgStream, AppletViewerFactory factory) { | |
| 160 | + this.factory = factory; | |
| 161 | + this.statusMsgStream = statusMsgStream; | |
| 162 | + setTitle(amh.getMessage("tool.title", atts.get("code"))); | |
| 163 | + | |
| 164 | + MenuBar mb = factory.getBaseMenuBar(); | |
| 165 | + | |
| 166 | + Menu m = new Menu(amh.getMessage("menu.applet")); | |
| 167 | + | |
| 168 | + addMenuItem(m, "menuitem.restart"); | |
| 169 | + addMenuItem(m, "menuitem.reload"); | |
| 170 | + addMenuItem(m, "menuitem.stop"); | |
| 171 | + addMenuItem(m, "menuitem.save"); | |
| 172 | + addMenuItem(m, "menuitem.start"); | |
| 173 | + addMenuItem(m, "menuitem.clone"); | |
| 174 | + m.add(new MenuItem("-")); | |
| 175 | + addMenuItem(m, "menuitem.tag"); | |
| 176 | + addMenuItem(m, "menuitem.info"); | |
| 177 | + addMenuItem(m, "menuitem.edit").disable(); | |
| 178 | + addMenuItem(m, "menuitem.encoding"); | |
| 179 | + m.add(new MenuItem("-")); | |
| 180 | + addMenuItem(m, "menuitem.print"); | |
| 181 | + m.add(new MenuItem("-")); | |
| 182 | + addMenuItem(m, "menuitem.props"); | |
| 183 | + m.add(new MenuItem("-")); | |
| 184 | + addMenuItem(m, "menuitem.close"); | |
| 185 | + if (factory.isStandalone()) { | |
| 186 | + addMenuItem(m, "menuitem.quit"); | |
| 187 | + } | |
| 188 | + | |
| 189 | + mb.add(m); | |
| 190 | + | |
| 191 | + setMenuBar(mb); | |
| 192 | + | |
| 193 | + add("Center", panel = new AppletViewerPanel(doc, atts)); | |
| 194 | + add("South", label = new Label(amh.getMessage("label.hello"))); | |
| 195 | + panel.init(); | |
| 196 | + appletPanels.addElement(panel); | |
| 197 | + | |
| 198 | + pack(); | |
| 199 | + move(x, y); | |
| 200 | + setVisible(true); | |
| 201 | + | |
| 202 | + WindowListener windowEventListener = new WindowAdapter() { | |
| 203 | + | |
| 204 | + public void windowClosing(WindowEvent evt) { | |
| 205 | + appletClose(); | |
| 206 | + } | |
| 207 | + | |
| 208 | + public void windowIconified(WindowEvent evt) { | |
| 209 | + appletStop(); | |
| 210 | + } | |
| 211 | + | |
| 212 | + public void windowDeiconified(WindowEvent evt) { | |
| 213 | + appletStart(); | |
| 214 | + } | |
| 215 | + }; | |
| 216 | + | |
| 217 | + class AppletEventListener implements AppletListener | |
| 218 | + { | |
| 219 | + final Frame frame; | |
| 220 | + | |
| 221 | + public AppletEventListener(Frame frame) | |
| 222 | + { | |
| 223 | + this.frame = frame; | |
| 224 | + } | |
| 225 | + | |
| 226 | + public void appletStateChanged(AppletEvent evt) | |
| 227 | + { | |
| 228 | + AppletPanel src = (AppletPanel)evt.getSource(); | |
| 229 | + | |
| 230 | + switch (evt.getID()) { | |
| 231 | + case AppletPanel.APPLET_RESIZE: { | |
| 232 | + if(src != null) { | |
| 233 | + resize(preferredSize()); | |
| 234 | + validate(); | |
| 235 | + } | |
| 236 | + break; | |
| 237 | + } | |
| 238 | + case AppletPanel.APPLET_LOADING_COMPLETED: { | |
| 239 | + Applet a = src.getApplet(); // sun.applet.AppletPanel | |
| 240 | + | |
| 241 | + // Fixed #4754451: Applet can have methods running on main | |
| 242 | + // thread event queue. | |
| 243 | + // | |
| 244 | + // The cause of this bug is that the frame of the applet | |
| 245 | + // is created in main thread group. Thus, when certain | |
| 246 | + // AWT/Swing events are generated, the events will be | |
| 247 | + // dispatched through the wrong event dispatch thread. | |
| 248 | + // | |
| 249 | + // To fix this, we rearrange the AppContext with the frame, | |
| 250 | + // so the proper event queue will be looked up. | |
| 251 | + // | |
| 252 | + // Swing also maintains a Frame list for the AppContext, | |
| 253 | + // so we will have to rearrange it as well. | |
| 254 | + // | |
| 255 | + if (a != null) | |
| 256 | + AppletPanel.changeFrameAppContext(frame, SunToolkit.targetToAppContext(a)); | |
| 257 | + else | |
| 258 | + AppletPanel.changeFrameAppContext(frame, AppContext.getAppContext()); | |
| 259 | + | |
| 260 | + break; | |
| 261 | + } | |
| 262 | + } | |
| 263 | + } | |
| 264 | + }; | |
| 265 | + | |
| 266 | + addWindowListener(windowEventListener); | |
| 267 | + panel.addAppletListener(new AppletEventListener(this)); | |
| 268 | + | |
| 269 | + // Start the applet | |
| 270 | + showStatus(amh.getMessage("status.start")); | |
| 271 | + initEventQueue(); | |
| 272 | + } | |
| 273 | + | |
| 274 | + // XXX 99/9/10 probably should be "private" | |
| 275 | + public MenuItem addMenuItem(Menu m, String s) { | |
| 276 | + MenuItem mItem = new MenuItem(amh.getMessage(s)); | |
| 277 | + mItem.addActionListener(new UserActionListener()); | |
| 278 | + return m.add(mItem); | |
| 279 | + } | |
| 280 | + | |
| 281 | + /** | |
| 282 | + * Send the initial set of events to the appletviewer event queue. | |
| 283 | + * On start-up the current behaviour is to load the applet and call | |
| 284 | + * Applet.init() and Applet.start(). | |
| 285 | + */ | |
| 286 | + private void initEventQueue() { | |
| 287 | + // appletviewer.send.event is an undocumented and unsupported system | |
| 288 | + // property which is used exclusively for testing purposes. | |
| 289 | + String eventList = System.getProperty("appletviewer.send.event"); | |
| 290 | + | |
| 291 | + if (eventList == null) { | |
| 292 | + // Add the standard events onto the event queue. | |
| 293 | + panel.sendEvent(AppletPanel.APPLET_LOAD); | |
| 294 | + panel.sendEvent(AppletPanel.APPLET_INIT); | |
| 295 | + panel.sendEvent(AppletPanel.APPLET_START); | |
| 296 | + } else { | |
| 297 | + // We're testing AppletViewer. Force the specified set of events | |
| 298 | + // onto the event queue, wait for the events to be processed, and | |
| 299 | + // exit. | |
| 300 | + | |
| 301 | + // The list of events that will be executed is provided as a | |
| 302 | + // ","-separated list. No error-checking will be done on the list. | |
| 303 | + String [] events = splitSeparator(",", eventList); | |
| 304 | + | |
| 305 | + for (int i = 0; i < events.length; i++) { | |
| 306 | + System.out.println("Adding event to queue: " + events[i]); | |
| 307 | + if (events[i].equals("dispose")) | |
| 308 | + panel.sendEvent(AppletPanel.APPLET_DISPOSE); | |
| 309 | + else if (events[i].equals("load")) | |
| 310 | + panel.sendEvent(AppletPanel.APPLET_LOAD); | |
| 311 | + else if (events[i].equals("init")) | |
| 312 | + panel.sendEvent(AppletPanel.APPLET_INIT); | |
| 313 | + else if (events[i].equals("start")) | |
| 314 | + panel.sendEvent(AppletPanel.APPLET_START); | |
| 315 | + else if (events[i].equals("stop")) | |
| 316 | + panel.sendEvent(AppletPanel.APPLET_STOP); | |
| 317 | + else if (events[i].equals("destroy")) | |
| 318 | + panel.sendEvent(AppletPanel.APPLET_DESTROY); | |
| 319 | + else if (events[i].equals("quit")) | |
| 320 | + panel.sendEvent(AppletPanel.APPLET_QUIT); | |
| 321 | + else if (events[i].equals("error")) | |
| 322 | + panel.sendEvent(AppletPanel.APPLET_ERROR); | |
| 323 | + else | |
| 324 | + // non-fatal error if we get an unrecognized event | |
| 325 | + System.out.println("Unrecognized event name: " + events[i]); | |
| 326 | + } | |
| 327 | + | |
| 328 | + while (!panel.emptyEventQueue()) ; | |
| 329 | + appletSystemExit(); | |
| 330 | + } | |
| 331 | + } | |
| 332 | + | |
| 333 | + /** | |
| 334 | + * Split a string based on the presence of a specified separator. Returns | |
| 335 | + * an array of arbitrary length. The end of each element in the array is | |
| 336 | + * indicated by the separator of the end of the string. If there is a | |
| 337 | + * separator immediately before the end of the string, the final element | |
| 338 | + * will be empty. None of the strings will contain the separator. Useful | |
| 339 | + * when separating strings such as "foo/bar/bas" using separator "/". | |
| 340 | + * | |
| 341 | + * @param sep The separator. | |
| 342 | + * @param s The string to split. | |
| 343 | + * @return An array of strings. Each string in the array is determined | |
| 344 | + * by the location of the provided sep in the original string, | |
| 345 | + * s. Whitespace not stripped. | |
| 346 | + */ | |
| 347 | + private String [] splitSeparator(String sep, String s) { | |
| 348 | + Vector v = new Vector(); | |
| 349 | + int tokenStart = 0; | |
| 350 | + int tokenEnd = 0; | |
| 351 | + | |
| 352 | + while ((tokenEnd = s.indexOf(sep, tokenStart)) != -1) { | |
| 353 | + v.addElement(s.substring(tokenStart, tokenEnd)); | |
| 354 | + tokenStart = tokenEnd+1; | |
| 355 | + } | |
| 356 | + // Add the final element. | |
| 357 | + v.addElement(s.substring(tokenStart)); | |
| 358 | + | |
| 359 | + String [] retVal = new String[v.size()]; | |
| 360 | + v.copyInto(retVal); | |
| 361 | + return retVal; | |
| 362 | + } | |
| 363 | + | |
| 364 | + /* | |
| 365 | + * Methods for java.applet.AppletContext | |
| 366 | + */ | |
| 367 | + | |
| 368 | + private static Map audioClips = new HashMap(); | |
| 369 | + | |
| 370 | + /** | |
| 371 | + * Get an audio clip. | |
| 372 | + */ | |
| 373 | + public AudioClip getAudioClip(URL url) { | |
| 374 | + checkConnect(url); | |
| 375 | + synchronized (audioClips) { | |
| 376 | + AudioClip clip = (AudioClip)audioClips.get(url); | |
| 377 | + if (clip == null) { | |
| 378 | + audioClips.put(url, clip = new AppletAudioClip(url)); | |
| 379 | + } | |
| 380 | + return clip; | |
| 381 | + } | |
| 382 | + } | |
| 383 | + | |
| 384 | + private static Map imageRefs = new HashMap(); | |
| 385 | + | |
| 386 | + /** | |
| 387 | + * Get an image. | |
| 388 | + */ | |
| 389 | + public Image getImage(URL url) { | |
| 390 | + return getCachedImage(url); | |
| 391 | + } | |
| 392 | + | |
| 393 | + static Image getCachedImage(URL url) { | |
| 394 | + // System.getSecurityManager().checkConnection(url.getHost(), url.getPort()); | |
| 395 | + return (Image)getCachedImageRef(url).get(); | |
| 396 | + } | |
| 397 | + | |
| 398 | + /** | |
| 399 | + * Get an image ref. | |
| 400 | + */ | |
| 401 | + static Ref getCachedImageRef(URL url) { | |
| 402 | + synchronized (imageRefs) { | |
| 403 | + AppletImageRef ref = (AppletImageRef)imageRefs.get(url); | |
| 404 | + if (ref == null) { | |
| 405 | + ref = new AppletImageRef(url); | |
| 406 | + imageRefs.put(url, ref); | |
| 407 | + } | |
| 408 | + return ref; | |
| 409 | + } | |
| 410 | + } | |
| 411 | + | |
| 412 | + /** | |
| 413 | + * Flush the image cache. | |
| 414 | + */ | |
| 415 | + static void flushImageCache() { | |
| 416 | + imageRefs.clear(); | |
| 417 | + } | |
| 418 | + | |
| 419 | + static Vector appletPanels = new Vector(); | |
| 420 | + | |
| 421 | + /** | |
| 422 | + * Get an applet by name. | |
| 423 | + */ | |
| 424 | + public Applet getApplet(String name) { | |
| 425 | + AppletSecurity security = (AppletSecurity)System.getSecurityManager(); | |
| 426 | + name = name.toLowerCase(); | |
| 427 | + SocketPermission panelSp = | |
| 428 | + new SocketPermission(panel.getCodeBase().getHost(), "connect"); | |
| 429 | + for (Enumeration e = appletPanels.elements() ; e.hasMoreElements() ;) { | |
| 430 | + AppletPanel p = (AppletPanel)e.nextElement(); | |
| 431 | + String param = p.getParameter("name"); | |
| 432 | + if (param != null) { | |
| 433 | + param = param.toLowerCase(); | |
| 434 | + } | |
| 435 | + if (name.equals(param) && | |
| 436 | + p.getDocumentBase().equals(panel.getDocumentBase())) { | |
| 437 | + | |
| 438 | + SocketPermission sp = | |
| 439 | + new SocketPermission(p.getCodeBase().getHost(), "connect"); | |
| 440 | + | |
| 441 | + if (panelSp.implies(sp)) { | |
| 442 | + return p.applet; | |
| 443 | + } | |
| 444 | + } | |
| 445 | + } | |
| 446 | + return null; | |
| 447 | + } | |
| 448 | + | |
| 449 | + /** | |
| 450 | + * Return an enumeration of all the accessible | |
| 451 | + * applets on this page. | |
| 452 | + */ | |
| 453 | + public Enumeration getApplets() { | |
| 454 | + AppletSecurity security = (AppletSecurity)System.getSecurityManager(); | |
| 455 | + Vector v = new Vector(); | |
| 456 | + SocketPermission panelSp = | |
| 457 | + new SocketPermission(panel.getCodeBase().getHost(), "connect"); | |
| 458 | + | |
| 459 | + for (Enumeration e = appletPanels.elements() ; e.hasMoreElements() ;) { | |
| 460 | + AppletPanel p = (AppletPanel)e.nextElement(); | |
| 461 | + if (p.getDocumentBase().equals(panel.getDocumentBase())) { | |
| 462 | + | |
| 463 | + SocketPermission sp = | |
| 464 | + new SocketPermission(p.getCodeBase().getHost(), "connect"); | |
| 465 | + if (panelSp.implies(sp)) { | |
| 466 | + v.addElement(p.applet); | |
| 467 | + } | |
| 468 | + } | |
| 469 | + } | |
| 470 | + return v.elements(); | |
| 471 | + } | |
| 472 | + | |
| 473 | + /** | |
| 474 | + * Ignore. | |
| 475 | + */ | |
| 476 | + public void showDocument(URL url) { | |
| 477 | + } | |
| 478 | + | |
| 479 | + /** | |
| 480 | + * Ignore. | |
| 481 | + */ | |
| 482 | + public void showDocument(URL url, String target) { | |
| 483 | + } | |
| 484 | + | |
| 485 | + /** | |
| 486 | + * Show status. | |
| 487 | + */ | |
| 488 | + public void showStatus(String status) { | |
| 489 | + label.setText(status); | |
| 490 | + } | |
| 491 | + | |
| 492 | + public void setStream(String key, InputStream stream)throws IOException{ | |
| 493 | + // We do nothing. | |
| 494 | + } | |
| 495 | + | |
| 496 | + public InputStream getStream(String key){ | |
| 497 | + // We do nothing. | |
| 498 | + return null; | |
| 499 | + } | |
| 500 | + | |
| 501 | + public Iterator getStreamKeys(){ | |
| 502 | + // We do nothing. | |
| 503 | + return null; | |
| 504 | + } | |
| 505 | + | |
| 506 | + /** | |
| 507 | + * System parameters. | |
| 508 | + */ | |
| 509 | + static Hashtable systemParam = new Hashtable(); | |
| 510 | + | |
| 511 | + static { | |
| 512 | + systemParam.put("codebase", "codebase"); | |
| 513 | + systemParam.put("code", "code"); | |
| 514 | + systemParam.put("alt", "alt"); | |
| 515 | + systemParam.put("width", "width"); | |
| 516 | + systemParam.put("height", "height"); | |
| 517 | + systemParam.put("align", "align"); | |
| 518 | + systemParam.put("vspace", "vspace"); | |
| 519 | + systemParam.put("hspace", "hspace"); | |
| 520 | + } | |
| 521 | + | |
| 522 | + /** | |
| 523 | + * Print the HTML tag. | |
| 524 | + */ | |
| 525 | + public static void printTag(PrintStream out, Hashtable atts) { | |
| 526 | + out.print("<applet"); | |
| 527 | + | |
| 528 | + String v = (String)atts.get("codebase"); | |
| 529 | + if (v != null) { | |
| 530 | + out.print(" codebase=\"" + v + "\""); | |
| 531 | + } | |
| 532 | + | |
| 533 | + v = (String)atts.get("code"); | |
| 534 | + if (v == null) { | |
| 535 | + v = "applet.class"; | |
| 536 | + } | |
| 537 | + out.print(" code=\"" + v + "\""); | |
| 538 | + v = (String)atts.get("width"); | |
| 539 | + if (v == null) { | |
| 540 | + v = "150"; | |
| 541 | + } | |
| 542 | + out.print(" width=" + v); | |
| 543 | + | |
| 544 | + v = (String)atts.get("height"); | |
| 545 | + if (v == null) { | |
| 546 | + v = "100"; | |
| 547 | + } | |
| 548 | + out.print(" height=" + v); | |
| 549 | + | |
| 550 | + v = (String)atts.get("name"); | |
| 551 | + if (v != null) { | |
| 552 | + out.print(" name=\"" + v + "\""); | |
| 553 | + } | |
| 554 | + out.println(">"); | |
| 555 | + | |
| 556 | + // A very slow sorting algorithm | |
| 557 | + int len = atts.size(); | |
| 558 | + String params[] = new String[len]; | |
| 559 | + len = 0; | |
| 560 | + for (Enumeration e = atts.keys() ; e.hasMoreElements() ;) { | |
| 561 | + String param = (String)e.nextElement(); | |
| 562 | + int i = 0; | |
| 563 | + for (; i < len ; i++) { | |
| 564 | + if (params[i].compareTo(param) >= 0) { | |
| 565 | + break; | |
| 566 | + } | |
| 567 | + } | |
| 568 | + System.arraycopy(params, i, params, i + 1, len - i); | |
| 569 | + params[i] = param; | |
| 570 | + len++; | |
| 571 | + } | |
| 572 | + | |
| 573 | + for (int i = 0 ; i < len ; i++) { | |
| 574 | + String param = params[i]; | |
| 575 | + if (systemParam.get(param) == null) { | |
| 576 | + out.println("<param name=" + param + | |
| 577 | + " value=\"" + atts.get(param) + "\">"); | |
| 578 | + } | |
| 579 | + } | |
| 580 | + out.println("</applet>"); | |
| 581 | + } | |
| 582 | + | |
| 583 | + /** | |
| 584 | + * Make sure the atrributes are uptodate. | |
| 585 | + */ | |
| 586 | + public void updateAtts() { | |
| 587 | + Dimension d = panel.size(); | |
| 588 | + Insets in = panel.insets(); | |
| 589 | + panel.atts.put("width", | |
| 590 | + Integer.toString(d.width - (in.left + in.right))); | |
| 591 | + panel.atts.put("height", | |
| 592 | + Integer.toString(d.height - (in.top + in.bottom))); | |
| 593 | + } | |
| 594 | + | |
| 595 | + /** | |
| 596 | + * Restart the applet. | |
| 597 | + */ | |
| 598 | + void appletRestart() { | |
| 599 | + panel.sendEvent(AppletPanel.APPLET_STOP); | |
| 600 | + panel.sendEvent(AppletPanel.APPLET_DESTROY); | |
| 601 | + panel.sendEvent(AppletPanel.APPLET_INIT); | |
| 602 | + panel.sendEvent(AppletPanel.APPLET_START); | |
| 603 | + } | |
| 604 | + | |
| 605 | + /** | |
| 606 | + * Reload the applet. | |
| 607 | + */ | |
| 608 | + void appletReload() { | |
| 609 | + panel.sendEvent(AppletPanel.APPLET_STOP); | |
| 610 | + panel.sendEvent(AppletPanel.APPLET_DESTROY); | |
| 611 | + panel.sendEvent(AppletPanel.APPLET_DISPOSE); | |
| 612 | + | |
| 613 | + /** | |
| 614 | + * Fixed #4501142: Classlaoder sharing policy doesn't | |
| 615 | + * take "archive" into account. This will be overridden | |
| 616 | + * by Java Plug-in. [stanleyh] | |
| 617 | + */ | |
| 618 | + AppletPanel.flushClassLoader(panel.getClassLoaderCacheKey()); | |
| 619 | + | |
| 620 | + /* | |
| 621 | + * Make sure we don't have two threads running through the event queue | |
| 622 | + * at the same time. | |
| 623 | + */ | |
| 624 | + try { | |
| 625 | + panel.joinAppletThread(); | |
| 626 | + panel.release(); | |
| 627 | + } catch (InterruptedException e) { | |
| 628 | + return; // abort the reload | |
| 629 | + } | |
| 630 | + | |
| 631 | + panel.createAppletThread(); | |
| 632 | + panel.sendEvent(AppletPanel.APPLET_LOAD); | |
| 633 | + panel.sendEvent(AppletPanel.APPLET_INIT); | |
| 634 | + panel.sendEvent(AppletPanel.APPLET_START); | |
| 635 | + } | |
| 636 | + | |
| 637 | + /** | |
| 638 | + * Save the applet to a well known file (for now) as a serialized object | |
| 639 | + */ | |
| 640 | + void appletSave() { | |
| 641 | + AccessController.doPrivileged(new PrivilegedAction() { | |
| 642 | + | |
| 643 | + public Object run() { | |
| 644 | + // XXX: this privileged block should be made smaller | |
| 645 | + // by initializing a private static variable with "user.dir" | |
| 646 | + | |
| 647 | + // Applet needs to be stopped for serialization to succeed. | |
| 648 | + // Since panel.sendEvent only queues the event, there is a | |
| 649 | + // chance that the event will not be processed before | |
| 650 | + // serialization begins. However, by sending the event before | |
| 651 | + // FileDialog is created, enough time is given such that this | |
| 652 | + // situation is unlikely to ever occur. | |
| 653 | + | |
| 654 | + panel.sendEvent(AppletPanel.APPLET_STOP); | |
| 655 | + FileDialog fd = new FileDialog(AppletViewer.this, | |
| 656 | + amh.getMessage("appletsave.filedialogtitle"), | |
| 657 | + FileDialog.SAVE); | |
| 658 | + // needed for a bug under Solaris... | |
| 659 | + fd.setDirectory(System.getProperty("user.dir")); | |
| 660 | + fd.setFile(defaultSaveFile); | |
| 661 | + fd.show(); | |
| 662 | + String fname = fd.getFile(); | |
| 663 | + if (fname == null) { | |
| 664 | + // Restart applet if Save is cancelled. | |
| 665 | + panel.sendEvent(AppletPanel.APPLET_START); | |
| 666 | + return null; // cancelled | |
| 667 | + } | |
| 668 | + String dname = fd.getDirectory(); | |
| 669 | + File file = new File(dname, fname); | |
| 670 | + | |
| 671 | + try { | |
| 672 | + BufferedOutputStream s = new BufferedOutputStream(new FileOutputStream(file)); | |
| 673 | + ObjectOutputStream os = new ObjectOutputStream(s); | |
| 674 | + showStatus(amh.getMessage("appletsave.err1", | |
| 675 | + panel.applet.toString(), file.toString())); | |
| 676 | + os.writeObject(panel.applet); | |
| 677 | + } catch (IOException ex) { | |
| 678 | + System.err.println(amh.getMessage("appletsave.err2", ex)); | |
| 679 | + } finally { | |
| 680 | + panel.sendEvent(AppletPanel.APPLET_START); | |
| 681 | + } | |
| 682 | + return null; | |
| 683 | + } | |
| 684 | + }); | |
| 685 | + } | |
| 686 | + | |
| 687 | + /** | |
| 688 | + * Clone the viewer and the applet. | |
| 689 | + */ | |
| 690 | + void appletClone() { | |
| 691 | + Point p = location(); | |
| 692 | + updateAtts(); | |
| 693 | + factory.createAppletViewer(p.x + XDELTA, p.y + YDELTA, | |
| 694 | + panel.documentURL, (Hashtable)panel.atts.clone()); | |
| 695 | + } | |
| 696 | + | |
| 697 | + /** | |
| 698 | + * Show the applet tag. | |
| 699 | + */ | |
| 700 | + void appletTag() { | |
| 701 | + ByteArrayOutputStream out = new ByteArrayOutputStream(); | |
| 702 | + updateAtts(); | |
| 703 | + printTag(new PrintStream(out), panel.atts); | |
| 704 | + showStatus(amh.getMessage("applettag")); | |
| 705 | + | |
| 706 | + Point p = location(); | |
| 707 | + new TextFrame(p.x + XDELTA, p.y + YDELTA, amh.getMessage("applettag.textframe"), out.toString()); | |
| 708 | + } | |
| 709 | + | |
| 710 | + /** | |
| 711 | + * Show the applet info. | |
| 712 | + */ | |
| 713 | + void appletInfo() { | |
| 714 | + String str = panel.applet.getAppletInfo(); | |
| 715 | + if (str == null) { | |
| 716 | + str = amh.getMessage("appletinfo.applet"); | |
| 717 | + } | |
| 718 | + str += "\n\n"; | |
| 719 | + | |
| 720 | + String atts[][] = panel.applet.getParameterInfo(); | |
| 721 | + if (atts != null) { | |
| 722 | + for (int i = 0 ; i < atts.length ; i++) { | |
| 723 | + str += atts[i][0] + " -- " + atts[i][1] + " -- " + atts[i][2] + "\n"; | |
| 724 | + } | |
| 725 | + } else { | |
| 726 | + str += amh.getMessage("appletinfo.param"); | |
| 727 | + } | |
| 728 | + | |
| 729 | + Point p = location(); | |
| 730 | + new TextFrame(p.x + XDELTA, p.y + YDELTA, amh.getMessage("appletinfo.textframe"), str); | |
| 731 | + | |
| 732 | + } | |
| 733 | + | |
| 734 | + /** | |
| 735 | + * Show character encoding type | |
| 736 | + */ | |
| 737 | + void appletCharacterEncoding() { | |
| 738 | + showStatus(amh.getMessage("appletencoding", encoding)); | |
| 739 | + } | |
| 740 | + | |
| 741 | + /** | |
| 742 | + * Edit the applet. | |
| 743 | + */ | |
| 744 | + void appletEdit() { | |
| 745 | + } | |
| 746 | + | |
| 747 | + /** | |
| 748 | + * Print the applet. | |
| 749 | + */ | |
| 750 | + void appletPrint() { | |
| 751 | + PrinterJob pj = PrinterJob.getPrinterJob(); | |
| 752 | + | |
| 753 | + if (pj != null) { | |
| 754 | + PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet(); | |
| 755 | + if (pj.printDialog(aset)) { | |
| 756 | + pj.setPrintable(this); | |
| 757 | + try { | |
| 758 | + pj.print(aset); | |
| 759 | + statusMsgStream.println(amh.getMessage("appletprint.finish")); | |
| 760 | + } catch (PrinterException e) { | |
| 761 | + statusMsgStream.println(amh.getMessage("appletprint.fail")); | |
| 762 | + } | |
| 763 | + } else { | |
| 764 | + statusMsgStream.println(amh.getMessage("appletprint.cancel")); | |
| 765 | + } | |
| 766 | + } else { | |
| 767 | + statusMsgStream.println(amh.getMessage("appletprint.fail")); | |
| 768 | + } | |
| 769 | + } | |
| 770 | + | |
| 771 | + public int print(Graphics graphics, PageFormat pf, int pageIndex) { | |
| 772 | + if (pageIndex > 0) { | |
| 773 | + return Printable.NO_SUCH_PAGE; | |
| 774 | + } else { | |
| 775 | + Graphics2D g2d = (Graphics2D)graphics; | |
| 776 | + g2d.translate(pf.getImageableX(), pf.getImageableY()); | |
| 777 | + panel.applet.printAll(graphics); | |
| 778 | + return Printable.PAGE_EXISTS; | |
| 779 | + } | |
| 780 | + } | |
| 781 | + | |
| 782 | + /** | |
| 783 | + * Properties. | |
| 784 | + */ | |
| 785 | + static AppletProps props; | |
| 786 | + public static synchronized void networkProperties() { | |
| 787 | + if (props == null) { | |
| 788 | + props = new AppletProps(); | |
| 789 | + } | |
| 790 | + props.addNotify(); | |
| 791 | + props.setVisible(true); | |
| 792 | + } | |
| 793 | + | |
| 794 | + /** | |
| 795 | + * Start the applet. | |
| 796 | + */ | |
| 797 | + void appletStart() { | |
| 798 | + panel.sendEvent(AppletPanel.APPLET_START); | |
| 799 | + } | |
| 800 | + | |
| 801 | + /** | |
| 802 | + * Stop the applet. | |
| 803 | + */ | |
| 804 | + void appletStop() { | |
| 805 | + panel.sendEvent(AppletPanel.APPLET_STOP); | |
| 806 | + } | |
| 807 | + | |
| 808 | + /** | |
| 809 | + * Shutdown a viewer. | |
| 810 | + * Stop, Destroy, Dispose and Quit a viewer | |
| 811 | + */ | |
| 812 | + private void appletShutdown(AppletPanel p) { | |
| 813 | + p.sendEvent(AppletPanel.APPLET_STOP); | |
| 814 | + p.sendEvent(AppletPanel.APPLET_DESTROY); | |
| 815 | + p.sendEvent(AppletPanel.APPLET_DISPOSE); | |
| 816 | + p.sendEvent(AppletPanel.APPLET_QUIT); | |
| 817 | + } | |
| 818 | + | |
| 819 | + /** | |
| 820 | + * Close this viewer. | |
| 821 | + * Stop, Destroy, Dispose and Quit an AppletView, then | |
| 822 | + * reclaim resources and exit the program if this is | |
| 823 | + * the last applet. | |
| 824 | + */ | |
| 825 | + void appletClose() { | |
| 826 | + | |
| 827 | + // The caller thread is event dispatch thread, so | |
| 828 | + // spawn a new thread to avoid blocking the event queue | |
| 829 | + // when calling appletShutdown. | |
| 830 | + // | |
| 831 | + final AppletPanel p = panel; | |
| 832 | + | |
| 833 | + new Thread(new Runnable() | |
| 834 | + { | |
| 835 | + public void run() | |
| 836 | + { | |
| 837 | + appletShutdown(p); | |
| 838 | + appletPanels.removeElement(p); | |
| 839 | + dispose(); | |
| 840 | + | |
| 841 | + if (countApplets() == 0) { | |
| 842 | + appletSystemExit(); | |
| 843 | + } | |
| 844 | + } | |
| 845 | + }).start(); | |
| 846 | + } | |
| 847 | + | |
| 848 | + /** | |
| 849 | + * Exit the program. | |
| 850 | + * Exit from the program (if not stand alone) - do no clean-up | |
| 851 | + */ | |
| 852 | + private void appletSystemExit() { | |
| 853 | + if (factory.isStandalone()) | |
| 854 | + System.exit(0); | |
| 855 | + } | |
| 856 | + | |
| 857 | + /** | |
| 858 | + * Quit all viewers. | |
| 859 | + * Shutdown all viewers properly then | |
| 860 | + * exit from the program (if not stand alone) | |
| 861 | + */ | |
| 862 | + protected void appletQuit() | |
| 863 | + { | |
| 864 | + // The caller thread is event dispatch thread, so | |
| 865 | + // spawn a new thread to avoid blocking the event queue | |
| 866 | + // when calling appletShutdown. | |
| 867 | + // | |
| 868 | + new Thread(new Runnable() | |
| 869 | + { | |
| 870 | + public void run() | |
| 871 | + { | |
| 872 | + for (Enumeration e = appletPanels.elements() ; e.hasMoreElements() ;) { | |
| 873 | + AppletPanel p = (AppletPanel)e.nextElement(); | |
| 874 | + appletShutdown(p); | |
| 875 | + } | |
| 876 | + appletSystemExit(); | |
| 877 | + } | |
| 878 | + }).start(); | |
| 879 | + } | |
| 880 | + | |
| 881 | + /** | |
| 882 | + * Handle events. | |
| 883 | + */ | |
| 884 | + public void processUserAction(ActionEvent evt) { | |
| 885 | + | |
| 886 | + String label = ((MenuItem)evt.getSource()).getLabel(); | |
| 887 | + | |
| 888 | + if (amh.getMessage("menuitem.restart").equals(label)) { | |
| 889 | + appletRestart(); | |
| 890 | + return; | |
| 891 | + } | |
| 892 | + | |
| 893 | + if (amh.getMessage("menuitem.reload").equals(label)) { | |
| 894 | + appletReload(); | |
| 895 | + return; | |
| 896 | + } | |
| 897 | + | |
| 898 | + if (amh.getMessage("menuitem.clone").equals(label)) { | |
| 899 | + appletClone(); | |
| 900 | + return; | |
| 901 | + } | |
| 902 | + | |
| 903 | + if (amh.getMessage("menuitem.stop").equals(label)) { | |
| 904 | + appletStop(); | |
| 905 | + return; | |
| 906 | + } | |
| 907 | + | |
| 908 | + if (amh.getMessage("menuitem.save").equals(label)) { | |
| 909 | + appletSave(); | |
| 910 | + return; | |
| 911 | + } | |
| 912 | + | |
| 913 | + if (amh.getMessage("menuitem.start").equals(label)) { | |
| 914 | + appletStart(); | |
| 915 | + return; | |
| 916 | + } | |
| 917 | + | |
| 918 | + if (amh.getMessage("menuitem.tag").equals(label)) { | |
| 919 | + appletTag(); | |
| 920 | + return; | |
| 921 | + } | |
| 922 | + | |
| 923 | + if (amh.getMessage("menuitem.info").equals(label)) { | |
| 924 | + appletInfo(); | |
| 925 | + return; | |
| 926 | + } | |
| 927 | + | |
| 928 | + if (amh.getMessage("menuitem.encoding").equals(label)) { | |
| 929 | + appletCharacterEncoding(); | |
| 930 | + return; | |
| 931 | + } | |
| 932 | + | |
| 933 | + if (amh.getMessage("menuitem.edit").equals(label)) { | |
| 934 | + appletEdit(); | |
| 935 | + return; | |
| 936 | + } | |
| 937 | + | |
| 938 | + if (amh.getMessage("menuitem.print").equals(label)) { | |
| 939 | + appletPrint(); | |
| 940 | + return; | |
| 941 | + } | |
| 942 | + | |
| 943 | + if (amh.getMessage("menuitem.props").equals(label)) { | |
| 944 | + networkProperties(); | |
| 945 | + return; | |
| 946 | + } | |
| 947 | + | |
| 948 | + if (amh.getMessage("menuitem.close").equals(label)) { | |
| 949 | + appletClose(); | |
| 950 | + return; | |
| 951 | + } | |
| 952 | + | |
| 953 | + if (factory.isStandalone() && amh.getMessage("menuitem.quit").equals(label)) { | |
| 954 | + appletQuit(); | |
| 955 | + return; | |
| 956 | + } | |
| 957 | + //statusMsgStream.println("evt = " + evt); | |
| 958 | + } | |
| 959 | + | |
| 960 | + /** | |
| 961 | + * How many applets are running? | |
| 962 | + */ | |
| 963 | + | |
| 964 | + public static int countApplets() { | |
| 965 | + return appletPanels.size(); | |
| 966 | + } | |
| 967 | + | |
| 968 | + | |
| 969 | + /** | |
| 970 | + * The current character. | |
| 971 | + */ | |
| 972 | + static int c; | |
| 973 | + | |
| 974 | + /** | |
| 975 | + * Scan spaces. | |
| 976 | + */ | |
| 977 | + public static void skipSpace(Reader in) throws IOException { | |
| 978 | + while ((c >= 0) && | |
| 979 | + ((c == ' ') || (c == '\t') || (c == '\n') || (c == '\r'))) { | |
| 980 | + c = in.read(); | |
| 981 | + } | |
| 982 | + } | |
| 983 | + | |
| 984 | + /** | |
| 985 | + * Scan identifier | |
| 986 | + */ | |
| 987 | + public static String scanIdentifier(Reader in) throws IOException { | |
| 988 | + StringBuffer buf = new StringBuffer(); | |
| 989 | + while (true) { | |
| 990 | + if (((c >= 'a') && (c <= 'z')) || | |
| 991 | + ((c >= 'A') && (c <= 'Z')) || | |
| 992 | + ((c >= '0') && (c <= '9')) || (c == '_')) { | |
| 993 | + buf.append((char)c); | |
| 994 | + c = in.read(); | |
| 995 | + } else { | |
| 996 | + return buf.toString(); | |
| 997 | + } | |
| 998 | + } | |
| 999 | + } | |
| 1000 | + | |
| 1001 | + /** | |
| 1002 | + * Scan tag | |
| 1003 | + */ | |
| 1004 | + public static Hashtable scanTag(Reader in) throws IOException { | |
| 1005 | + Hashtable atts = new Hashtable(); | |
| 1006 | + skipSpace(in); | |
| 1007 | + while (c >= 0 && c != '>') { | |
| 1008 | + String att = scanIdentifier(in); | |
| 1009 | + String val = ""; | |
| 1010 | + skipSpace(in); | |
| 1011 | + if (c == '=') { | |
| 1012 | + int quote = -1; | |
| 1013 | + c = in.read(); | |
| 1014 | + skipSpace(in); | |
| 1015 | + if ((c == '\'') || (c == '\"')) { | |
| 1016 | + quote = c; | |
| 1017 | + c = in.read(); | |
| 1018 | + } | |
| 1019 | + StringBuffer buf = new StringBuffer(); | |
| 1020 | + while ((c > 0) && | |
| 1021 | + (((quote < 0) && (c != ' ') && (c != '\t') && | |
| 1022 | + (c != '\n') && (c != '\r') && (c != '>')) | |
| 1023 | + || ((quote >= 0) && (c != quote)))) { | |
| 1024 | + buf.append((char)c); | |
| 1025 | + c = in.read(); | |
| 1026 | + } | |
| 1027 | + if (c == quote) { | |
| 1028 | + c = in.read(); | |
| 1029 | + } | |
| 1030 | + skipSpace(in); | |
| 1031 | + val = buf.toString(); | |
| 1032 | + } | |
| 1033 | + //statusMsgStream.println("PUT " + att + " = '" + val + "'"); | |
| 1034 | + if (! val.equals("")) { | |
| 1035 | + atts.put(att.toLowerCase(java.util.Locale.ENGLISH), val); | |
| 1036 | + } | |
| 1037 | + while (true) { | |
| 1038 | + if ((c == '>') || (c < 0) || | |
| 1039 | + ((c >= 'a') && (c <= 'z')) || | |
| 1040 | + ((c >= 'A') && (c <= 'Z')) || | |
| 1041 | + ((c >= '0') && (c <= '9')) || (c == '_')) | |
| 1042 | + break; | |
| 1043 | + c = in.read(); | |
| 1044 | + } | |
| 1045 | + //skipSpace(in); | |
| 1046 | + } | |
| 1047 | + return atts; | |
| 1048 | + } | |
| 1049 | + | |
| 1050 | + /* values used for placement of AppletViewer's frames */ | |
| 1051 | + private static int x = 0; | |
| 1052 | + private static int y = 0; | |
| 1053 | + private static final int XDELTA = 30; | |
| 1054 | + private static final int YDELTA = XDELTA; | |
| 1055 | + | |
| 1056 | + static String encoding = null; | |
| 1057 | + | |
| 1058 | + static private Reader makeReader(InputStream is) { | |
| 1059 | + if (encoding != null) { | |
| 1060 | + try { | |
| 1061 | + return new BufferedReader(new InputStreamReader(is, encoding)); | |
| 1062 | + } catch (IOException x) { } | |
| 1063 | + } | |
| 1064 | + InputStreamReader r = new InputStreamReader(is); | |
| 1065 | + encoding = r.getEncoding(); | |
| 1066 | + return new BufferedReader(r); | |
| 1067 | + } | |
| 1068 | + | |
| 1069 | + /** | |
| 1070 | + * Scan an html file for <applet> tags | |
| 1071 | + */ | |
| 1072 | + public static void parse(URL url, String enc) throws IOException { | |
| 1073 | + encoding = enc; | |
| 1074 | + parse(url, System.out, new StdAppletViewerFactory()); | |
| 1075 | + } | |
| 1076 | + | |
| 1077 | + public static void parse(URL url) throws IOException { | |
| 1078 | + parse(url, System.out, new StdAppletViewerFactory()); | |
| 1079 | + } | |
| 1080 | + | |
| 1081 | + public static void parse(URL url, PrintStream statusMsgStream, | |
| 1082 | + AppletViewerFactory factory) throws IOException { | |
| 1083 | + // <OBJECT> <EMBED> tag flags | |
| 1084 | + boolean isAppletTag = false; | |
| 1085 | + boolean isObjectTag = false; | |
| 1086 | + boolean isEmbedTag = false; | |
| 1087 | + | |
| 1088 | + // warning messages | |
| 1089 | + String requiresNameWarning = amh.getMessage("parse.warning.requiresname"); | |
| 1090 | + String paramOutsideWarning = amh.getMessage("parse.warning.paramoutside"); | |
| 1091 | + String appletRequiresCodeWarning = amh.getMessage("parse.warning.applet.requirescode"); | |
| 1092 | + String appletRequiresHeightWarning = amh.getMessage("parse.warning.applet.requiresheight"); | |
| 1093 | + String appletRequiresWidthWarning = amh.getMessage("parse.warning.applet.requireswidth"); | |
| 1094 | + String objectRequiresCodeWarning = amh.getMessage("parse.warning.object.requirescode"); | |
| 1095 | + String objectRequiresHeightWarning = amh.getMessage("parse.warning.object.requiresheight"); | |
| 1096 | + String objectRequiresWidthWarning = amh.getMessage("parse.warning.object.requireswidth"); | |
| 1097 | + String embedRequiresCodeWarning = amh.getMessage("parse.warning.embed.requirescode"); | |
| 1098 | + String embedRequiresHeightWarning = amh.getMessage("parse.warning.embed.requiresheight"); | |
| 1099 | + String embedRequiresWidthWarning = amh.getMessage("parse.warning.embed.requireswidth"); | |
| 1100 | + String appNotLongerSupportedWarning = amh.getMessage("parse.warning.appnotLongersupported"); | |
| 1101 | + | |
| 1102 | + java.net.URLConnection conn = url.openConnection(); | |
| 1103 | + Reader in = makeReader(conn.getInputStream()); | |
| 1104 | + /* The original URL may have been redirected - this | |
| 1105 | + * sets it to whatever URL/codebase we ended up getting | |
| 1106 | + */ | |
| 1107 | + url = conn.getURL(); | |
| 1108 | + | |
| 1109 | + int ydisp = 1; | |
| 1110 | + Hashtable atts = null; | |
| 1111 | + | |
| 1112 | + while(true) { | |
| 1113 | + c = in.read(); | |
| 1114 | + if (c == -1) | |
| 1115 | + break; | |
| 1116 | + | |
| 1117 | + if (c == '<') { | |
| 1118 | + c = in.read(); | |
| 1119 | + if (c == '/') { | |
| 1120 | + c = in.read(); | |
| 1121 | + String nm = scanIdentifier(in); | |
| 1122 | + if (nm.equalsIgnoreCase("applet") || | |
| 1123 | + nm.equalsIgnoreCase("object") || | |
| 1124 | + nm.equalsIgnoreCase("embed")) { | |
| 1125 | + | |
| 1126 | + // We can't test for a code tag until </OBJECT> | |
| 1127 | + // because it is a parameter, not an attribute. | |
| 1128 | + if(isObjectTag) { | |
| 1129 | + if (atts.get("code") == null && atts.get("object") == null) { | |
| 1130 | + statusMsgStream.println(objectRequiresCodeWarning); | |
| 1131 | + atts = null; | |
| 1132 | + } | |
| 1133 | + } | |
| 1134 | + | |
| 1135 | + if (atts != null) { | |
| 1136 | + // XXX 5/18 In general this code just simply | |
| 1137 | + // shouldn't be part of parsing. It's presence | |
| 1138 | + // causes things to be a little too much of a | |
| 1139 | + // hack. | |
| 1140 | + factory.createAppletViewer(x, y, url, atts); | |
| 1141 | + x += XDELTA; | |
| 1142 | + y += YDELTA; | |
| 1143 | + // make sure we don't go too far! | |
| 1144 | + Dimension d = Toolkit.getDefaultToolkit().getScreenSize(); | |
| 1145 | + if ((x > d.width - 300) || (y > d.height - 300)) { | |
| 1146 | + x = 0; | |
| 1147 | + y = 2 * ydisp * YDELTA; | |
| 1148 | + ydisp++; | |
| 1149 | + } | |
| 1150 | + } | |
| 1151 | + atts = null; | |
| 1152 | + isAppletTag = false; | |
| 1153 | + isObjectTag = false; | |
| 1154 | + isEmbedTag = false; | |
| 1155 | + } | |
| 1156 | + } | |
| 1157 | + else { | |
| 1158 | + String nm = scanIdentifier(in); | |
| 1159 | + if (nm.equalsIgnoreCase("param")) { | |
| 1160 | + Hashtable t = scanTag(in); | |
| 1161 | + String att = (String)t.get("name"); | |
| 1162 | + if (att == null) { | |
| 1163 | + statusMsgStream.println(requiresNameWarning); | |
| 1164 | + } else { | |
| 1165 | + String val = (String)t.get("value"); | |
| 1166 | + if (val == null) { | |
| 1167 | + statusMsgStream.println(requiresNameWarning); | |
| 1168 | + } else if (atts != null) { | |
| 1169 | + atts.put(att.toLowerCase(), val); | |
| 1170 | + } else { | |
| 1171 | + statusMsgStream.println(paramOutsideWarning); | |
| 1172 | + } | |
| 1173 | + } | |
| 1174 | + } | |
| 1175 | + else if (nm.equalsIgnoreCase("applet")) { | |
| 1176 | + isAppletTag = true; | |
| 1177 | + atts = scanTag(in); | |
| 1178 | + if (atts.get("code") == null && atts.get("object") == null) { | |
| 1179 | + statusMsgStream.println(appletRequiresCodeWarning); | |
| 1180 | + atts = null; | |
| 1181 | + } else if (atts.get("width") == null) { | |
| 1182 | + statusMsgStream.println(appletRequiresWidthWarning); | |
| 1183 | + atts = null; | |
| 1184 | + } else if (atts.get("height") == null) { | |
| 1185 | + statusMsgStream.println(appletRequiresHeightWarning); | |
| 1186 | + atts = null; | |
| 1187 | + } | |
| 1188 | + } | |
| 1189 | + else if (nm.equalsIgnoreCase("object")) { | |
| 1190 | + isObjectTag = true; | |
| 1191 | + atts = scanTag(in); | |
| 1192 | + // The <OBJECT> attribute codebase isn't what | |
| 1193 | + // we want. If its defined, remove it. | |
| 1194 | + if(atts.get("codebase") != null) { | |
| 1195 | + atts.remove("codebase"); | |
| 1196 | + } | |
| 1197 | + | |
| 1198 | + if (atts.get("width") == null) { | |
| 1199 | + statusMsgStream.println(objectRequiresWidthWarning); | |
| 1200 | + atts = null; | |
| 1201 | + } else if (atts.get("height") == null) { | |
| 1202 | + statusMsgStream.println(objectRequiresHeightWarning); | |
| 1203 | + atts = null; | |
| 1204 | + } | |
| 1205 | + } | |
| 1206 | + else if (nm.equalsIgnoreCase("embed")) { | |
| 1207 | + isEmbedTag = true; | |
| 1208 | + atts = scanTag(in); | |
| 1209 | + | |
| 1210 | + if (atts.get("code") == null && atts.get("object") == null) { | |
| 1211 | + statusMsgStream.println(embedRequiresCodeWarning); | |
| 1212 | + atts = null; | |
| 1213 | + } else if (atts.get("width") == null) { | |
| 1214 | + statusMsgStream.println(embedRequiresWidthWarning); | |
| 1215 | + atts = null; | |
| 1216 | + } else if (atts.get("height") == null) { | |
| 1217 | + statusMsgStream.println(embedRequiresHeightWarning); | |
| 1218 | + atts = null; | |
| 1219 | + } | |
| 1220 | + } | |
| 1221 | + else if (nm.equalsIgnoreCase("app")) { | |
| 1222 | + statusMsgStream.println(appNotLongerSupportedWarning); | |
| 1223 | + Hashtable atts2 = scanTag(in); | |
| 1224 | + nm = (String)atts2.get("class"); | |
| 1225 | + if (nm != null) { | |
| 1226 | + atts2.remove("class"); | |
| 1227 | + atts2.put("code", nm + ".class"); | |
| 1228 | + } | |
| 1229 | + nm = (String)atts2.get("src"); | |
| 1230 | + if (nm != null) { | |
| 1231 | + atts2.remove("src"); | |
| 1232 | + atts2.put("codebase", nm); | |
| 1233 | + } | |
| 1234 | + if (atts2.get("width") == null) { | |
| 1235 | + atts2.put("width", "100"); | |
| 1236 | + } | |
| 1237 | + if (atts2.get("height") == null) { | |
| 1238 | + atts2.put("height", "100"); | |
| 1239 | + } | |
| 1240 | + printTag(statusMsgStream, atts2); | |
| 1241 | + statusMsgStream.println(); | |
| 1242 | + } | |
| 1243 | + } | |
| 1244 | + } | |
| 1245 | + } | |
| 1246 | + in.close(); | |
| 1247 | + } | |
| 1248 | + | |
| 1249 | + /** | |
| 1250 | + * Old main entry point. | |
| 1251 | + * | |
| 1252 | + * @deprecated | |
| 1253 | + */ | |
| 1254 | + @Deprecated | |
| 1255 | + public static void main(String argv[]) { | |
| 1256 | + // re-route everything to the new main entry point | |
| 1257 | + Main.main(argv); | |
| 1258 | + } | |
| 1259 | + | |
| 1260 | + private static AppletMessageHandler amh = new AppletMessageHandler("appletviewer"); | |
| 1261 | + | |
| 1262 | + private static void checkConnect(URL url) | |
| 1263 | + { | |
| 1264 | + SecurityManager security = System.getSecurityManager(); | |
| 1265 | + if (security != null) { | |
| 1266 | + try { | |
| 1267 | + java.security.Permission perm = | |
| 1268 | + url.openConnection().getPermission(); | |
| 1269 | + if (perm != null) | |
| 1270 | + security.checkPermission(perm); | |
| 1271 | + else | |
| 1272 | + security.checkConnect(url.getHost(), url.getPort()); | |
| 1273 | + } catch (java.io.IOException ioe) { | |
| 1274 | + security.checkConnect(url.getHost(), url.getPort()); | |
| 1275 | + } | |
| 1276 | + } | |
| 1277 | + } | |
| 1278 | +} | |
| @@ -0,0 +1,41 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1996, 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 | +/* | |
| 27 | + * AppletViewerFactory.java | |
| 28 | + */ | |
| 29 | + | |
| 30 | +package sun.applet; | |
| 31 | + | |
| 32 | +import java.util.Hashtable; | |
| 33 | +import java.net.URL; | |
| 34 | +import java.awt.MenuBar; | |
| 35 | + | |
| 36 | +public | |
| 37 | +interface AppletViewerFactory { | |
| 38 | + public AppletViewer createAppletViewer(int x, int y, URL doc, Hashtable atts); | |
| 39 | + public MenuBar getBaseMenuBar(); | |
| 40 | + public boolean isStandalone(); | |
| 41 | +} | |
| @@ -0,0 +1,216 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1995, 2005, 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 | +package sun.applet; | |
| 27 | + | |
| 28 | +import java.util.*; | |
| 29 | +import java.io.*; | |
| 30 | +import java.net.URL; | |
| 31 | +import java.net.MalformedURLException; | |
| 32 | +import java.awt.*; | |
| 33 | +import java.applet.*; | |
| 34 | +import sun.tools.jar.*; | |
| 35 | + | |
| 36 | + | |
| 37 | +/** | |
| 38 | + * Sample applet panel class. The panel manages and manipulates the | |
| 39 | + * applet as it is being loaded. It forks a seperate thread in a new | |
| 40 | + * thread group to call the applet's init(), start(), stop(), and | |
| 41 | + * destroy() methods. | |
| 42 | + * | |
| 43 | + * @author Arthur van Hoff | |
| 44 | + */ | |
| 45 | +class AppletViewerPanel extends AppletPanel { | |
| 46 | + | |
| 47 | + /* Are we debugging? */ | |
| 48 | + static boolean debug = false; | |
| 49 | + | |
| 50 | + /** | |
| 51 | + * The document url. | |
| 52 | + */ | |
| 53 | + URL documentURL; | |
| 54 | + | |
| 55 | + /** | |
| 56 | + * The base url. | |
| 57 | + */ | |
| 58 | + URL baseURL; | |
| 59 | + | |
| 60 | + /** | |
| 61 | + * The attributes of the applet. | |
| 62 | + */ | |
| 63 | + Hashtable atts; | |
| 64 | + | |
| 65 | + /* | |
| 66 | + * JDK 1.1 serialVersionUID | |
| 67 | + */ | |
| 68 | + private static final long serialVersionUID = 8890989370785545619L; | |
| 69 | + | |
| 70 | + /** | |
| 71 | + * Construct an applet viewer and start the applet. | |
| 72 | + */ | |
| 73 | + AppletViewerPanel(URL documentURL, Hashtable atts) { | |
| 74 | + this.documentURL = documentURL; | |
| 75 | + this.atts = atts; | |
| 76 | + | |
| 77 | + String att = getParameter("codebase"); | |
| 78 | + if (att != null) { | |
| 79 | + if (!att.endsWith("/")) { | |
| 80 | + att += "/"; | |
| 81 | + } | |
| 82 | + try { | |
| 83 | + baseURL = new URL(documentURL, att); | |
| 84 | + } catch (MalformedURLException e) { | |
| 85 | + } | |
| 86 | + } | |
| 87 | + if (baseURL == null) { | |
| 88 | + String file = documentURL.getFile(); | |
| 89 | + int i = file.lastIndexOf('/'); | |
| 90 | + if (i >= 0 && i < file.length() - 1) { | |
| 91 | + try { | |
| 92 | + baseURL = new URL(documentURL, file.substring(0, i + 1)); | |
| 93 | + } catch (MalformedURLException e) { | |
| 94 | + } | |
| 95 | + } | |
| 96 | + } | |
| 97 | + | |
| 98 | + // when all is said & done, baseURL shouldn't be null | |
| 99 | + if (baseURL == null) | |
| 100 | + baseURL = documentURL; | |
| 101 | + | |
| 102 | + | |
| 103 | + } | |
| 104 | + | |
| 105 | + /** | |
| 106 | + * Get an applet parameter. | |
| 107 | + */ | |
| 108 | + public String getParameter(String name) { | |
| 109 | + return (String)atts.get(name.toLowerCase()); | |
| 110 | + } | |
| 111 | + | |
| 112 | + /** | |
| 113 | + * Get the document url. | |
| 114 | + */ | |
| 115 | + public URL getDocumentBase() { | |
| 116 | + return documentURL; | |
| 117 | + | |
| 118 | + } | |
| 119 | + | |
| 120 | + /** | |
| 121 | + * Get the base url. | |
| 122 | + */ | |
| 123 | + public URL getCodeBase() { | |
| 124 | + return baseURL; | |
| 125 | + } | |
| 126 | + | |
| 127 | + /** | |
| 128 | + * Get the width. | |
| 129 | + */ | |
| 130 | + public int getWidth() { | |
| 131 | + String w = getParameter("width"); | |
| 132 | + if (w != null) { | |
| 133 | + return Integer.valueOf(w).intValue(); | |
| 134 | + } | |
| 135 | + return 0; | |
| 136 | + } | |
| 137 | + | |
| 138 | + | |
| 139 | + /** | |
| 140 | + * Get the height. | |
| 141 | + */ | |
| 142 | + public int getHeight() { | |
| 143 | + String h = getParameter("height"); | |
| 144 | + if (h != null) { | |
| 145 | + return Integer.valueOf(h).intValue(); | |
| 146 | + } | |
| 147 | + return 0; | |
| 148 | + } | |
| 149 | + | |
| 150 | + /** | |
| 151 | + * Get initial_focus | |
| 152 | + */ | |
| 153 | + public boolean hasInitialFocus() | |
| 154 | + { | |
| 155 | + | |
| 156 | + // 6234219: Do not set initial focus on an applet | |
| 157 | + // during startup if applet is targeted for | |
| 158 | + // JDK 1.1/1.2. [stanley.ho] | |
| 159 | + if (isJDK11Applet() || isJDK12Applet()) | |
| 160 | + return false; | |
| 161 | + | |
| 162 | + String initialFocus = getParameter("initial_focus"); | |
| 163 | + | |
| 164 | + if (initialFocus != null) | |
| 165 | + { | |
| 166 | + if (initialFocus.toLowerCase().equals("false")) | |
| 167 | + return false; | |
| 168 | + } | |
| 169 | + | |
| 170 | + return true; | |
| 171 | + } | |
| 172 | + | |
| 173 | + /** | |
| 174 | + * Get the code parameter | |
| 175 | + */ | |
| 176 | + public String getCode() { | |
| 177 | + return getParameter("code"); | |
| 178 | + } | |
| 179 | + | |
| 180 | + | |
| 181 | + /** | |
| 182 | + * Return the list of jar files if specified. | |
| 183 | + * Otherwise return null. | |
| 184 | + */ | |
| 185 | + public String getJarFiles() { | |
| 186 | + return getParameter("archive"); | |
| 187 | + } | |
| 188 | + | |
| 189 | + /** | |
| 190 | + * Return the value of the object param | |
| 191 | + */ | |
| 192 | + public String getSerializedObject() { | |
| 193 | + return getParameter("object");// another name? | |
| 194 | + } | |
| 195 | + | |
| 196 | + | |
| 197 | + /** | |
| 198 | + * Get the applet context. For now this is | |
| 199 | + * also implemented by the AppletPanel class. | |
| 200 | + */ | |
| 201 | + public AppletContext getAppletContext() { | |
| 202 | + return (AppletContext)getParent(); | |
| 203 | + } | |
| 204 | + | |
| 205 | + static void debug(String s) { | |
| 206 | + if(debug) | |
| 207 | + System.err.println("AppletViewerPanel:::" + s); | |
| 208 | + } | |
| 209 | + | |
| 210 | + static void debug(String s, Throwable t) { | |
| 211 | + if(debug) { | |
| 212 | + t.printStackTrace(); | |
| 213 | + debug(s); | |
| 214 | + } | |
| 215 | + } | |
| 216 | +} | |
| @@ -0,0 +1,533 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1999, 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 | + */ | |
| 25 | + | |
| 26 | +package sun.applet; | |
| 27 | + | |
| 28 | +import java.io.BufferedInputStream; | |
| 29 | +import java.io.File; | |
| 30 | +import java.io.FileInputStream; | |
| 31 | +import java.io.FileOutputStream; | |
| 32 | +import java.io.IOException; | |
| 33 | +import java.lang.reflect.Method; | |
| 34 | +import java.lang.reflect.InvocationTargetException; | |
| 35 | +import java.net.URL; | |
| 36 | +import java.net.MalformedURLException; | |
| 37 | +import java.util.Enumeration; | |
| 38 | +import java.util.Properties; | |
| 39 | +import java.util.Vector; | |
| 40 | +import sun.net.www.ParseUtil; | |
| 41 | + | |
| 42 | +/** | |
| 43 | + * The main entry point into AppletViewer. | |
| 44 | + */ | |
| 45 | +public class Main { | |
| 46 | + /** | |
| 47 | + * The file which contains all of the AppletViewer specific properties. | |
| 48 | + */ | |
| 49 | + static File theUserPropertiesFile; | |
| 50 | + | |
| 51 | + /** | |
| 52 | + * The default key/value pairs for the required user-specific properties. | |
| 53 | + */ | |
| 54 | + static final String [][] avDefaultUserProps = { | |
| 55 | + // There's a bootstrapping problem here. If we don't have a proxyHost, | |
| 56 | + // then we will not be able to connect to a URL outside the firewall; | |
| 57 | + // however, there's no way for us to set the proxyHost without starting | |
| 58 | + // AppletViewer. This problem existed before the re-write. | |
| 59 | + {"http.proxyHost", ""}, | |
| 60 | + {"http.proxyPort", "80"}, | |
| 61 | + {"package.restrict.access.sun", "true"} | |
| 62 | + }; | |
| 63 | + | |
| 64 | + static { | |
| 65 | + File userHome = new File(System.getProperty("user.home")); | |
| 66 | + // make sure we can write to this location | |
| 67 | + userHome.canWrite(); | |
| 68 | + | |
| 69 | + theUserPropertiesFile = new File(userHome, ".appletviewer"); | |
| 70 | + } | |
| 71 | + | |
| 72 | + // i18n | |
| 73 | + private static AppletMessageHandler amh = new AppletMessageHandler("appletviewer"); | |
| 74 | + | |
| 75 | + /** | |
| 76 | + * Member variables set according to options passed in to AppletViewer. | |
| 77 | + */ | |
| 78 | + private boolean debugFlag = false; | |
| 79 | + private boolean helpFlag = false; | |
| 80 | + private String encoding = null; | |
| 81 | + private boolean noSecurityFlag = false; | |
| 82 | + private static boolean cmdLineTestFlag = false; | |
| 83 | + | |
| 84 | + /** | |
| 85 | + * The list of valid URLs passed in to AppletViewer. | |
| 86 | + */ | |
| 87 | + private static Vector urlList = new Vector(1); | |
| 88 | + | |
| 89 | + // This is used in init(). Getting rid of this is desirable but depends | |
| 90 | + // on whether the property that uses it is necessary/standard. | |
| 91 | + public static final String theVersion = System.getProperty("java.version"); | |
| 92 | + | |
| 93 | + /** | |
| 94 | + * The main entry point into AppletViewer. | |
| 95 | + */ | |
| 96 | + public static void main(String [] args) { | |
| 97 | + Main m = new Main(); | |
| 98 | + int ret = m.run(args); | |
| 99 | + | |
| 100 | + // Exit immediately if we got some sort of error along the way. | |
| 101 | + // For debugging purposes, if we have passed in "-XcmdLineTest" we | |
| 102 | + // force a premature exit. | |
| 103 | + if ((ret != 0) || (cmdLineTestFlag)) | |
| 104 | + System.exit(ret); | |
| 105 | + } | |
| 106 | + | |
| 107 | + private int run(String [] args) { | |
| 108 | + // DECODE ARGS | |
| 109 | + try { | |
| 110 | + if (args.length == 0) { | |
| 111 | + usage(); | |
| 112 | + return 0; | |
| 113 | + } | |
| 114 | + for (int i = 0; i < args.length; ) { | |
| 115 | + int j = decodeArg(args, i); | |
| 116 | + if (j == 0) { | |
| 117 | + throw new ParseException(lookup("main.err.unrecognizedarg", | |
| 118 | + args[i])); | |
| 119 | + } | |
| 120 | + i += j; | |
| 121 | + } | |
| 122 | + } catch (ParseException e) { | |
| 123 | + System.err.println(e.getMessage()); | |
| 124 | + return 1; | |
| 125 | + } | |
| 126 | + | |
| 127 | + // CHECK ARGUMENTS | |
| 128 | + if (helpFlag) { | |
| 129 | + usage(); | |
| 130 | + return 0; | |
| 131 | + } | |
| 132 | + | |
| 133 | + if (urlList.size() == 0) { | |
| 134 | + System.err.println(lookup("main.err.inputfile")); | |
| 135 | + return 1; | |
| 136 | + } | |
| 137 | + | |
| 138 | + if (debugFlag) { | |
| 139 | + // START A DEBUG SESSION | |
| 140 | + // Given the current architecture, we will end up decoding the | |
| 141 | + // arguments again, but at least we are guaranteed to have | |
| 142 | + // arguments which are valid. | |
| 143 | + return invokeDebugger(args); | |
| 144 | + } | |
| 145 | + | |
| 146 | + // INSTALL THE SECURITY MANAGER (if necessary) | |
| 147 | + if (!noSecurityFlag && (System.getSecurityManager() == null)) | |
| 148 | + init(); | |
| 149 | + | |
| 150 | + // LAUNCH APPLETVIEWER FOR EACH URL | |
| 151 | + for (int i = 0; i < urlList.size(); i++) { | |
| 152 | + try { | |
| 153 | + // XXX 5/17 this parsing method should be changed/fixed so that | |
| 154 | + // it doesn't do both parsing of the html file and launching of | |
| 155 | + // the AppletPanel | |
| 156 | + AppletViewer.parse((URL) urlList.elementAt(i), encoding); | |
| 157 | + } catch (IOException e) { | |
| 158 | + System.err.println(lookup("main.err.io", e.getMessage())); | |
| 159 | + return 1; | |
| 160 | + } | |
| 161 | + } | |
| 162 | + return 0; | |
| 163 | + } | |
| 164 | + | |
| 165 | + private static void usage() { | |
| 166 | + System.out.println(lookup("usage")); | |
| 167 | + } | |
| 168 | + | |
| 169 | + /** | |
| 170 | + * Decode a single argument in an array and return the number of elements | |
| 171 | + * used. | |
| 172 | + * | |
| 173 | + * @param args The array of arguments. | |
| 174 | + * @param i The argument to decode. | |
| 175 | + * @return The number of array elements used when the argument was | |
| 176 | + * decoded. | |
| 177 | + * @exception ParseException | |
| 178 | + * Thrown when there is a problem with something in the | |
| 179 | + * argument array. | |
| 180 | + */ | |
| 181 | + private int decodeArg(String [] args, int i) throws ParseException { | |
| 182 | + String arg = args[i]; | |
| 183 | + int argc = args.length; | |
| 184 | + | |
| 185 | + if ("-help".equalsIgnoreCase(arg) || "-?".equals(arg)) { | |
| 186 | + helpFlag = true; | |
| 187 | + return 1; | |
| 188 | + } else if ("-encoding".equals(arg) && (i < argc - 1)) { | |
| 189 | + if (encoding != null) | |
| 190 | + throw new ParseException(lookup("main.err.dupoption", arg)); | |
| 191 | + encoding = args[++i]; | |
| 192 | + return 2; | |
| 193 | + } else if ("-debug".equals(arg)) { | |
| 194 | + debugFlag = true; | |
| 195 | + return 1; | |
| 196 | + } else if ("-Xnosecurity".equals(arg)) { | |
| 197 | + // This is an undocumented (and, in the future, unsupported) | |
| 198 | + // flag which prevents AppletViewer from installing its own | |
| 199 | + // SecurityManager. | |
| 200 | + | |
| 201 | + System.err.println(); | |
| 202 | + System.err.println(lookup("main.warn.nosecmgr")); | |
| 203 | + System.err.println(); | |
| 204 | + | |
| 205 | + noSecurityFlag = true; | |
| 206 | + return 1; | |
| 207 | + } else if ("-XcmdLineTest".equals(arg)) { | |
| 208 | + // This is an internal flag which should be used for command-line | |
| 209 | + // testing. It instructs AppletViewer to force a premature exit | |
| 210 | + // immediately after the applet has been launched. | |
| 211 | + cmdLineTestFlag = true; | |
| 212 | + return 1; | |
| 213 | + } else if (arg.startsWith("-")) { | |
| 214 | + throw new ParseException(lookup("main.err.unsupportedopt", arg)); | |
| 215 | + } else { | |
| 216 | + // we found what we hope is a url | |
| 217 | + URL url = parseURL(arg); | |
| 218 | + if (url != null) { | |
| 219 | + urlList.addElement(url); | |
| 220 | + return 1; | |
| 221 | + } | |
| 222 | + } | |
| 223 | + return 0; | |
| 224 | + } | |
| 225 | + | |
| 226 | + /** | |
| 227 | + * Following the relevant RFC, construct a valid URL based on the passed in | |
| 228 | + * string. | |
| 229 | + * | |
| 230 | + * @param url a string which represents either a relative or absolute URL. | |
| 231 | + * @return a URL when the passed in string can be interpreted according | |
| 232 | + * to the RFC, <code>null</code> otherwise. | |
| 233 | + * @exception ParseException | |
| 234 | + * Thrown when we are unable to construct a proper URL from the | |
| 235 | + * passed in string. | |
| 236 | + */ | |
| 237 | + private URL parseURL(String url) throws ParseException { | |
| 238 | + URL u = null; | |
| 239 | + // prefix of the urls with 'file' scheme | |
| 240 | + String prefix = "file:"; | |
| 241 | + | |
| 242 | + try { | |
| 243 | + if (url.indexOf(':') <= 1) | |
| 244 | + { | |
| 245 | + // appletviewer accepts only unencoded filesystem paths | |
| 246 | + u = ParseUtil.fileToEncodedURL(new File(url)); | |
| 247 | + } else if (url.startsWith(prefix) && | |
| 248 | + url.length() != prefix.length() && | |
| 249 | + !(new File(url.substring(prefix.length())).isAbsolute())) | |
| 250 | + { | |
| 251 | + // relative file URL, like this "file:index.html" | |
| 252 | + // ensure that this file URL is absolute | |
| 253 | + // ParseUtil.fileToEncodedURL should be done last (see 6329251) | |
| 254 | + String path = ParseUtil.fileToEncodedURL(new File(System.getProperty("user.dir"))).getPath() + | |
| 255 | + url.substring(prefix.length()); | |
| 256 | + u = new URL("file", "", path); | |
| 257 | + } else { | |
| 258 | + // appletviewer accepts only encoded urls | |
| 259 | + u = new URL(url); | |
| 260 | + } | |
| 261 | + } catch (MalformedURLException e) { | |
| 262 | + throw new ParseException(lookup("main.err.badurl", | |
| 263 | + url, e.getMessage())); | |
| 264 | + } | |
| 265 | + | |
| 266 | + return u; | |
| 267 | + } | |
| 268 | + | |
| 269 | + /** | |
| 270 | + * Invoke the debugger with the arguments passed in to appletviewer. | |
| 271 | + * | |
| 272 | + * @param args The arguments passed into the debugger. | |
| 273 | + * @return <code>0</code> if the debugger is invoked successfully, | |
| 274 | + * <code>1</code> otherwise. | |
| 275 | + */ | |
| 276 | + private int invokeDebugger(String [] args) { | |
| 277 | + // CONSTRUCT THE COMMAND LINE | |
| 278 | + String [] newArgs = new String[args.length + 1]; | |
| 279 | + int current = 0; | |
| 280 | + | |
| 281 | + // Add a -classpath argument that prevents | |
| 282 | + // the debugger from launching appletviewer with the default of | |
| 283 | + // ".". appletviewer's classpath should never contain valid | |
| 284 | + // classes since they will result in security exceptions. | |
| 285 | + // Ideally, the classpath should be set to "", but the VM won't | |
| 286 | + // allow an empty classpath, so a phony directory name is used. | |
| 287 | + String phonyDir = System.getProperty("java.home") + | |
| 288 | + File.separator + "phony"; | |
| 289 | + newArgs[current++] = "-Djava.class.path=" + phonyDir; | |
| 290 | + | |
| 291 | + // Appletviewer's main class is the debuggee | |
| 292 | + newArgs[current++] = "sun.applet.Main"; | |
| 293 | + | |
| 294 | + // Append all the of the original appletviewer arguments, | |
| 295 | + // leaving out the "-debug" option. | |
| 296 | + for (int i = 0; i < args.length; i++) { | |
| 297 | + if (!("-debug".equals(args[i]))) { | |
| 298 | + newArgs[current++] = args[i]; | |
| 299 | + } | |
| 300 | + } | |
| 301 | + | |
| 302 | + // LAUNCH THE DEBUGGER | |
| 303 | + // Reflection is used for two reasons: | |
| 304 | + // 1) The debugger classes are on classpath and thus must be loaded | |
| 305 | + // by the application class loader. (Currently, appletviewer are | |
| 306 | + // loaded through the boot class path out of rt.jar.) | |
| 307 | + // 2) Reflection removes any build dependency between appletviewer | |
| 308 | + // and jdb. | |
| 309 | + try { | |
| 310 | + Class c = Class.forName("com.sun.tools.example.debug.tty.TTY", true, | |
| 311 | + ClassLoader.getSystemClassLoader()); | |
| 312 | + Method m = c.getDeclaredMethod("main", | |
| 313 | + new Class[] { String[].class }); | |
| 314 | + m.invoke(null, new Object[] { newArgs }); | |
| 315 | + } catch (ClassNotFoundException cnfe) { | |
| 316 | + System.err.println(lookup("main.debug.cantfinddebug")); | |
| 317 | + return 1; | |
| 318 | + } catch (NoSuchMethodException nsme) { | |
| 319 | + System.err.println(lookup("main.debug.cantfindmain")); | |
| 320 | + return 1; | |
| 321 | + } catch (InvocationTargetException ite) { | |
| 322 | + System.err.println(lookup("main.debug.exceptionindebug")); | |
| 323 | + return 1; | |
| 324 | + } catch (IllegalAccessException iae) { | |
| 325 | + System.err.println(lookup("main.debug.cantaccess")); | |
| 326 | + return 1; | |
| 327 | + } | |
| 328 | + return 0; | |
| 329 | + } | |
| 330 | + | |
| 331 | + private void init() { | |
| 332 | + // GET APPLETVIEWER USER-SPECIFIC PROPERTIES | |
| 333 | + Properties avProps = getAVProps(); | |
| 334 | + | |
| 335 | + // ADD OTHER RANDOM PROPERTIES | |
| 336 | + // XXX 5/18 need to revisit why these are here, is there some | |
| 337 | + // standard for what is available? | |
| 338 | + | |
| 339 | + // Standard browser properties | |
| 340 | + avProps.put("browser", "sun.applet.AppletViewer"); | |
| 341 | + avProps.put("browser.version", "1.06"); | |
| 342 | + avProps.put("browser.vendor", "Oracle Corporation"); | |
| 343 | + avProps.put("http.agent", "Java(tm) 2 SDK, Standard Edition v" + theVersion); | |
| 344 | + | |
| 345 | + // Define which packages can be extended by applets | |
| 346 | + // XXX 5/19 probably not needed, not checked in AppletSecurity | |
| 347 | + avProps.put("package.restrict.definition.java", "true"); | |
| 348 | + avProps.put("package.restrict.definition.sun", "true"); | |
| 349 | + | |
| 350 | + // Define which properties can be read by applets. | |
| 351 | + // A property named by "key" can be read only when its twin | |
| 352 | + // property "key.applet" is true. The following ten properties | |
| 353 | + // are open by default. Any other property can be explicitly | |
| 354 | + // opened up by the browser user by calling appletviewer with | |
| 355 | + // -J-Dkey.applet=true | |
| 356 | + avProps.put("java.version.applet", "true"); | |
| 357 | + avProps.put("java.vendor.applet", "true"); | |
| 358 | + avProps.put("java.vendor.url.applet", "true"); | |
| 359 | + avProps.put("java.class.version.applet", "true"); | |
| 360 | + avProps.put("os.name.applet", "true"); | |
| 361 | + avProps.put("os.version.applet", "true"); | |
| 362 | + avProps.put("os.arch.applet", "true"); | |
| 363 | + avProps.put("file.separator.applet", "true"); | |
| 364 | + avProps.put("path.separator.applet", "true"); | |
| 365 | + avProps.put("line.separator.applet", "true"); | |
| 366 | + | |
| 367 | + // Read in the System properties. If something is going to be | |
| 368 | + // over-written, warn about it. | |
| 369 | + Properties sysProps = System.getProperties(); | |
| 370 | + for (Enumeration e = sysProps.propertyNames(); e.hasMoreElements(); ) { | |
| 371 | + String key = (String) e.nextElement(); | |
| 372 | + String val = (String) sysProps.getProperty(key); | |
| 373 | + String oldVal; | |
| 374 | + if ((oldVal = (String) avProps.setProperty(key, val)) != null) | |
| 375 | + System.err.println(lookup("main.warn.prop.overwrite", key, | |
| 376 | + oldVal, val)); | |
| 377 | + } | |
| 378 | + | |
| 379 | + // INSTALL THE PROPERTY LIST | |
| 380 | + System.setProperties(avProps); | |
| 381 | + | |
| 382 | + // Create and install the security manager | |
| 383 | + if (!noSecurityFlag) { | |
| 384 | + System.setSecurityManager(new AppletSecurity()); | |
| 385 | + } else { | |
| 386 | + System.err.println(lookup("main.nosecmgr")); | |
| 387 | + } | |
| 388 | + | |
| 389 | + // REMIND: Create and install a socket factory! | |
| 390 | + } | |
| 391 | + | |
| 392 | + /** | |
| 393 | + * Read the AppletViewer user-specific properties. Typically, these | |
| 394 | + * properties should reside in the file $USER/.appletviewer. If this file | |
| 395 | + * does not exist, one will be created. Information for this file will | |
| 396 | + * be gleaned from $USER/.hotjava/properties. If that file does not exist, | |
| 397 | + * then default values will be used. | |
| 398 | + * | |
| 399 | + * @return A Properties object containing all of the AppletViewer | |
| 400 | + * user-specific properties. | |
| 401 | + */ | |
| 402 | + private Properties getAVProps() { | |
| 403 | + Properties avProps = new Properties(); | |
| 404 | + | |
| 405 | + File dotAV = theUserPropertiesFile; | |
| 406 | + if (dotAV.exists()) { | |
| 407 | + // we must have already done the conversion | |
| 408 | + if (dotAV.canRead()) { | |
| 409 | + // just read the file | |
| 410 | + avProps = getAVProps(dotAV); | |
| 411 | + } else { | |
| 412 | + // send out warning and use defaults | |
| 413 | + System.err.println(lookup("main.warn.cantreadprops", | |
| 414 | + dotAV.toString())); | |
| 415 | + avProps = setDefaultAVProps(); | |
| 416 | + } | |
| 417 | + } else { | |
| 418 | + // create the $USER/.appletviewer file | |
| 419 | + | |
| 420 | + // see if $USER/.hotjava/properties exists | |
| 421 | + File userHome = new File(System.getProperty("user.home")); | |
| 422 | + File dotHJ = new File(userHome, ".hotjava"); | |
| 423 | + dotHJ = new File(dotHJ, "properties"); | |
| 424 | + if (dotHJ.exists()) { | |
| 425 | + // just read the file | |
| 426 | + avProps = getAVProps(dotHJ); | |
| 427 | + } else { | |
| 428 | + // send out warning and use defaults | |
| 429 | + System.err.println(lookup("main.warn.cantreadprops", | |
| 430 | + dotHJ.toString())); | |
| 431 | + avProps = setDefaultAVProps(); | |
| 432 | + } | |
| 433 | + | |
| 434 | + // SAVE THE FILE | |
| 435 | + try { | |
| 436 | + FileOutputStream out = new FileOutputStream(dotAV); | |
| 437 | + avProps.store(out, lookup("main.prop.store")); | |
| 438 | + out.close(); | |
| 439 | + } catch (IOException e) { | |
| 440 | + System.err.println(lookup("main.err.prop.cantsave", | |
| 441 | + dotAV.toString())); | |
| 442 | + } | |
| 443 | + } | |
| 444 | + return avProps; | |
| 445 | + } | |
| 446 | + | |
| 447 | + /** | |
| 448 | + * Set the AppletViewer user-specific properties to be the default values. | |
| 449 | + * | |
| 450 | + * @return A Properties object containing all of the AppletViewer | |
| 451 | + * user-specific properties, set to the default values. | |
| 452 | + */ | |
| 453 | + private Properties setDefaultAVProps() { | |
| 454 | + Properties avProps = new Properties(); | |
| 455 | + for (int i = 0; i < avDefaultUserProps.length; i++) { | |
| 456 | + avProps.setProperty(avDefaultUserProps[i][0], | |
| 457 | + avDefaultUserProps[i][1]); | |
| 458 | + } | |
| 459 | + return avProps; | |
| 460 | + } | |
| 461 | + | |
| 462 | + /** | |
| 463 | + * Given a file, find only the properties that are setable by AppletViewer. | |
| 464 | + * | |
| 465 | + * @param inFile A Properties file from which we select the properties of | |
| 466 | + * interest. | |
| 467 | + * @return A Properties object containing all of the AppletViewer | |
| 468 | + * user-specific properties. | |
| 469 | + */ | |
| 470 | + private Properties getAVProps(File inFile) { | |
| 471 | + Properties avProps = new Properties(); | |
| 472 | + | |
| 473 | + // read the file | |
| 474 | + Properties tmpProps = new Properties(); | |
| 475 | + try { | |
| 476 | + FileInputStream in = new FileInputStream(inFile); | |
| 477 | + tmpProps.load(new BufferedInputStream(in)); | |
| 478 | + in.close(); | |
| 479 | + } catch (IOException e) { | |
| 480 | + System.err.println(lookup("main.err.prop.cantread", | |
| 481 | + inFile.toString())); | |
| 482 | + } | |
| 483 | + | |
| 484 | + // pick off the properties we care about | |
| 485 | + for (int i = 0; i < avDefaultUserProps.length; i++) { | |
| 486 | + String value = tmpProps.getProperty(avDefaultUserProps[i][0]); | |
| 487 | + if (value != null) { | |
| 488 | + // the property exists in the file, so replace the default | |
| 489 | + avProps.setProperty(avDefaultUserProps[i][0], value); | |
| 490 | + } else { | |
| 491 | + // just use the default | |
| 492 | + avProps.setProperty(avDefaultUserProps[i][0], | |
| 493 | + avDefaultUserProps[i][1]); | |
| 494 | + } | |
| 495 | + } | |
| 496 | + return avProps; | |
| 497 | + } | |
| 498 | + | |
| 499 | + /** | |
| 500 | + * Methods for easier i18n handling. | |
| 501 | + */ | |
| 502 | + | |
| 503 | + private static String lookup(String key) { | |
| 504 | + return amh.getMessage(key); | |
| 505 | + } | |
| 506 | + | |
| 507 | + private static String lookup(String key, String arg0) { | |
| 508 | + return amh.getMessage(key, arg0); | |
| 509 | + } | |
| 510 | + | |
| 511 | + private static String lookup(String key, String arg0, String arg1) { | |
| 512 | + return amh.getMessage(key, arg0, arg1); | |
| 513 | + } | |
| 514 | + | |
| 515 | + private static String lookup(String key, String arg0, String arg1, | |
| 516 | + String arg2) { | |
| 517 | + return amh.getMessage(key, arg0, arg1, arg2); | |
| 518 | + } | |
| 519 | + | |
| 520 | + class ParseException extends RuntimeException | |
| 521 | + { | |
| 522 | + public ParseException(String msg) { | |
| 523 | + super(msg); | |
| 524 | + } | |
| 525 | + | |
| 526 | + public ParseException(Throwable t) { | |
| 527 | + super(t.getMessage()); | |
| 528 | + this.t = t; | |
| 529 | + } | |
| 530 | + | |
| 531 | + Throwable t = null; | |
| 532 | + } | |
| 533 | +} | |
| @@ -0,0 +1,31 @@ | ||
| 1 | +<../../../../mkconfig | |
| 2 | + | |
| 3 | +DIRS=\ | |
| 4 | + resources\ | |
| 5 | + | |
| 6 | +TARG=\ | |
| 7 | + AppletAudioClip.dis\ | |
| 8 | + AppletClassLoader.dis\ | |
| 9 | + AppletEvent.dis\ | |
| 10 | + AppletEventMulticaster.dis\ | |
| 11 | + AppletIllegalArgumentException.dis\ | |
| 12 | + AppletImageRef.dis\ | |
| 13 | + AppletIOException.dis\ | |
| 14 | + AppletListener.dis\ | |
| 15 | + AppletMessageHandler.dis\ | |
| 16 | + AppletObjectInputStream.dis\ | |
| 17 | + AppletPanel.dis\ | |
| 18 | + AppletProps.dis\ | |
| 19 | + AppletResourceLoader.dis\ | |
| 20 | + AppletSecurity.dis\ | |
| 21 | + AppletSecurityException.dis\ | |
| 22 | + AppletThreadGroup.dis\ | |
| 23 | + AppletViewer.dis\ | |
| 24 | + AppletViewerFactory.dis\ | |
| 25 | + AppletViewerPanel.dis\ | |
| 26 | + Main.dis\ | |
| 27 | + | |
| 28 | +DISBIN=$ROOT/java/dis/java/java/sun/applet | |
| 29 | + | |
| 30 | +<$ROOT/mkfiles/mkjava | |
| 31 | +<$ROOT/mkfiles/mksubdirs | |
| @@ -0,0 +1,202 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1996, 2011, 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 | +package sun.applet.resources; | |
| 26 | + | |
| 27 | +import java.util.ListResourceBundle; | |
| 28 | + | |
| 29 | +public class MsgAppletViewer extends ListResourceBundle { | |
| 30 | + | |
| 31 | + public Object[][] getContents() { | |
| 32 | + Object[][] temp = new Object[][] { | |
| 33 | + {"textframe.button.dismiss", "Dismiss"}, | |
| 34 | + {"appletviewer.tool.title", "Applet Viewer: {0}"}, | |
| 35 | + {"appletviewer.menu.applet", "Applet"}, | |
| 36 | + {"appletviewer.menuitem.restart", "Restart"}, | |
| 37 | + {"appletviewer.menuitem.reload", "Reload"}, | |
| 38 | + {"appletviewer.menuitem.stop", "Stop"}, | |
| 39 | + {"appletviewer.menuitem.save", "Save..."}, | |
| 40 | + {"appletviewer.menuitem.start", "Start"}, | |
| 41 | + {"appletviewer.menuitem.clone", "Clone..."}, | |
| 42 | + {"appletviewer.menuitem.tag", "Tag..."}, | |
| 43 | + {"appletviewer.menuitem.info", "Info..."}, | |
| 44 | + {"appletviewer.menuitem.edit", "Edit"}, | |
| 45 | + {"appletviewer.menuitem.encoding", "Character Encoding"}, | |
| 46 | + {"appletviewer.menuitem.print", "Print..."}, | |
| 47 | + {"appletviewer.menuitem.props", "Properties..."}, | |
| 48 | + {"appletviewer.menuitem.close", "Close"}, | |
| 49 | + {"appletviewer.menuitem.quit", "Quit"}, | |
| 50 | + {"appletviewer.label.hello", "Hello..."}, | |
| 51 | + {"appletviewer.status.start", "starting applet..."}, | |
| 52 | + {"appletviewer.appletsave.filedialogtitle","Serialize Applet into File"}, | |
| 53 | + {"appletviewer.appletsave.err1", "serializing an {0} to {1}"}, | |
| 54 | + {"appletviewer.appletsave.err2", "in appletSave: {0}"}, | |
| 55 | + {"appletviewer.applettag", "Tag shown"}, | |
| 56 | + {"appletviewer.applettag.textframe", "Applet HTML Tag"}, | |
| 57 | + {"appletviewer.appletinfo.applet", "-- no applet info --"}, | |
| 58 | + {"appletviewer.appletinfo.param", "-- no parameter info --"}, | |
| 59 | + {"appletviewer.appletinfo.textframe", "Applet Info"}, | |
| 60 | + {"appletviewer.appletprint.fail", "Printing failed."}, | |
| 61 | + {"appletviewer.appletprint.finish", "Finished printing."}, | |
| 62 | + {"appletviewer.appletprint.cancel", "Printing cancelled."}, | |
| 63 | + {"appletviewer.appletencoding", "Character Encoding: {0}"}, | |
| 64 | + {"appletviewer.parse.warning.requiresname", "Warning: <param name=... value=...> tag requires name attribute."}, | |
| 65 | + {"appletviewer.parse.warning.paramoutside", "Warning: <param> tag outside <applet> ... </applet>."}, | |
| 66 | + {"appletviewer.parse.warning.applet.requirescode", "Warning: <applet> tag requires code attribute."}, | |
| 67 | + {"appletviewer.parse.warning.applet.requiresheight", "Warning: <applet> tag requires height attribute."}, | |
| 68 | + {"appletviewer.parse.warning.applet.requireswidth", "Warning: <applet> tag requires width attribute."}, | |
| 69 | + {"appletviewer.parse.warning.object.requirescode", "Warning: <object> tag requires code attribute."}, | |
| 70 | + {"appletviewer.parse.warning.object.requiresheight", "Warning: <object> tag requires height attribute."}, | |
| 71 | + {"appletviewer.parse.warning.object.requireswidth", "Warning: <object> tag requires width attribute."}, | |
| 72 | + {"appletviewer.parse.warning.embed.requirescode", "Warning: <embed> tag requires code attribute."}, | |
| 73 | + {"appletviewer.parse.warning.embed.requiresheight", "Warning: <embed> tag requires height attribute."}, | |
| 74 | + {"appletviewer.parse.warning.embed.requireswidth", "Warning: <embed> tag requires width attribute."}, | |
| 75 | + {"appletviewer.parse.warning.appnotLongersupported", "Warning: <app> tag no longer supported, use <applet> instead:"}, | |
| 76 | + {"appletviewer.usage", "Usage: appletviewer <options> url(s)\n\nwhere <options> include:\n -debug Start the applet viewer in the Java debugger\n -encoding <encoding> Specify character encoding used by HTML files\n -J<runtime flag> Pass argument to the java interpreter\n\nThe -J option is non-standard and subject to change without notice."}, | |
| 77 | + {"appletviewer.main.err.unsupportedopt", "Unsupported option: {0}"}, | |
| 78 | + {"appletviewer.main.err.unrecognizedarg", "Unrecognized argument: {0}"}, | |
| 79 | + {"appletviewer.main.err.dupoption", "Duplicate use of option: {0}"}, | |
| 80 | + {"appletviewer.main.err.inputfile", "No input files specified."}, | |
| 81 | + {"appletviewer.main.err.badurl", "Bad URL: {0} ( {1} )"}, | |
| 82 | + {"appletviewer.main.err.io", "I/O exception while reading: {0}"}, | |
| 83 | + {"appletviewer.main.err.readablefile", "Make sure that {0} is a file and is readable."}, | |
| 84 | + {"appletviewer.main.err.correcturl", "Is {0} the correct URL?"}, | |
| 85 | + {"appletviewer.main.prop.store", "User-specific properties for AppletViewer"}, | |
| 86 | + {"appletviewer.main.err.prop.cantread", "Can''t read user properties file: {0}"}, | |
| 87 | + {"appletviewer.main.err.prop.cantsave", "Can''t save user properties file: {0}"}, | |
| 88 | + {"appletviewer.main.warn.nosecmgr", "Warning: disabling security."}, | |
| 89 | + {"appletviewer.main.debug.cantfinddebug", "Can''t find the debugger!"}, | |
| 90 | + {"appletviewer.main.debug.cantfindmain", "Can''t find main method in the debugger!"}, | |
| 91 | + {"appletviewer.main.debug.exceptionindebug", "Exception in the debugger!"}, | |
| 92 | + {"appletviewer.main.debug.cantaccess", "Can''t access the debugger!"}, | |
| 93 | + {"appletviewer.main.nosecmgr", "Warning: SecurityManager not installed!"}, | |
| 94 | + {"appletviewer.main.warning", "Warning: No applets were started. Make sure the input contains an <applet> tag."}, | |
| 95 | + {"appletviewer.main.warn.prop.overwrite", "Warning: Temporarily overwriting system property at user''s request: key: {0} old value: {1} new value: {2}"}, | |
| 96 | + {"appletviewer.main.warn.cantreadprops", "Warning: Can''t read AppletViewer properties file: {0} Using defaults."}, | |
| 97 | + {"appletioexception.loadclass.throw.interrupted", "class loading interrupted: {0}"}, | |
| 98 | + {"appletioexception.loadclass.throw.notloaded", "class not loaded: {0}"}, | |
| 99 | + {"appletclassloader.loadcode.verbose", "Opening stream to: {0} to get {1}"}, | |
| 100 | + {"appletclassloader.filenotfound", "File not found when looking for: {0}"}, | |
| 101 | + {"appletclassloader.fileformat", "File format exception when loading: {0}"}, | |
| 102 | + {"appletclassloader.fileioexception", "I/O exception when loading: {0}"}, | |
| 103 | + {"appletclassloader.fileexception", "{0} exception when loading: {1}"}, | |
| 104 | + {"appletclassloader.filedeath", "{0} killed when loading: {1}"}, | |
| 105 | + {"appletclassloader.fileerror", "{0} error when loading: {1}"}, | |
| 106 | + {"appletclassloader.findclass.verbose.openstream", "Opening stream to: {0} to get {1}"}, | |
| 107 | + {"appletclassloader.getresource.verbose.forname", "AppletClassLoader.getResource for name: {0}"}, | |
| 108 | + {"appletclassloader.getresource.verbose.found", "Found resource: {0} as a system resource"}, | |
| 109 | + {"appletclassloader.getresourceasstream.verbose", "Found resource: {0} as a system resource"}, | |
| 110 | + {"appletpanel.runloader.err", "Either object or code parameter!"}, | |
| 111 | + {"appletpanel.runloader.exception", "exception while deserializing {0}"}, | |
| 112 | + {"appletpanel.destroyed", "Applet destroyed."}, | |
| 113 | + {"appletpanel.loaded", "Applet loaded."}, | |
| 114 | + {"appletpanel.started", "Applet started."}, | |
| 115 | + {"appletpanel.inited", "Applet initialized."}, | |
| 116 | + {"appletpanel.stopped", "Applet stopped."}, | |
| 117 | + {"appletpanel.disposed", "Applet disposed."}, | |
| 118 | + {"appletpanel.nocode", "APPLET tag missing CODE parameter."}, | |
| 119 | + {"appletpanel.notfound", "load: class {0} not found."}, | |
| 120 | + {"appletpanel.nocreate", "load: {0} can''t be instantiated."}, | |
| 121 | + {"appletpanel.noconstruct", "load: {0} is not public or has no public constructor."}, | |
| 122 | + {"appletpanel.death", "killed"}, | |
| 123 | + {"appletpanel.exception", "exception: {0}."}, | |
| 124 | + {"appletpanel.exception2", "exception: {0}: {1}."}, | |
| 125 | + {"appletpanel.error", "error: {0}."}, | |
| 126 | + {"appletpanel.error2", "error: {0}: {1}."}, | |
| 127 | + {"appletpanel.notloaded", "Init: applet not loaded."}, | |
| 128 | + {"appletpanel.notinited", "Start: applet not initialized."}, | |
| 129 | + {"appletpanel.notstarted", "Stop: applet not started."}, | |
| 130 | + {"appletpanel.notstopped", "Destroy: applet not stopped."}, | |
| 131 | + {"appletpanel.notdestroyed", "Dispose: applet not destroyed."}, | |
| 132 | + {"appletpanel.notdisposed", "Load: applet not disposed."}, | |
| 133 | + {"appletpanel.bail", "Interrupted: bailing out."}, | |
| 134 | + {"appletpanel.filenotfound", "File not found when looking for: {0}"}, | |
| 135 | + {"appletpanel.fileformat", "File format exception when loading: {0}"}, | |
| 136 | + {"appletpanel.fileioexception", "I/O exception when loading: {0}"}, | |
| 137 | + {"appletpanel.fileexception", "{0} exception when loading: {1}"}, | |
| 138 | + {"appletpanel.filedeath", "{0} killed when loading: {1}"}, | |
| 139 | + {"appletpanel.fileerror", "{0} error when loading: {1}"}, | |
| 140 | + {"appletpanel.badattribute.exception", "HTML parsing: incorrect value for width/height attribute"}, | |
| 141 | + {"appletillegalargumentexception.objectinputstream", "AppletObjectInputStream requires non-null loader"}, | |
| 142 | + {"appletprops.title", "AppletViewer Properties"}, | |
| 143 | + {"appletprops.label.http.server", "Http proxy server:"}, | |
| 144 | + {"appletprops.label.http.proxy", "Http proxy port:"}, | |
| 145 | + {"appletprops.label.network", "Network access:"}, | |
| 146 | + {"appletprops.choice.network.item.none", "None"}, | |
| 147 | + {"appletprops.choice.network.item.applethost", "Applet Host"}, | |
| 148 | + {"appletprops.choice.network.item.unrestricted", "Unrestricted"}, | |
| 149 | + {"appletprops.label.class", "Class access:"}, | |
| 150 | + {"appletprops.choice.class.item.restricted", "Restricted"}, | |
| 151 | + {"appletprops.choice.class.item.unrestricted", "Unrestricted"}, | |
| 152 | + {"appletprops.label.unsignedapplet", "Allow unsigned applets:"}, | |
| 153 | + {"appletprops.choice.unsignedapplet.no", "No"}, | |
| 154 | + {"appletprops.choice.unsignedapplet.yes", "Yes"}, | |
| 155 | + {"appletprops.button.apply", "Apply"}, | |
| 156 | + {"appletprops.button.cancel", "Cancel"}, | |
| 157 | + {"appletprops.button.reset", "Reset"}, | |
| 158 | + {"appletprops.apply.exception", "Failed to save properties: {0}"}, | |
| 159 | + /* 4066432 */ | |
| 160 | + {"appletprops.title.invalidproxy", "Invalid Entry"}, | |
| 161 | + {"appletprops.label.invalidproxy", "Proxy Port must be a positive integer value."}, | |
| 162 | + {"appletprops.button.ok", "OK"}, | |
| 163 | + /* end 4066432 */ | |
| 164 | + {"appletprops.prop.store", "User-specific properties for AppletViewer"}, | |
| 165 | + {"appletsecurityexception.checkcreateclassloader", "Security Exception: classloader"}, | |
| 166 | + {"appletsecurityexception.checkaccess.thread", "Security Exception: thread"}, | |
| 167 | + {"appletsecurityexception.checkaccess.threadgroup", "Security Exception: threadgroup: {0}"}, | |
| 168 | + {"appletsecurityexception.checkexit", "Security Exception: exit: {0}"}, | |
| 169 | + {"appletsecurityexception.checkexec", "Security Exception: exec: {0}"}, | |
| 170 | + {"appletsecurityexception.checklink", "Security Exception: link: {0}"}, | |
| 171 | + {"appletsecurityexception.checkpropsaccess", "Security Exception: properties"}, | |
| 172 | + {"appletsecurityexception.checkpropsaccess.key", "Security Exception: properties access {0}"}, | |
| 173 | + {"appletsecurityexception.checkread.exception1", "Security Exception: {0}, {1}"}, | |
| 174 | + {"appletsecurityexception.checkread.exception2", "Security Exception: file.read: {0}"}, | |
| 175 | + {"appletsecurityexception.checkread", "Security Exception: file.read: {0} == {1}"}, | |
| 176 | + {"appletsecurityexception.checkwrite.exception", "Security Exception: {0}, {1}"}, | |
| 177 | + {"appletsecurityexception.checkwrite", "Security Exception: file.write: {0} == {1}"}, | |
| 178 | + {"appletsecurityexception.checkread.fd", "Security Exception: fd.read"}, | |
| 179 | + {"appletsecurityexception.checkwrite.fd", "Security Exception: fd.write"}, | |
| 180 | + {"appletsecurityexception.checklisten", "Security Exception: socket.listen: {0}"}, | |
| 181 | + {"appletsecurityexception.checkaccept", "Security Exception: socket.accept: {0}:{1}"}, | |
| 182 | + {"appletsecurityexception.checkconnect.networknone", "Security Exception: socket.connect: {0}->{1}"}, | |
| 183 | + {"appletsecurityexception.checkconnect.networkhost1", "Security Exception: Couldn''t connect to {0} with origin from {1}."}, | |
| 184 | + {"appletsecurityexception.checkconnect.networkhost2", "Security Exception: Couldn''t resolve IP for host {0} or for {1}. "}, | |
| 185 | + {"appletsecurityexception.checkconnect.networkhost3", "Security Exception: Could not resolve IP for host {0}. See the trustProxy property."}, | |
| 186 | + {"appletsecurityexception.checkconnect", "Security Exception: connect: {0}->{1}"}, | |
| 187 | + {"appletsecurityexception.checkpackageaccess", "Security Exception: cannot access package: {0}"}, | |
| 188 | + {"appletsecurityexception.checkpackagedefinition", "Security Exception: cannot define package: {0}"}, | |
| 189 | + {"appletsecurityexception.cannotsetfactory", "Security Exception: cannot set factory"}, | |
| 190 | + {"appletsecurityexception.checkmemberaccess", "Security Exception: check member access"}, | |
| 191 | + {"appletsecurityexception.checkgetprintjob", "Security Exception: getPrintJob"}, | |
| 192 | + {"appletsecurityexception.checksystemclipboardaccess", "Security Exception: getSystemClipboard"}, | |
| 193 | + {"appletsecurityexception.checkawteventqueueaccess", "Security Exception: getEventQueue"}, | |
| 194 | + {"appletsecurityexception.checksecurityaccess", "Security Exception: security operation: {0}"}, | |
| 195 | + {"appletsecurityexception.getsecuritycontext.unknown", "unknown class loader type. unable to check for getContext"}, | |
| 196 | + {"appletsecurityexception.checkread.unknown", "unknown class loader type. unable to check for checking read {0}"}, | |
| 197 | + {"appletsecurityexception.checkconnect.unknown", "unknown class loader type. unable to check for checking connect"}, | |
| 198 | + }; | |
| 199 | + | |
| 200 | + return temp; | |
| 201 | + } | |
| 202 | +} | |
| @@ -0,0 +1,202 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1996, 2011, 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 | +package sun.applet.resources; | |
| 26 | + | |
| 27 | +import java.util.ListResourceBundle; | |
| 28 | + | |
| 29 | +public class MsgAppletViewer_de extends ListResourceBundle { | |
| 30 | + | |
| 31 | + public Object[][] getContents() { | |
| 32 | + Object[][] temp = new Object[][] { | |
| 33 | + {"textframe.button.dismiss", "Verwerfen"}, | |
| 34 | + {"appletviewer.tool.title", "Applet Viewer: {0}"}, | |
| 35 | + {"appletviewer.menu.applet", "Applet"}, | |
| 36 | + {"appletviewer.menuitem.restart", "Neu starten"}, | |
| 37 | + {"appletviewer.menuitem.reload", "Neu laden"}, | |
| 38 | + {"appletviewer.menuitem.stop", "Stoppen"}, | |
| 39 | + {"appletviewer.menuitem.save", "Speichern..."}, | |
| 40 | + {"appletviewer.menuitem.start", "Starten..."}, | |
| 41 | + {"appletviewer.menuitem.clone", "Clonen..."}, | |
| 42 | + {"appletviewer.menuitem.tag", "Tag..."}, | |
| 43 | + {"appletviewer.menuitem.info", "Informationen..."}, | |
| 44 | + {"appletviewer.menuitem.edit", "Bearbeiten"}, | |
| 45 | + {"appletviewer.menuitem.encoding", "Zeichencodierung"}, | |
| 46 | + {"appletviewer.menuitem.print", "Drucken..."}, | |
| 47 | + {"appletviewer.menuitem.props", "Eigenschaften..."}, | |
| 48 | + {"appletviewer.menuitem.close", "Schlie\u00DFen"}, | |
| 49 | + {"appletviewer.menuitem.quit", "Beenden"}, | |
| 50 | + {"appletviewer.label.hello", "Hallo..."}, | |
| 51 | + {"appletviewer.status.start", "Applet wird gestartet..."}, | |
| 52 | + {"appletviewer.appletsave.filedialogtitle","Applet in Datei serialisieren"}, | |
| 53 | + {"appletviewer.appletsave.err1", "{0} in {1} serialisieren"}, | |
| 54 | + {"appletviewer.appletsave.err2", "in appletSave: {0}"}, | |
| 55 | + {"appletviewer.applettag", "Angezeigtes Tag"}, | |
| 56 | + {"appletviewer.applettag.textframe", "Applet-HTML-Tag"}, | |
| 57 | + {"appletviewer.appletinfo.applet", "-- keine Applet-Informationen --"}, | |
| 58 | + {"appletviewer.appletinfo.param", "-- keine Parameterinformationen --"}, | |
| 59 | + {"appletviewer.appletinfo.textframe", "Applet-Informationen"}, | |
| 60 | + {"appletviewer.appletprint.fail", "Druck nicht erfolgreich."}, | |
| 61 | + {"appletviewer.appletprint.finish", "Druck abgeschlossen."}, | |
| 62 | + {"appletviewer.appletprint.cancel", "Druck abgebrochen."}, | |
| 63 | + {"appletviewer.appletencoding", "Zeichencodierung: {0}"}, | |
| 64 | + {"appletviewer.parse.warning.requiresname", "Warnung: F\u00FCr <param name=... value=...>-Tag ist ein \"name\"-Attribut erforderlich."}, | |
| 65 | + {"appletviewer.parse.warning.paramoutside", "Warnung: <param>-Tag au\u00DFerhalb von <applet> ... </applet>."}, | |
| 66 | + {"appletviewer.parse.warning.applet.requirescode", "Warnung: F\u00FCr <applet>-Tag ist ein \"code\"-Attribut erforderlich."}, | |
| 67 | + {"appletviewer.parse.warning.applet.requiresheight", "Warnung: F\u00FCr <applet>-Tag ist ein \"height\"-Attribut erforderlich."}, | |
| 68 | + {"appletviewer.parse.warning.applet.requireswidth", "Warnung: F\u00FCr <applet>-Tag ist ein \"width\"-Attribut erforderlich."}, | |
| 69 | + {"appletviewer.parse.warning.object.requirescode", "Warnung: F\u00FCr <object>-Tag ist ein \"code\"-Attribut erforderlich."}, | |
| 70 | + {"appletviewer.parse.warning.object.requiresheight", "Warnung: F\u00FCr <object>-Tag ist ein \"height\"-Attribut erforderlich."}, | |
| 71 | + {"appletviewer.parse.warning.object.requireswidth", "Warnung: F\u00FCr <object>-Tag ist ein \"width\"-Attribut erforderlich."}, | |
| 72 | + {"appletviewer.parse.warning.embed.requirescode", "Warnung: F\u00FCr <embed>-Tag ist ein \"code\"-Attribut erforderlich."}, | |
| 73 | + {"appletviewer.parse.warning.embed.requiresheight", "Warnung: F\u00FCr <embed>-Tag ist ein \"height\"-Attribut erforderlich."}, | |
| 74 | + {"appletviewer.parse.warning.embed.requireswidth", "Warnung: F\u00FCr <embed>-Tag ist ein \"width\"-Attribut erforderlich."}, | |
| 75 | + {"appletviewer.parse.warning.appnotLongersupported", "Warnung: <app>-Tag wird nicht mehr unterst\u00FCtzt. Verwenden Sie stattdessen <applet>:"}, | |
| 76 | + {"appletviewer.usage", "Verwendung: appletviewer <Optionen> url(s)\n\nwobei die <Optionen> Folgendes umfassen:\n -debug Applet Viewer im Java-Debugger starten\n -encoding <Codierung> Zeichencodierung f\u00FCr HTML-Dateien angeben\n -J <Laufzeitkennzeichen> Argument an den Java-Interpreter \u00FCbergeben\n\nDie Option \"-J\" ist nicht standardm\u00E4\u00DFig und kann ohne vorherige Ank\u00FCndigung ge\u00E4ndert werden."}, | |
| 77 | + {"appletviewer.main.err.unsupportedopt", "Nicht unterst\u00FCtzte Option: {0}"}, | |
| 78 | + {"appletviewer.main.err.unrecognizedarg", "Unbekanntes Argument: {0}"}, | |
| 79 | + {"appletviewer.main.err.dupoption", "Doppelte Verwendung von Option: {0}"}, | |
| 80 | + {"appletviewer.main.err.inputfile", "Keine Eingabedateien angegeben."}, | |
| 81 | + {"appletviewer.main.err.badurl", "Ung\u00FCltige URL: {0} ( {1} )"}, | |
| 82 | + {"appletviewer.main.err.io", "I/O-Ausnahme beim Lesen von: {0}"}, | |
| 83 | + {"appletviewer.main.err.readablefile", "Stellen Sie sicher, dass {0} eine lesbare Datei ist."}, | |
| 84 | + {"appletviewer.main.err.correcturl", "Ist {0} die richtige URL?"}, | |
| 85 | + {"appletviewer.main.prop.store", "Benutzerspezifische Eigenschaften f\u00FCr AppletViewer"}, | |
| 86 | + {"appletviewer.main.err.prop.cantread", "Benutzereigenschaftendatei kann nicht gelesen werden: {0}"}, | |
| 87 | + {"appletviewer.main.err.prop.cantsave", "Benutzereigenschaftendatei kann nicht gespeichert werden: {0}"}, | |
| 88 | + {"appletviewer.main.warn.nosecmgr", "Warnung: Sicherheit wird deaktiviert."}, | |
| 89 | + {"appletviewer.main.debug.cantfinddebug", "Debugger kann nicht gefunden werden."}, | |
| 90 | + {"appletviewer.main.debug.cantfindmain", "Hauptmethode im Debugger kann nicht gefunden werden."}, | |
| 91 | + {"appletviewer.main.debug.exceptionindebug", "Ausnahme im Debugger."}, | |
| 92 | + {"appletviewer.main.debug.cantaccess", "Zugriff auf Debugger nicht m\u00F6glich."}, | |
| 93 | + {"appletviewer.main.nosecmgr", "Warnung: SecurityManager nicht installiert."}, | |
| 94 | + {"appletviewer.main.warning", "Warnung: Es wurden keine Applets gestartet. Stellen Sie sicher, dass die Eingabe ein <applet>-Tag enth\u00E4lt."}, | |
| 95 | + {"appletviewer.main.warn.prop.overwrite", "Warnung: Systemeigenschaft wird tempor\u00E4r aufgrund von Benutzeranforderung \u00FCberschrieben: Schl\u00FCssel: {0} Alter Wert: {1} Neuer Wert: {2}"}, | |
| 96 | + {"appletviewer.main.warn.cantreadprops", "Warnung: AppletViewer-Eigenschaftendatei kann nicht gelesen werden: {0} Standardwerte werden verwendet."}, | |
| 97 | + {"appletioexception.loadclass.throw.interrupted", "Laden der Klasse unterbrochen: {0}"}, | |
| 98 | + {"appletioexception.loadclass.throw.notloaded", "Klasse nicht geladen: {0}"}, | |
| 99 | + {"appletclassloader.loadcode.verbose", "\u00D6ffnen von Stream zu: {0}, um {1} abzurufen"}, | |
| 100 | + {"appletclassloader.filenotfound", "Datei nicht gefunden beim Suchen nach: {0}"}, | |
| 101 | + {"appletclassloader.fileformat", "Dateiformatausnahme beim Laden von: {0}"}, | |
| 102 | + {"appletclassloader.fileioexception", "I/O-Ausnahme beim Laden von: {0}"}, | |
| 103 | + {"appletclassloader.fileexception", "{0}-Ausnahme beim Laden von: {1}"}, | |
| 104 | + {"appletclassloader.filedeath", "{0} abgebrochen beim Laden von: {1}"}, | |
| 105 | + {"appletclassloader.fileerror", "{0}-Fehler beim Laden von: {1}"}, | |
| 106 | + {"appletclassloader.findclass.verbose.openstream", "\u00D6ffnen von Stream zu: {0}, um {1} abzurufen"}, | |
| 107 | + {"appletclassloader.getresource.verbose.forname", "AppletClassLoader.getResource f\u00FCr Name: {0}"}, | |
| 108 | + {"appletclassloader.getresource.verbose.found", "Ressource {0} als Systemressource gefunden"}, | |
| 109 | + {"appletclassloader.getresourceasstream.verbose", "Ressource {0} als Systemressource gefunden"}, | |
| 110 | + {"appletpanel.runloader.err", "Objekt oder Codeparameter."}, | |
| 111 | + {"appletpanel.runloader.exception", "Ausnahme beim Deserialisieren von {0}"}, | |
| 112 | + {"appletpanel.destroyed", "Applet endg\u00FCltig gel\u00F6scht."}, | |
| 113 | + {"appletpanel.loaded", "Applet geladen."}, | |
| 114 | + {"appletpanel.started", "Applet gestartet."}, | |
| 115 | + {"appletpanel.inited", "Applet initialisiert."}, | |
| 116 | + {"appletpanel.stopped", "Applet gestoppt."}, | |
| 117 | + {"appletpanel.disposed", "Applet verworfen."}, | |
| 118 | + {"appletpanel.nocode", "Bei APPLET-Tag fehlt CODE-Parameter."}, | |
| 119 | + {"appletpanel.notfound", "Laden: Klasse {0} nicht gefunden."}, | |
| 120 | + {"appletpanel.nocreate", "Laden: {0} kann nicht instanziiert werden."}, | |
| 121 | + {"appletpanel.noconstruct", "Laden: {0} ist nicht \"public\" oder hat keinen \"public\"-Constructor."}, | |
| 122 | + {"appletpanel.death", "abgebrochen"}, | |
| 123 | + {"appletpanel.exception", "Ausnahme: {0}."}, | |
| 124 | + {"appletpanel.exception2", "Ausnahme: {0}: {1}."}, | |
| 125 | + {"appletpanel.error", "Fehler: {0}."}, | |
| 126 | + {"appletpanel.error2", "Fehler: {0}: {1}."}, | |
| 127 | + {"appletpanel.notloaded", "Init.: Applet nicht geladen."}, | |
| 128 | + {"appletpanel.notinited", "Starten: Applet nicht initialisiert."}, | |
| 129 | + {"appletpanel.notstarted", "Stoppen: Applet nicht gestartet."}, | |
| 130 | + {"appletpanel.notstopped", "Endg\u00FCltig l\u00F6schen: Applet nicht gestoppt."}, | |
| 131 | + {"appletpanel.notdestroyed", "Verwerfen: Applet nicht endg\u00FCltig gel\u00F6scht."}, | |
| 132 | + {"appletpanel.notdisposed", "Laden: Applet nicht verworfen."}, | |
| 133 | + {"appletpanel.bail", "Unterbrochen: Zur\u00FCckziehen."}, | |
| 134 | + {"appletpanel.filenotfound", "Datei nicht gefunden beim Suchen nach: {0}"}, | |
| 135 | + {"appletpanel.fileformat", "Dateiformatausnahme beim Laden von: {0}"}, | |
| 136 | + {"appletpanel.fileioexception", "I/O-Ausnahme beim Laden von: {0}"}, | |
| 137 | + {"appletpanel.fileexception", "{0}-Ausnahme beim Laden von: {1}"}, | |
| 138 | + {"appletpanel.filedeath", "{0} abgebrochen beim Laden von: {1}"}, | |
| 139 | + {"appletpanel.fileerror", "{0}-Fehler beim Laden von: {1}"}, | |
| 140 | + {"appletpanel.badattribute.exception", "HTML-Parsing: Falscher Wert f\u00FCr \"width/height\"-Attribut"}, | |
| 141 | + {"appletillegalargumentexception.objectinputstream", "AppletObjectInputStream erfordert Loader ungleich null"}, | |
| 142 | + {"appletprops.title", "AppletViewer-Eigenschaften"}, | |
| 143 | + {"appletprops.label.http.server", "HTTP-Proxyserver:"}, | |
| 144 | + {"appletprops.label.http.proxy", "HTTP-Proxyport:"}, | |
| 145 | + {"appletprops.label.network", "Netzwerkzugriff:"}, | |
| 146 | + {"appletprops.choice.network.item.none", "Keine"}, | |
| 147 | + {"appletprops.choice.network.item.applethost", "Applet-Host"}, | |
| 148 | + {"appletprops.choice.network.item.unrestricted", "Uneingeschr\u00E4nkt"}, | |
| 149 | + {"appletprops.label.class", "Klassenzugriff:"}, | |
| 150 | + {"appletprops.choice.class.item.restricted", "Eingeschr\u00E4nkt"}, | |
| 151 | + {"appletprops.choice.class.item.unrestricted", "Uneingeschr\u00E4nkt"}, | |
| 152 | + {"appletprops.label.unsignedapplet", "Nicht signierte Applets zulassen:"}, | |
| 153 | + {"appletprops.choice.unsignedapplet.no", "Nein"}, | |
| 154 | + {"appletprops.choice.unsignedapplet.yes", "Ja"}, | |
| 155 | + {"appletprops.button.apply", "Anwenden"}, | |
| 156 | + {"appletprops.button.cancel", "Abbrechen"}, | |
| 157 | + {"appletprops.button.reset", "Zur\u00FCcksetzen"}, | |
| 158 | + {"appletprops.apply.exception", "Eigenschaften konnten nicht gespeichert werden: {0}"}, | |
| 159 | + /* 4066432 */ | |
| 160 | + {"appletprops.title.invalidproxy", "Ung\u00FCltiger Eintrag"}, | |
| 161 | + {"appletprops.label.invalidproxy", "Proxyport muss ein positiver Ganzzahlwert sein."}, | |
| 162 | + {"appletprops.button.ok", "OK"}, | |
| 163 | + /* end 4066432 */ | |
| 164 | + {"appletprops.prop.store", "Benutzerspezifische Eigenschaften f\u00FCr AppletViewer"}, | |
| 165 | + {"appletsecurityexception.checkcreateclassloader", "Sicherheitsausnahme: Class Loader"}, | |
| 166 | + {"appletsecurityexception.checkaccess.thread", "Sicherheitsausnahme: Thread"}, | |
| 167 | + {"appletsecurityexception.checkaccess.threadgroup", "Sicherheitsausnahme: Threadgruppe: {0}"}, | |
| 168 | + {"appletsecurityexception.checkexit", "Sicherheitsausnahme: Beenden: {0}"}, | |
| 169 | + {"appletsecurityexception.checkexec", "Sicherheitsausnahme: Ausf\u00FChrung: {0}"}, | |
| 170 | + {"appletsecurityexception.checklink", "Sicherheitsausnahme: Link: {0}"}, | |
| 171 | + {"appletsecurityexception.checkpropsaccess", "Sicherheitsausnahme: Eigenschaften"}, | |
| 172 | + {"appletsecurityexception.checkpropsaccess.key", "Sicherheitsausnahme: Eigenschaftszugriff {0}"}, | |
| 173 | + {"appletsecurityexception.checkread.exception1", "Sicherheitsausnahme: {0}, {1}"}, | |
| 174 | + {"appletsecurityexception.checkread.exception2", "Sicherheitsausnahme: file.read: {0}"}, | |
| 175 | + {"appletsecurityexception.checkread", "Sicherheitsausnahme: file.read: {0} == {1}"}, | |
| 176 | + {"appletsecurityexception.checkwrite.exception", "Sicherheitsausnahme: {0}, {1}"}, | |
| 177 | + {"appletsecurityexception.checkwrite", "Sicherheitsausnahme: file.write: {0} == {1}"}, | |
| 178 | + {"appletsecurityexception.checkread.fd", "Sicherheitsausnahme: fd.read"}, | |
| 179 | + {"appletsecurityexception.checkwrite.fd", "Sicherheitsausnahme: fd.write"}, | |
| 180 | + {"appletsecurityexception.checklisten", "Sicherheitsausnahme: socket.listen: {0}"}, | |
| 181 | + {"appletsecurityexception.checkaccept", "Sicherheitsausnahme: socket.accept: {0}:{1}"}, | |
| 182 | + {"appletsecurityexception.checkconnect.networknone", "Sicherheitsausnahme: socket.connect: {0}->{1}"}, | |
| 183 | + {"appletsecurityexception.checkconnect.networkhost1", "Sicherheitsausnahme: Verbindung mit {0} mit Ursprung aus {1} konnte nicht hergestellt werden."}, | |
| 184 | + {"appletsecurityexception.checkconnect.networkhost2", "Sicherheitsausnahme: IP f\u00FCr Host {0} oder f\u00FCr {1} konnte nicht aufgel\u00F6st werden. "}, | |
| 185 | + {"appletsecurityexception.checkconnect.networkhost3", "Sicherheitsausnahme: IP f\u00FCr Host {0} konnte nicht aufgel\u00F6st werden. Siehe trustProxy-Eigenschaft."}, | |
| 186 | + {"appletsecurityexception.checkconnect", "Sicherheitsausnahme: Verbinden: {0}->{1}"}, | |
| 187 | + {"appletsecurityexception.checkpackageaccess", "Sicherheitsausnahme: Zugriff auf Package nicht m\u00F6glich: {0}"}, | |
| 188 | + {"appletsecurityexception.checkpackagedefinition", "Sicherheitsausnahme: Package kann nicht definiert werden: {0}"}, | |
| 189 | + {"appletsecurityexception.cannotsetfactory", "Sicherheitsausnahme: Factory kann nicht festgelegt werden"}, | |
| 190 | + {"appletsecurityexception.checkmemberaccess", "Sicherheitsausnahme: Mitgliedszugriff pr\u00FCfen"}, | |
| 191 | + {"appletsecurityexception.checkgetprintjob", "Sicherheitsausnahme: getPrintJob"}, | |
| 192 | + {"appletsecurityexception.checksystemclipboardaccess", "Sicherheitsausnahme: getSystemClipboard"}, | |
| 193 | + {"appletsecurityexception.checkawteventqueueaccess", "Sicherheitsausnahme: getEventQueue"}, | |
| 194 | + {"appletsecurityexception.checksecurityaccess", "Sicherheitsausnahme: Sicherheitsvorgang: {0}"}, | |
| 195 | + {"appletsecurityexception.getsecuritycontext.unknown", "Unbekannter Class Loader-Typ. Pr\u00FCfen auf getContext nicht m\u00F6glich"}, | |
| 196 | + {"appletsecurityexception.checkread.unknown", "Unbekannter Class Loader-Typ. Pr\u00FCfen auf checkRead {0} nicht m\u00F6glich"}, | |
| 197 | + {"appletsecurityexception.checkconnect.unknown", "Unbekannter Class Loader-Typ. Pr\u00FCfen auf checkConnect nicht m\u00F6glich"}, | |
| 198 | + }; | |
| 199 | + | |
| 200 | + return temp; | |
| 201 | + } | |
| 202 | +} | |
| @@ -0,0 +1,202 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1996, 2011, 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 | +package sun.applet.resources; | |
| 26 | + | |
| 27 | +import java.util.ListResourceBundle; | |
| 28 | + | |
| 29 | +public class MsgAppletViewer_es extends ListResourceBundle { | |
| 30 | + | |
| 31 | + public Object[][] getContents() { | |
| 32 | + Object[][] temp = new Object[][] { | |
| 33 | + {"textframe.button.dismiss", "Descartar"}, | |
| 34 | + {"appletviewer.tool.title", "Visor de Applet: {0}"}, | |
| 35 | + {"appletviewer.menu.applet", "Applet"}, | |
| 36 | + {"appletviewer.menuitem.restart", "Reiniciar"}, | |
| 37 | + {"appletviewer.menuitem.reload", "Volver a Cargar"}, | |
| 38 | + {"appletviewer.menuitem.stop", "Parar"}, | |
| 39 | + {"appletviewer.menuitem.save", "Guardar..."}, | |
| 40 | + {"appletviewer.menuitem.start", "Iniciar"}, | |
| 41 | + {"appletviewer.menuitem.clone", "Clonar..."}, | |
| 42 | + {"appletviewer.menuitem.tag", "Etiqueta..."}, | |
| 43 | + {"appletviewer.menuitem.info", "Informaci\u00F3n..."}, | |
| 44 | + {"appletviewer.menuitem.edit", "Editar"}, | |
| 45 | + {"appletviewer.menuitem.encoding", "Codificaci\u00F3n de Caracteres"}, | |
| 46 | + {"appletviewer.menuitem.print", "Imprimir..."}, | |
| 47 | + {"appletviewer.menuitem.props", "Propiedades..."}, | |
| 48 | + {"appletviewer.menuitem.close", "Cerrar"}, | |
| 49 | + {"appletviewer.menuitem.quit", "Salir"}, | |
| 50 | + {"appletviewer.label.hello", "Hola..."}, | |
| 51 | + {"appletviewer.status.start", "iniciando applet..."}, | |
| 52 | + {"appletviewer.appletsave.filedialogtitle","Serializar Applet en Archivo"}, | |
| 53 | + {"appletviewer.appletsave.err1", "serializando {0} en {1}"}, | |
| 54 | + {"appletviewer.appletsave.err2", "en appletSave: {0}"}, | |
| 55 | + {"appletviewer.applettag", "Etiqueta Mostrada"}, | |
| 56 | + {"appletviewer.applettag.textframe", "Etiqueta HTML de Applet"}, | |
| 57 | + {"appletviewer.appletinfo.applet", "-- ninguna informaci\u00F3n de applet --"}, | |
| 58 | + {"appletviewer.appletinfo.param", "-- ninguna informaci\u00F3n de par\u00E1metros --"}, | |
| 59 | + {"appletviewer.appletinfo.textframe", "Informaci\u00F3n del Applet"}, | |
| 60 | + {"appletviewer.appletprint.fail", "Fallo de impresi\u00F3n."}, | |
| 61 | + {"appletviewer.appletprint.finish", "Impresi\u00F3n terminada."}, | |
| 62 | + {"appletviewer.appletprint.cancel", "Impresi\u00F3n cancelada."}, | |
| 63 | + {"appletviewer.appletencoding", "Codificaci\u00F3n de Caracteres: {0}"}, | |
| 64 | + {"appletviewer.parse.warning.requiresname", "Advertencia: la etiqueta <param name=... value=...> requiere un atributo name."}, | |
| 65 | + {"appletviewer.parse.warning.paramoutside", "Advertencia: la etiqueta <param> est\u00E1 fuera de <applet> ... </applet>."}, | |
| 66 | + {"appletviewer.parse.warning.applet.requirescode", "Advertencia: la etiqueta <applet> requiere el atributo code."}, | |
| 67 | + {"appletviewer.parse.warning.applet.requiresheight", "Advertencia: la etiqueta <applet> requiere el atributo height."}, | |
| 68 | + {"appletviewer.parse.warning.applet.requireswidth", "Advertencia: la etiqueta <applet> requiere el atributo width."}, | |
| 69 | + {"appletviewer.parse.warning.object.requirescode", "Advertencia: la etiqueta <object> requiere el atributo code."}, | |
| 70 | + {"appletviewer.parse.warning.object.requiresheight", "Advertencia: la etiqueta <object> requiere el atributo height."}, | |
| 71 | + {"appletviewer.parse.warning.object.requireswidth", "Advertencia: la etiqueta <object> requiere el atributo width."}, | |
| 72 | + {"appletviewer.parse.warning.embed.requirescode", "Advertencia: la etiqueta <embed> requiere el atributo code."}, | |
| 73 | + {"appletviewer.parse.warning.embed.requiresheight", "Advertencia: la etiqueta <embed> requiere el atributo height."}, | |
| 74 | + {"appletviewer.parse.warning.embed.requireswidth", "Advertencia: la etiqueta <embed> requiere el atributo width."}, | |
| 75 | + {"appletviewer.parse.warning.appnotLongersupported", "Advertencia: la etiqueta <app> ya no est\u00E1 soportada, utilice <applet> en su lugar:"}, | |
| 76 | + {"appletviewer.usage", "Sintaxis: appletviewer <opciones> url(s)\n\ndonde <opciones> incluye:\n -debug Iniciar el visor de applet en el depurador Java\n -encoding <codificaci\u00F3n> Especificar la codificaci\u00F3n de caracteres utilizada por los archivos HTML\n -J<indicador de tiempo de ejecuci\u00F3n> Transferir argumento al int\u00E9rprete de Java\n\nLa opci\u00F3n -J es no est\u00E1ndar y est\u00E1 sujeta a cambios sin previo aviso."}, | |
| 77 | + {"appletviewer.main.err.unsupportedopt", "Opci\u00F3n no soportada: {0}"}, | |
| 78 | + {"appletviewer.main.err.unrecognizedarg", "Argumento no reconocido: {0}"}, | |
| 79 | + {"appletviewer.main.err.dupoption", "Uso duplicado de la opci\u00F3n: {0}"}, | |
| 80 | + {"appletviewer.main.err.inputfile", "No se ha especificado ning\u00FAn archivo de entrada."}, | |
| 81 | + {"appletviewer.main.err.badurl", "URL Err\u00F3nea: {0} ( {1} )"}, | |
| 82 | + {"appletviewer.main.err.io", "Excepci\u00F3n de E/S durante la lectura: {0}"}, | |
| 83 | + {"appletviewer.main.err.readablefile", "Aseg\u00FArese de que {0} es un archivo y que se puede leer."}, | |
| 84 | + {"appletviewer.main.err.correcturl", "\u00BFEs {0} la URL correcta?"}, | |
| 85 | + {"appletviewer.main.prop.store", "Propiedades Espec\u00EDficas del Usuario para AppletViewer"}, | |
| 86 | + {"appletviewer.main.err.prop.cantread", "No se puede leer el archivo de propiedades del usuario: {0}"}, | |
| 87 | + {"appletviewer.main.err.prop.cantsave", "No se puede guardar el archivo de propiedades del usuario: {0}"}, | |
| 88 | + {"appletviewer.main.warn.nosecmgr", "Advertencia: desactivando seguridad."}, | |
| 89 | + {"appletviewer.main.debug.cantfinddebug", "No se ha encontrado el depurador."}, | |
| 90 | + {"appletviewer.main.debug.cantfindmain", "No se ha encontrado el m\u00E9todo principal en el depurador."}, | |
| 91 | + {"appletviewer.main.debug.exceptionindebug", "Excepci\u00F3n en el depurador."}, | |
| 92 | + {"appletviewer.main.debug.cantaccess", "No se puede acceder al depurador."}, | |
| 93 | + {"appletviewer.main.nosecmgr", "Advertencia: no se ha instalado SecurityManager."}, | |
| 94 | + {"appletviewer.main.warning", "Advertencia: no se ha iniciado ning\u00FAn applet. Aseg\u00FArese de que la entrada contiene una etiqueta <applet>."}, | |
| 95 | + {"appletviewer.main.warn.prop.overwrite", "Advertencia: se sobrescribir\u00E1 temporalmente la propiedad del sistema cuando lo solicite el usuario: clave: {0} valor anterior: {1} nuevo valor: {2}"}, | |
| 96 | + {"appletviewer.main.warn.cantreadprops", "Advertencia: no se puede leer el archivo de propiedades de AppletViewer: {0}. Utilizando valores por defecto."}, | |
| 97 | + {"appletioexception.loadclass.throw.interrupted", "carga de clase interrumpida: {0}"}, | |
| 98 | + {"appletioexception.loadclass.throw.notloaded", "clase no cargada: {0}"}, | |
| 99 | + {"appletclassloader.loadcode.verbose", "Abriendo flujo a: {0} para obtener {1}"}, | |
| 100 | + {"appletclassloader.filenotfound", "No se ha encontrado el archivo al buscar: {0}"}, | |
| 101 | + {"appletclassloader.fileformat", "Excepci\u00F3n de formato de archivo al cargar: {0}"}, | |
| 102 | + {"appletclassloader.fileioexception", "Excepci\u00F3n de E/S al cargar: {0}"}, | |
| 103 | + {"appletclassloader.fileexception", "Excepci\u00F3n de {0} al cargar: {1}"}, | |
| 104 | + {"appletclassloader.filedeath", "{0} interrumpido al cargar: {1}"}, | |
| 105 | + {"appletclassloader.fileerror", "error de {0} al cargar: {1}"}, | |
| 106 | + {"appletclassloader.findclass.verbose.openstream", "Abriendo flujo a: {0} para obtener {1}"}, | |
| 107 | + {"appletclassloader.getresource.verbose.forname", "AppletClassLoader.getResource para nombre: {0}"}, | |
| 108 | + {"appletclassloader.getresource.verbose.found", "Recurso encontrado: {0} como un recurso de sistema"}, | |
| 109 | + {"appletclassloader.getresourceasstream.verbose", "Recurso encontrado: {0} como un recurso de sistema"}, | |
| 110 | + {"appletpanel.runloader.err", "Par\u00E1metro de c\u00F3digo u objeto."}, | |
| 111 | + {"appletpanel.runloader.exception", "excepci\u00F3n al deserializar {0}"}, | |
| 112 | + {"appletpanel.destroyed", "Applet destruido."}, | |
| 113 | + {"appletpanel.loaded", "Applet cargado."}, | |
| 114 | + {"appletpanel.started", "Applet iniciado."}, | |
| 115 | + {"appletpanel.inited", "Applet inicializado."}, | |
| 116 | + {"appletpanel.stopped", "Applet parado."}, | |
| 117 | + {"appletpanel.disposed", "Applet desechado."}, | |
| 118 | + {"appletpanel.nocode", "Falta el par\u00E1metro CODE en la etiqueta APPLET."}, | |
| 119 | + {"appletpanel.notfound", "cargar: clase {0} no encontrada."}, | |
| 120 | + {"appletpanel.nocreate", "cargar: {0} no se puede instanciar."}, | |
| 121 | + {"appletpanel.noconstruct", "cargar: {0} no es p\u00FAblico o no tiene un constructor p\u00FAblico."}, | |
| 122 | + {"appletpanel.death", "interrumpido"}, | |
| 123 | + {"appletpanel.exception", "excepci\u00F3n: {0}."}, | |
| 124 | + {"appletpanel.exception2", "excepci\u00F3n: {0}: {1}."}, | |
| 125 | + {"appletpanel.error", "error: {0}."}, | |
| 126 | + {"appletpanel.error2", "error: {0}: {1}."}, | |
| 127 | + {"appletpanel.notloaded", "Iniciaci\u00F3n: applet no cargado."}, | |
| 128 | + {"appletpanel.notinited", "Iniciar: applet no inicializado."}, | |
| 129 | + {"appletpanel.notstarted", "Parar: applet no iniciado."}, | |
| 130 | + {"appletpanel.notstopped", "Destruir: applet no parado."}, | |
| 131 | + {"appletpanel.notdestroyed", "Desechar: applet no destruido."}, | |
| 132 | + {"appletpanel.notdisposed", "Cargar: applet no desechado."}, | |
| 133 | + {"appletpanel.bail", "Interrumpido: rescatando."}, | |
| 134 | + {"appletpanel.filenotfound", "No se ha encontrado el archivo al buscar: {0}"}, | |
| 135 | + {"appletpanel.fileformat", "Excepci\u00F3n de formato de archivo al cargar: {0}"}, | |
| 136 | + {"appletpanel.fileioexception", "Excepci\u00F3n de E/S al cargar: {0}"}, | |
| 137 | + {"appletpanel.fileexception", "Excepci\u00F3n de {0} al cargar: {1}"}, | |
| 138 | + {"appletpanel.filedeath", "{0} interrumpido al cargar: {1}"}, | |
| 139 | + {"appletpanel.fileerror", "error de {0} al cargar: {1}"}, | |
| 140 | + {"appletpanel.badattribute.exception", "An\u00E1lisis HTML: valor incorrecto para el atributo width/height."}, | |
| 141 | + {"appletillegalargumentexception.objectinputstream", "AppletObjectInputStream requiere un cargador no nulo"}, | |
| 142 | + {"appletprops.title", "Propiedades de AppletViewer"}, | |
| 143 | + {"appletprops.label.http.server", "Servidor Proxy HTTP:"}, | |
| 144 | + {"appletprops.label.http.proxy", "Puerto Proxy HTTP:"}, | |
| 145 | + {"appletprops.label.network", "Acceso de Red:"}, | |
| 146 | + {"appletprops.choice.network.item.none", "Ninguno"}, | |
| 147 | + {"appletprops.choice.network.item.applethost", "Host del Applet"}, | |
| 148 | + {"appletprops.choice.network.item.unrestricted", "No Restringido"}, | |
| 149 | + {"appletprops.label.class", "Acceso de Clase:"}, | |
| 150 | + {"appletprops.choice.class.item.restricted", "Restringido"}, | |
| 151 | + {"appletprops.choice.class.item.unrestricted", "No Restringido"}, | |
| 152 | + {"appletprops.label.unsignedapplet", "Permitir Applets no Firmados:"}, | |
| 153 | + {"appletprops.choice.unsignedapplet.no", "No"}, | |
| 154 | + {"appletprops.choice.unsignedapplet.yes", "S\u00ED"}, | |
| 155 | + {"appletprops.button.apply", "Aplicar"}, | |
| 156 | + {"appletprops.button.cancel", "Cancelar"}, | |
| 157 | + {"appletprops.button.reset", "Restablecer"}, | |
| 158 | + {"appletprops.apply.exception", "Fallo al guardar las propiedades: {0}"}, | |
| 159 | + /* 4066432 */ | |
| 160 | + {"appletprops.title.invalidproxy", "Entrada no V\u00E1lida"}, | |
| 161 | + {"appletprops.label.invalidproxy", "El puerto proxy debe ser un valor entero positivo."}, | |
| 162 | + {"appletprops.button.ok", "Aceptar"}, | |
| 163 | + /* end 4066432 */ | |
| 164 | + {"appletprops.prop.store", "Propiedades espec\u00EDficas del usuario para AppletViewer"}, | |
| 165 | + {"appletsecurityexception.checkcreateclassloader", "Excepci\u00F3n de Seguridad: classloader"}, | |
| 166 | + {"appletsecurityexception.checkaccess.thread", "Excepci\u00F3n de Seguridad: thread"}, | |
| 167 | + {"appletsecurityexception.checkaccess.threadgroup", "Excepci\u00F3n de Seguridad: threadgroup: {0}"}, | |
| 168 | + {"appletsecurityexception.checkexit", "Excepci\u00F3n de Seguridad: salir: {0}"}, | |
| 169 | + {"appletsecurityexception.checkexec", "Excepci\u00F3n de Seguridad: ejecutar: {0}"}, | |
| 170 | + {"appletsecurityexception.checklink", "Excepci\u00F3n de Seguridad: enlace: {0}"}, | |
| 171 | + {"appletsecurityexception.checkpropsaccess", "Excepci\u00F3n de Seguridad: propiedades"}, | |
| 172 | + {"appletsecurityexception.checkpropsaccess.key", "Excepci\u00F3n de Seguridad: acceso a propiedades {0}"}, | |
| 173 | + {"appletsecurityexception.checkread.exception1", "Excepci\u00F3n de Seguridad: {0}, {1}"}, | |
| 174 | + {"appletsecurityexception.checkread.exception2", "Excepci\u00F3n de Seguridad: file.read: {0}"}, | |
| 175 | + {"appletsecurityexception.checkread", "Excepci\u00F3n de Seguridad: file.read: {0} == {1}"}, | |
| 176 | + {"appletsecurityexception.checkwrite.exception", "Excepci\u00F3n de Seguridad: {0}, {1}"}, | |
| 177 | + {"appletsecurityexception.checkwrite", "Excepci\u00F3n de Seguridad: file.write: {0} == {1}"}, | |
| 178 | + {"appletsecurityexception.checkread.fd", "Excepci\u00F3n de Seguridad: fd.read"}, | |
| 179 | + {"appletsecurityexception.checkwrite.fd", "Excepci\u00F3n de Seguridad: fd.write"}, | |
| 180 | + {"appletsecurityexception.checklisten", "Excepci\u00F3n de Seguridad: socket.listen: {0}"}, | |
| 181 | + {"appletsecurityexception.checkaccept", "Excepci\u00F3n de Seguridad: socket.accept: {0}:{1}"}, | |
| 182 | + {"appletsecurityexception.checkconnect.networknone", "Excepci\u00F3n de Seguridad: socket.connect: {0}->{1}"}, | |
| 183 | + {"appletsecurityexception.checkconnect.networkhost1", "Excepci\u00F3n de Seguridad: no se puede conectar a {0} con origen de {1}."}, | |
| 184 | + {"appletsecurityexception.checkconnect.networkhost2", "Excepci\u00F3n de Seguridad: no se puede resolver la IP para el host {0} o para {1}. "}, | |
| 185 | + {"appletsecurityexception.checkconnect.networkhost3", "Excepci\u00F3n de Seguridad: no se puede resolver la IP para el host {0}. Consulte la propiedad trustProxy."}, | |
| 186 | + {"appletsecurityexception.checkconnect", "Excepci\u00F3n de Seguridad: conexi\u00F3n: {0}->{1}"}, | |
| 187 | + {"appletsecurityexception.checkpackageaccess", "Excepci\u00F3n de Seguridad: no se puede acceder al paquete: {0}"}, | |
| 188 | + {"appletsecurityexception.checkpackagedefinition", "Excepci\u00F3n de Seguridad: no se puede definir el paquete: {0}"}, | |
| 189 | + {"appletsecurityexception.cannotsetfactory", "Excepci\u00F3n de Seguridad: no se puede definir el valor de f\u00E1brica"}, | |
| 190 | + {"appletsecurityexception.checkmemberaccess", "Excepci\u00F3n de Seguridad: comprobar el acceso de miembro"}, | |
| 191 | + {"appletsecurityexception.checkgetprintjob", "Excepci\u00F3n de Seguridad: getPrintJob"}, | |
| 192 | + {"appletsecurityexception.checksystemclipboardaccess", "Excepci\u00F3n de Seguridad: getSystemClipboard"}, | |
| 193 | + {"appletsecurityexception.checkawteventqueueaccess", "Excepci\u00F3n de Seguridad: getEventQueue"}, | |
| 194 | + {"appletsecurityexception.checksecurityaccess", "Excepci\u00F3n de Seguridad: operaci\u00F3n de seguridad: {0}"}, | |
| 195 | + {"appletsecurityexception.getsecuritycontext.unknown", "tipo de cargador de clase desconocido. no se puede comprobar para getContext"}, | |
| 196 | + {"appletsecurityexception.checkread.unknown", "tipo de cargador de clase desconocido. no se puede comprobar para lectura de comprobaci\u00F3n {0}"}, | |
| 197 | + {"appletsecurityexception.checkconnect.unknown", "tipo de cargador de clase desconocido. no se puede comprobar para conexi\u00F3n de comprobaci\u00F3n"}, | |
| 198 | + }; | |
| 199 | + | |
| 200 | + return temp; | |
| 201 | + } | |
| 202 | +} | |
| @@ -0,0 +1,202 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1996, 2011, 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 | +package sun.applet.resources; | |
| 26 | + | |
| 27 | +import java.util.ListResourceBundle; | |
| 28 | + | |
| 29 | +public class MsgAppletViewer_fr extends ListResourceBundle { | |
| 30 | + | |
| 31 | + public Object[][] getContents() { | |
| 32 | + Object[][] temp = new Object[][] { | |
| 33 | + {"textframe.button.dismiss", "Abandonner"}, | |
| 34 | + {"appletviewer.tool.title", "Visualiseur d''applets : {0}"}, | |
| 35 | + {"appletviewer.menu.applet", "Applet"}, | |
| 36 | + {"appletviewer.menuitem.restart", "Red\u00E9marrer"}, | |
| 37 | + {"appletviewer.menuitem.reload", "Recharger"}, | |
| 38 | + {"appletviewer.menuitem.stop", "Arr\u00EAter"}, | |
| 39 | + {"appletviewer.menuitem.save", "Enregistrer..."}, | |
| 40 | + {"appletviewer.menuitem.start", "D\u00E9marrer"}, | |
| 41 | + {"appletviewer.menuitem.clone", "Cloner..."}, | |
| 42 | + {"appletviewer.menuitem.tag", "Baliser..."}, | |
| 43 | + {"appletviewer.menuitem.info", "Informations..."}, | |
| 44 | + {"appletviewer.menuitem.edit", "Modifier"}, | |
| 45 | + {"appletviewer.menuitem.encoding", "Encodage de caract\u00E8res"}, | |
| 46 | + {"appletviewer.menuitem.print", "Imprimer..."}, | |
| 47 | + {"appletviewer.menuitem.props", "Propri\u00E9t\u00E9s..."}, | |
| 48 | + {"appletviewer.menuitem.close", "Fermer"}, | |
| 49 | + {"appletviewer.menuitem.quit", "Quitter"}, | |
| 50 | + {"appletviewer.label.hello", "Bonjour..."}, | |
| 51 | + {"appletviewer.status.start", "d\u00E9marrage de l'applet..."}, | |
| 52 | + {"appletviewer.appletsave.filedialogtitle","S\u00E9rialiser l'applet dans le fichier"}, | |
| 53 | + {"appletviewer.appletsave.err1", "S\u00E9rialisation de {0} vers {1}"}, | |
| 54 | + {"appletviewer.appletsave.err2", "dans appletSave : {0}"}, | |
| 55 | + {"appletviewer.applettag", "Balise affich\u00E9e"}, | |
| 56 | + {"appletviewer.applettag.textframe", "Balise HTML d'applet"}, | |
| 57 | + {"appletviewer.appletinfo.applet", "-- aucune information d'applet --"}, | |
| 58 | + {"appletviewer.appletinfo.param", "-- aucune information de param\u00E8tre --"}, | |
| 59 | + {"appletviewer.appletinfo.textframe", "Informations d'applet"}, | |
| 60 | + {"appletviewer.appletprint.fail", "Echec de l'impression."}, | |
| 61 | + {"appletviewer.appletprint.finish", "Impression termin\u00E9e."}, | |
| 62 | + {"appletviewer.appletprint.cancel", "Impression annul\u00E9e."}, | |
| 63 | + {"appletviewer.appletencoding", "Encodage de caract\u00E8res : {0}"}, | |
| 64 | + {"appletviewer.parse.warning.requiresname", "Avertissement : la balise <param name=... value=...> requiert un attribut de nom."}, | |
| 65 | + {"appletviewer.parse.warning.paramoutside", "Avertissement : la balise <param> est en dehors des balises <applet> ... </applet>."}, | |
| 66 | + {"appletviewer.parse.warning.applet.requirescode", "Avertissement : la balise <applet> requiert un attribut de code."}, | |
| 67 | + {"appletviewer.parse.warning.applet.requiresheight", "Avertissement : la balise <applet> requiert un attribut de hauteur."}, | |
| 68 | + {"appletviewer.parse.warning.applet.requireswidth", "Avertissement : la balise <applet> requiert un attribut de largeur."}, | |
| 69 | + {"appletviewer.parse.warning.object.requirescode", "Avertissement : la balise <object> requiert un attribut de code."}, | |
| 70 | + {"appletviewer.parse.warning.object.requiresheight", "Avertissement : la balise <object> requiert un attribut de hauteur."}, | |
| 71 | + {"appletviewer.parse.warning.object.requireswidth", "Avertissement : la balise <object> requiert un attribut de largeur."}, | |
| 72 | + {"appletviewer.parse.warning.embed.requirescode", "Avertissement : la balise <embed> requiert un attribut de code."}, | |
| 73 | + {"appletviewer.parse.warning.embed.requiresheight", "Avertissement : la balise <embed> requiert un attribut de hauteur."}, | |
| 74 | + {"appletviewer.parse.warning.embed.requireswidth", "Avertissement : la balise <embed> requiert un attribut de largeur."}, | |
| 75 | + {"appletviewer.parse.warning.appnotLongersupported", "Avertissement : la balise <app> n'est plus prise en charge, utilisez <applet> \u00E0 la place :"}, | |
| 76 | + {"appletviewer.usage", "Syntaxe : appletviewer <options> url(s)\n\no\u00F9 <options> inclut :\n -debug D\u00E9marrer le visualiseur d'applets dans le d\u00E9bogueur Java\n -encoding <encoding> Indiquer l'encodage de caract\u00E8res utilis\u00E9 par les fichiers HTML\n -J<runtime flag> Transmettre l'argument \u00E0 l'interpr\u00E9teur Java\n\nL'option -J n'est pas standard et elle peut \u00EAtre modifi\u00E9e sans pr\u00E9avis."}, | |
| 77 | + {"appletviewer.main.err.unsupportedopt", "Option non prise en charge : {0}"}, | |
| 78 | + {"appletviewer.main.err.unrecognizedarg", "Argument non reconnu : {0}"}, | |
| 79 | + {"appletviewer.main.err.dupoption", "Utilisation en double de l''option : {0}"}, | |
| 80 | + {"appletviewer.main.err.inputfile", "Aucun fichier d'entr\u00E9e indiqu\u00E9."}, | |
| 81 | + {"appletviewer.main.err.badurl", "URL incorrecte : {0} ({1})"}, | |
| 82 | + {"appletviewer.main.err.io", "Exception d''E/S lors de la lecture : {0}"}, | |
| 83 | + {"appletviewer.main.err.readablefile", "Assurez-vous que {0} est un fichier accessible en lecture."}, | |
| 84 | + {"appletviewer.main.err.correcturl", "L''\u00E9l\u00E9ment {0} est-il l''URL correcte ?"}, | |
| 85 | + {"appletviewer.main.prop.store", "Propri\u00E9t\u00E9s utilisateur pour AppletViewer"}, | |
| 86 | + {"appletviewer.main.err.prop.cantread", "Impossible de lire le fichier de propri\u00E9t\u00E9s utilisateur : {0}"}, | |
| 87 | + {"appletviewer.main.err.prop.cantsave", "Impossible d''enregistrer le fichier de propri\u00E9t\u00E9s utilisateur : {0}"}, | |
| 88 | + {"appletviewer.main.warn.nosecmgr", "Avertissement : d\u00E9sactivation de la s\u00E9curit\u00E9."}, | |
| 89 | + {"appletviewer.main.debug.cantfinddebug", "D\u00E9bogueur introuvable."}, | |
| 90 | + {"appletviewer.main.debug.cantfindmain", "La m\u00E9thode principale est introuvable dans le d\u00E9bogueur."}, | |
| 91 | + {"appletviewer.main.debug.exceptionindebug", "Exception d\u00E9tect\u00E9e dans le d\u00E9bogueur."}, | |
| 92 | + {"appletviewer.main.debug.cantaccess", "Impossible d'acc\u00E9der au d\u00E9bogueur."}, | |
| 93 | + {"appletviewer.main.nosecmgr", "Avertissement : SecurityManager n'est pas install\u00E9."}, | |
| 94 | + {"appletviewer.main.warning", "Avertissement : aucune applet n'a \u00E9t\u00E9 d\u00E9marr\u00E9e. Assurez-vous que l'entr\u00E9e contient une balise <applet>."}, | |
| 95 | + {"appletviewer.main.warn.prop.overwrite", "Avertissement : remplacement temporaire de la propri\u00E9t\u00E9 syst\u00E8me \u00E0 la demande de l''utilisateur - Cl\u00E9 : {0}, ancienne valeur : {1}, nouvelle valeur : {2}"}, | |
| 96 | + {"appletviewer.main.warn.cantreadprops", "Avertissement : impossible de lire le fichier de propri\u00E9t\u00E9s d''AppletViewer : {0} Utilisation des valeurs par d\u00E9faut."}, | |
| 97 | + {"appletioexception.loadclass.throw.interrupted", "chargement de classe interrompu : {0}"}, | |
| 98 | + {"appletioexception.loadclass.throw.notloaded", "classe non charg\u00E9e : {0}"}, | |
| 99 | + {"appletclassloader.loadcode.verbose", "Ouverture du flux de donn\u00E9es dans {0} pour obtenir {1}"}, | |
| 100 | + {"appletclassloader.filenotfound", "Fichier introuvable lors de la recherche de {0}"}, | |
| 101 | + {"appletclassloader.fileformat", "Exception de format de fichier d\u00E9tect\u00E9e lors du chargement de : {0}"}, | |
| 102 | + {"appletclassloader.fileioexception", "Exception d''E/S lors du chargement de : {0}"}, | |
| 103 | + {"appletclassloader.fileexception", "Exception {0} lors du chargement de : {1}"}, | |
| 104 | + {"appletclassloader.filedeath", "Fermeture de {0} lors du chargement de : {1}"}, | |
| 105 | + {"appletclassloader.fileerror", "Erreur {0} lors du chargement de : {1}"}, | |
| 106 | + {"appletclassloader.findclass.verbose.openstream", "Ouverture du flux de donn\u00E9es dans {0} pour obtenir {1}"}, | |
| 107 | + {"appletclassloader.getresource.verbose.forname", "AppletClassLoader.getResource pour le nom : {0}"}, | |
| 108 | + {"appletclassloader.getresource.verbose.found", "Ressource {0} trouv\u00E9e en tant que ressource syst\u00E8me"}, | |
| 109 | + {"appletclassloader.getresourceasstream.verbose", "Ressource {0} trouv\u00E9e en tant que ressource syst\u00E8me"}, | |
| 110 | + {"appletpanel.runloader.err", "Param\u00E8tre d'objet ou de code."}, | |
| 111 | + {"appletpanel.runloader.exception", "exception lors de la d\u00E9s\u00E9rialisation de {0}"}, | |
| 112 | + {"appletpanel.destroyed", "Applet d\u00E9truite."}, | |
| 113 | + {"appletpanel.loaded", "Applet charg\u00E9e."}, | |
| 114 | + {"appletpanel.started", "Applet d\u00E9marr\u00E9e."}, | |
| 115 | + {"appletpanel.inited", "Applet initialis\u00E9e."}, | |
| 116 | + {"appletpanel.stopped", "Applet arr\u00EAt\u00E9e."}, | |
| 117 | + {"appletpanel.disposed", "Applet \u00E9limin\u00E9e."}, | |
| 118 | + {"appletpanel.nocode", "Param\u00E8tre CODE manquant dans la balise APPLET."}, | |
| 119 | + {"appletpanel.notfound", "Charger : la classe {0} est introuvable."}, | |
| 120 | + {"appletpanel.nocreate", "Charger : impossible d''instantier {0}."}, | |
| 121 | + {"appletpanel.noconstruct", "Charger : l''\u00E9l\u00E9ment {0} n''est pas public ou ne poss\u00E8de aucun constructeur public."}, | |
| 122 | + {"appletpanel.death", "arr\u00EAt\u00E9"}, | |
| 123 | + {"appletpanel.exception", "exception : {0}."}, | |
| 124 | + {"appletpanel.exception2", "exception : {0} : {1}."}, | |
| 125 | + {"appletpanel.error", "erreur : {0}."}, | |
| 126 | + {"appletpanel.error2", "erreur : {0} : {1}."}, | |
| 127 | + {"appletpanel.notloaded", "Initialiser : applet non charg\u00E9e."}, | |
| 128 | + {"appletpanel.notinited", "D\u00E9marrer : applet non initialis\u00E9e."}, | |
| 129 | + {"appletpanel.notstarted", "Arr\u00EAter : applet non d\u00E9marr\u00E9e."}, | |
| 130 | + {"appletpanel.notstopped", "D\u00E9truire : applet non arr\u00EAt\u00E9e."}, | |
| 131 | + {"appletpanel.notdestroyed", "Eliminer : applet non d\u00E9truite."}, | |
| 132 | + {"appletpanel.notdisposed", "Charger : applet non \u00E9limin\u00E9e."}, | |
| 133 | + {"appletpanel.bail", "Interrompu : r\u00E9solution."}, | |
| 134 | + {"appletpanel.filenotfound", "Fichier introuvable lors de la recherche de {0}"}, | |
| 135 | + {"appletpanel.fileformat", "Exception de format de fichier d\u00E9tect\u00E9e lors du chargement de : {0}"}, | |
| 136 | + {"appletpanel.fileioexception", "Exception d''E/S lors du chargement de : {0}"}, | |
| 137 | + {"appletpanel.fileexception", "Exception {0} lors du chargement de : {1}"}, | |
| 138 | + {"appletpanel.filedeath", "Fermeture de {0} lors du chargement de : {1}"}, | |
| 139 | + {"appletpanel.fileerror", "Erreur {0} lors du chargement de : {1}"}, | |
| 140 | + {"appletpanel.badattribute.exception", "Analyse HTML : valeur incorrecte pour l'attribut de largeur/hauteur"}, | |
| 141 | + {"appletillegalargumentexception.objectinputstream", "AppletObjectInputStream requiert un chargeur non NULL"}, | |
| 142 | + {"appletprops.title", "Propri\u00E9t\u00E9s d'AppletViewer"}, | |
| 143 | + {"appletprops.label.http.server", "Serveur proxy HTTP :"}, | |
| 144 | + {"appletprops.label.http.proxy", "Port proxy HTTP :"}, | |
| 145 | + {"appletprops.label.network", "Acc\u00E8s au r\u00E9seau :"}, | |
| 146 | + {"appletprops.choice.network.item.none", "Aucun"}, | |
| 147 | + {"appletprops.choice.network.item.applethost", "H\u00F4te de l'applet"}, | |
| 148 | + {"appletprops.choice.network.item.unrestricted", "Sans restriction"}, | |
| 149 | + {"appletprops.label.class", "Acc\u00E8s \u00E0 la classe :"}, | |
| 150 | + {"appletprops.choice.class.item.restricted", "Avec restriction"}, | |
| 151 | + {"appletprops.choice.class.item.unrestricted", "Sans restriction"}, | |
| 152 | + {"appletprops.label.unsignedapplet", "Autoriser les applets non sign\u00E9es :"}, | |
| 153 | + {"appletprops.choice.unsignedapplet.no", "Non"}, | |
| 154 | + {"appletprops.choice.unsignedapplet.yes", "Oui"}, | |
| 155 | + {"appletprops.button.apply", "Appliquer"}, | |
| 156 | + {"appletprops.button.cancel", "Annuler"}, | |
| 157 | + {"appletprops.button.reset", "R\u00E9initialiser"}, | |
| 158 | + {"appletprops.apply.exception", "Echec de l''enregistrement des propri\u00E9t\u00E9s : {0}"}, | |
| 159 | + /* 4066432 */ | |
| 160 | + {"appletprops.title.invalidproxy", "Entr\u00E9e non valide"}, | |
| 161 | + {"appletprops.label.invalidproxy", "Le port proxy doit \u00EAtre un entier positif."}, | |
| 162 | + {"appletprops.button.ok", "OK"}, | |
| 163 | + /* end 4066432 */ | |
| 164 | + {"appletprops.prop.store", "Propri\u00E9t\u00E9s utilisateur pour AppletViewer"}, | |
| 165 | + {"appletsecurityexception.checkcreateclassloader", "Exception de s\u00E9curit\u00E9 : chargeur de classe"}, | |
| 166 | + {"appletsecurityexception.checkaccess.thread", "Exception de s\u00E9curit\u00E9 : thread"}, | |
| 167 | + {"appletsecurityexception.checkaccess.threadgroup", "Exception de s\u00E9curit\u00E9 : groupe de threads : {0}"}, | |
| 168 | + {"appletsecurityexception.checkexit", "Exception de s\u00E9curit\u00E9 : sortie : {0}"}, | |
| 169 | + {"appletsecurityexception.checkexec", "Exception de s\u00E9curit\u00E9 : ex\u00E9cution : {0}"}, | |
| 170 | + {"appletsecurityexception.checklink", "Exception de s\u00E9curit\u00E9 : lien : {0}"}, | |
| 171 | + {"appletsecurityexception.checkpropsaccess", "Exception de s\u00E9curit\u00E9 : propri\u00E9t\u00E9s"}, | |
| 172 | + {"appletsecurityexception.checkpropsaccess.key", "Exception de s\u00E9curit\u00E9 : acc\u00E8s aux propri\u00E9t\u00E9s {0}"}, | |
| 173 | + {"appletsecurityexception.checkread.exception1", "Exception de s\u00E9curit\u00E9 : {0}, {1}"}, | |
| 174 | + {"appletsecurityexception.checkread.exception2", "Exception de s\u00E9curit\u00E9 : file.read : {0}"}, | |
| 175 | + {"appletsecurityexception.checkread", "Exception de s\u00E9curit\u00E9 : file.read : {0} == {1}"}, | |
| 176 | + {"appletsecurityexception.checkwrite.exception", "Exception de s\u00E9curit\u00E9 : {0}, {1}"}, | |
| 177 | + {"appletsecurityexception.checkwrite", "Exception de s\u00E9curit\u00E9 : file.write : {0} == {1}"}, | |
| 178 | + {"appletsecurityexception.checkread.fd", "Exception de s\u00E9curit\u00E9 : fd.read"}, | |
| 179 | + {"appletsecurityexception.checkwrite.fd", "Exception de s\u00E9curit\u00E9 : fd.write"}, | |
| 180 | + {"appletsecurityexception.checklisten", "Exception de s\u00E9curit\u00E9 : socket.listen : {0}"}, | |
| 181 | + {"appletsecurityexception.checkaccept", "Exception de s\u00E9curit\u00E9 : socket.accept : {0} : {1}"}, | |
| 182 | + {"appletsecurityexception.checkconnect.networknone", "Exception de s\u00E9curit\u00E9 : socket.connect : {0} -> {1}"}, | |
| 183 | + {"appletsecurityexception.checkconnect.networkhost1", "Exception de s\u00E9curit\u00E9 : impossible de se connecter \u00E0 {0} dont l''origine est {1}."}, | |
| 184 | + {"appletsecurityexception.checkconnect.networkhost2", "Exception de s\u00E9curit\u00E9 : impossible de r\u00E9soudre l''adresse IP pour l''h\u00F4te {0} ou pour {1}. "}, | |
| 185 | + {"appletsecurityexception.checkconnect.networkhost3", "Exception de s\u00E9curit\u00E9 : impossible de r\u00E9soudre l''adresse IP pour l''h\u00F4te {0}. Voir la propri\u00E9t\u00E9 trustProxy."}, | |
| 186 | + {"appletsecurityexception.checkconnect", "Exception de s\u00E9curit\u00E9 : connexion : {0} -> {1}"}, | |
| 187 | + {"appletsecurityexception.checkpackageaccess", "Exception de s\u00E9curit\u00E9 : impossible d''acc\u00E9der au package : {0}"}, | |
| 188 | + {"appletsecurityexception.checkpackagedefinition", "Exception de s\u00E9curit\u00E9 : impossible de d\u00E9finir le package : {0}"}, | |
| 189 | + {"appletsecurityexception.cannotsetfactory", "Exception de s\u00E9curit\u00E9 : impossible de d\u00E9finir la fabrique"}, | |
| 190 | + {"appletsecurityexception.checkmemberaccess", "Exception de s\u00E9curit\u00E9 : v\u00E9rifier l'acc\u00E8s des membres"}, | |
| 191 | + {"appletsecurityexception.checkgetprintjob", "Exception de s\u00E9curit\u00E9 : getPrintJob"}, | |
| 192 | + {"appletsecurityexception.checksystemclipboardaccess", "Exception de s\u00E9curit\u00E9 : getSystemClipboard"}, | |
| 193 | + {"appletsecurityexception.checkawteventqueueaccess", "Exception de s\u00E9curit\u00E9 : getEventQueue"}, | |
| 194 | + {"appletsecurityexception.checksecurityaccess", "Exception de s\u00E9curit\u00E9 : op\u00E9ration de s\u00E9curit\u00E9 : {0}"}, | |
| 195 | + {"appletsecurityexception.getsecuritycontext.unknown", "type de chargeur de classe inconnu, impossible de rechercher getContext"}, | |
| 196 | + {"appletsecurityexception.checkread.unknown", "type de chargeur de classe inconnu, impossible de rechercher la v\u00E9rification de lecture {0}"}, | |
| 197 | + {"appletsecurityexception.checkconnect.unknown", "type de chargeur de classe inconnu, impossible de rechercher la v\u00E9rification de connexion"}, | |
| 198 | + }; | |
| 199 | + | |
| 200 | + return temp; | |
| 201 | + } | |
| 202 | +} | |
| @@ -0,0 +1,202 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1996, 2011, 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 | +package sun.applet.resources; | |
| 26 | + | |
| 27 | +import java.util.ListResourceBundle; | |
| 28 | + | |
| 29 | +public class MsgAppletViewer_it extends ListResourceBundle { | |
| 30 | + | |
| 31 | + public Object[][] getContents() { | |
| 32 | + Object[][] temp = new Object[][] { | |
| 33 | + {"textframe.button.dismiss", "Chiudi"}, | |
| 34 | + {"appletviewer.tool.title", "Visualizzatore applet: {0}"}, | |
| 35 | + {"appletviewer.menu.applet", "Applet"}, | |
| 36 | + {"appletviewer.menuitem.restart", "Riavvia"}, | |
| 37 | + {"appletviewer.menuitem.reload", "Ricarica"}, | |
| 38 | + {"appletviewer.menuitem.stop", "Arresta"}, | |
| 39 | + {"appletviewer.menuitem.save", "Salva..."}, | |
| 40 | + {"appletviewer.menuitem.start", "Avvia"}, | |
| 41 | + {"appletviewer.menuitem.clone", "Copia..."}, | |
| 42 | + {"appletviewer.menuitem.tag", "Tag..."}, | |
| 43 | + {"appletviewer.menuitem.info", "Informazioni..."}, | |
| 44 | + {"appletviewer.menuitem.edit", "Modifica"}, | |
| 45 | + {"appletviewer.menuitem.encoding", "Codifica caratteri"}, | |
| 46 | + {"appletviewer.menuitem.print", "Stampa..."}, | |
| 47 | + {"appletviewer.menuitem.props", "Propriet\u00E0..."}, | |
| 48 | + {"appletviewer.menuitem.close", "Chiudi"}, | |
| 49 | + {"appletviewer.menuitem.quit", "Esci"}, | |
| 50 | + {"appletviewer.label.hello", "Benvenuti..."}, | |
| 51 | + {"appletviewer.status.start", "avvio applet in corso..."}, | |
| 52 | + {"appletviewer.appletsave.filedialogtitle","Serializza applet in file"}, | |
| 53 | + {"appletviewer.appletsave.err1", "serializzazione di {0} in {1}"}, | |
| 54 | + {"appletviewer.appletsave.err2", "in appletSave: {0}"}, | |
| 55 | + {"appletviewer.applettag", "Tag visualizzata"}, | |
| 56 | + {"appletviewer.applettag.textframe", "Applet tag HTML"}, | |
| 57 | + {"appletviewer.appletinfo.applet", "-- nessuna informazione sull'applet --"}, | |
| 58 | + {"appletviewer.appletinfo.param", "-- nessuna informazione sul parametro --"}, | |
| 59 | + {"appletviewer.appletinfo.textframe", "Informazioni applet"}, | |
| 60 | + {"appletviewer.appletprint.fail", "Stampa non riuscita."}, | |
| 61 | + {"appletviewer.appletprint.finish", "Stampa completata."}, | |
| 62 | + {"appletviewer.appletprint.cancel", "Stampa annullata."}, | |
| 63 | + {"appletviewer.appletencoding", "Codifica caratteri: {0}"}, | |
| 64 | + {"appletviewer.parse.warning.requiresname", "Avvertenza: la tag <param name=... value=...> richiede un attributo name."}, | |
| 65 | + {"appletviewer.parse.warning.paramoutside", "Avvertenza: la tag <param> non rientra in <applet>... </applet>."}, | |
| 66 | + {"appletviewer.parse.warning.applet.requirescode", "Avvertenza: la tag <applet> richiede un attributo code."}, | |
| 67 | + {"appletviewer.parse.warning.applet.requiresheight", "Avvertenza: la tag <applet> richiede un attributo height."}, | |
| 68 | + {"appletviewer.parse.warning.applet.requireswidth", "Avvertenza: la tag <applet> richiede un attributo width."}, | |
| 69 | + {"appletviewer.parse.warning.object.requirescode", "Avvertenza: la tag <object> richiede un attributo code."}, | |
| 70 | + {"appletviewer.parse.warning.object.requiresheight", "Avvertenza: la tag <object> richiede un attributo height."}, | |
| 71 | + {"appletviewer.parse.warning.object.requireswidth", "Avvertenza: la tag <object> richiede un attributo width."}, | |
| 72 | + {"appletviewer.parse.warning.embed.requirescode", "Avvertenza: la tag <embed> richiede un attributo code."}, | |
| 73 | + {"appletviewer.parse.warning.embed.requiresheight", "Avvertenza: la tag <embed> richiede un attributo height."}, | |
| 74 | + {"appletviewer.parse.warning.embed.requireswidth", "Avvertenza: la tag <embed> richiede un attributo width."}, | |
| 75 | + {"appletviewer.parse.warning.appnotLongersupported", "Avvertenza: la tag <app> non \u00E8 pi\u00F9 supportata. Utilizzare <applet>:"}, | |
| 76 | + {"appletviewer.usage", "Uso: appletviewer <opzioni> url(s)\n\ndove <opzioni> includono:\n -debug Avvia il visualizzatore applet nel debugger Java\n -encoding <codifica> Specifica la codifica dei caratteri utilizzata dai file HTML\n -J<flag runtime> Passa l'argomento all'interpreter Java\n\nL'opzione -J non \u00E8 standard ed \u00E8 soggetta a modifica senza preavviso."}, | |
| 77 | + {"appletviewer.main.err.unsupportedopt", "Opzione non supportata: {0}"}, | |
| 78 | + {"appletviewer.main.err.unrecognizedarg", "Argomento non riconosciuto: {0}"}, | |
| 79 | + {"appletviewer.main.err.dupoption", "Uso duplicato dell''opzione: {0}"}, | |
| 80 | + {"appletviewer.main.err.inputfile", "Nessun file di input specificato."}, | |
| 81 | + {"appletviewer.main.err.badurl", "URL non valido: {0} ( {1} )"}, | |
| 82 | + {"appletviewer.main.err.io", "Eccezione I/O durante la lettura di {0}"}, | |
| 83 | + {"appletviewer.main.err.readablefile", "Assicurarsi che {0} sia un file e che sia leggibile."}, | |
| 84 | + {"appletviewer.main.err.correcturl", "{0} \u00E8 l''URL corretto?"}, | |
| 85 | + {"appletviewer.main.prop.store", "Propriet\u00E0 specifiche dell'utente per AppletViewer"}, | |
| 86 | + {"appletviewer.main.err.prop.cantread", "Impossibile leggere il file delle propriet\u00E0 utente: {0}"}, | |
| 87 | + {"appletviewer.main.err.prop.cantsave", "Impossibile salvare il file delle propriet\u00E0 utente: {0}"}, | |
| 88 | + {"appletviewer.main.warn.nosecmgr", "Avvertenza: la sicurezza verr\u00E0 disabilitata."}, | |
| 89 | + {"appletviewer.main.debug.cantfinddebug", "Impossibile trovare il debugger."}, | |
| 90 | + {"appletviewer.main.debug.cantfindmain", "Impossibile trovare il metodo principale nel debugger."}, | |
| 91 | + {"appletviewer.main.debug.exceptionindebug", "Eccezione nel debugger."}, | |
| 92 | + {"appletviewer.main.debug.cantaccess", "Impossibile accedere al debugger."}, | |
| 93 | + {"appletviewer.main.nosecmgr", "Avvertenza: SecurityManager non installato."}, | |
| 94 | + {"appletviewer.main.warning", "Avvertenza: nessuna applet avviata. Assicurarsi che l'input contenga una tag <applet>."}, | |
| 95 | + {"appletviewer.main.warn.prop.overwrite", "Avvertenza: la propriet\u00E0 di sistema verr\u00E0 sovrascritta temporaneamente su richiesta dell''utente. Chiave {0}, valore precedente {1}, nuovo valore {2}."}, | |
| 96 | + {"appletviewer.main.warn.cantreadprops", "Avvertenza: impossibile leggere il file delle propriet\u00E0 AppletViewer {0}. Verranno utilizzate le impostazioni predefinite."}, | |
| 97 | + {"appletioexception.loadclass.throw.interrupted", "caricamento della classe interrotto: {0}"}, | |
| 98 | + {"appletioexception.loadclass.throw.notloaded", "classe non caricata: {0}"}, | |
| 99 | + {"appletclassloader.loadcode.verbose", "Apertura del flusso per {0} per recuperare {1}"}, | |
| 100 | + {"appletclassloader.filenotfound", "File non trovato durante la ricerca di {0}"}, | |
| 101 | + {"appletclassloader.fileformat", "Eccezione di formato file durante il caricamento di {0}"}, | |
| 102 | + {"appletclassloader.fileioexception", "Eccezione I/O durante il caricamento di {0}"}, | |
| 103 | + {"appletclassloader.fileexception", "Eccezione {0} durante il caricamento di {1}"}, | |
| 104 | + {"appletclassloader.filedeath", "{0} terminato durante il caricamento di {1}"}, | |
| 105 | + {"appletclassloader.fileerror", "Errore {0} durante il caricamento di {1}"}, | |
| 106 | + {"appletclassloader.findclass.verbose.openstream", "Apertura del flusso per {0} per recuperare {1}"}, | |
| 107 | + {"appletclassloader.getresource.verbose.forname", "AppletClassLoader.getResource per il nome: {0}"}, | |
| 108 | + {"appletclassloader.getresource.verbose.found", "\u00C8 stata trovata la risorsa {0} come risorsa di sistema"}, | |
| 109 | + {"appletclassloader.getresourceasstream.verbose", "\u00C8 stata trovata la risorsa {0} come risorsa di sistema"}, | |
| 110 | + {"appletpanel.runloader.err", "Parametro di oggetto o di codice."}, | |
| 111 | + {"appletpanel.runloader.exception", "eccezione durante la deserializzazione di {0}"}, | |
| 112 | + {"appletpanel.destroyed", "Applet rimossa."}, | |
| 113 | + {"appletpanel.loaded", "Applet caricata."}, | |
| 114 | + {"appletpanel.started", "Applet avviata."}, | |
| 115 | + {"appletpanel.inited", "Applet inizializzata."}, | |
| 116 | + {"appletpanel.stopped", "Applet arrestata."}, | |
| 117 | + {"appletpanel.disposed", "Applet eliminata."}, | |
| 118 | + {"appletpanel.nocode", "Nella tag APPLET manca il parametro CODE."}, | |
| 119 | + {"appletpanel.notfound", "caricamento: classe {0} non trovata."}, | |
| 120 | + {"appletpanel.nocreate", "caricamento: impossibile creare un''istanza di {0}."}, | |
| 121 | + {"appletpanel.noconstruct", "caricamento: {0} non \u00E8 pubblico o non ha un costruttore pubblico."}, | |
| 122 | + {"appletpanel.death", "terminato"}, | |
| 123 | + {"appletpanel.exception", "eccezione: {0}"}, | |
| 124 | + {"appletpanel.exception2", "eccezione: {0}: {1}."}, | |
| 125 | + {"appletpanel.error", "errore: {0}."}, | |
| 126 | + {"appletpanel.error2", "errore: {0}: {1}."}, | |
| 127 | + {"appletpanel.notloaded", "Inizializzazione: applet non caricata."}, | |
| 128 | + {"appletpanel.notinited", "Avvio: applet non inizializzata."}, | |
| 129 | + {"appletpanel.notstarted", "Arresto: applet non avviata."}, | |
| 130 | + {"appletpanel.notstopped", "Rimozione: applet non arrestata."}, | |
| 131 | + {"appletpanel.notdestroyed", "Eliminazione: applet non rimossa."}, | |
| 132 | + {"appletpanel.notdisposed", "Caricamento: applet non eliminata."}, | |
| 133 | + {"appletpanel.bail", "Interrotto: chiusura."}, | |
| 134 | + {"appletpanel.filenotfound", "File non trovato durante la ricerca di {0}"}, | |
| 135 | + {"appletpanel.fileformat", "Eccezione di formato file durante il caricamento di {0}"}, | |
| 136 | + {"appletpanel.fileioexception", "Eccezione I/O durante il caricamento di {0}"}, | |
| 137 | + {"appletpanel.fileexception", "Eccezione {0} durante il caricamento di {1}"}, | |
| 138 | + {"appletpanel.filedeath", "{0} terminato durante il caricamento di {1}"}, | |
| 139 | + {"appletpanel.fileerror", "Errore {0} durante il caricamento di {1}"}, | |
| 140 | + {"appletpanel.badattribute.exception", "Analisi HTML: valore errato per l'attributo width/height"}, | |
| 141 | + {"appletillegalargumentexception.objectinputstream", "AppletObjectInputStream richiede un loader non nullo"}, | |
| 142 | + {"appletprops.title", "Propriet\u00E0 AppletViewer"}, | |
| 143 | + {"appletprops.label.http.server", "Server proxy http:"}, | |
| 144 | + {"appletprops.label.http.proxy", "Porta proxy http:"}, | |
| 145 | + {"appletprops.label.network", "Accesso alla rete:"}, | |
| 146 | + {"appletprops.choice.network.item.none", "Nessuno"}, | |
| 147 | + {"appletprops.choice.network.item.applethost", "Host applet"}, | |
| 148 | + {"appletprops.choice.network.item.unrestricted", "Non limitato"}, | |
| 149 | + {"appletprops.label.class", "Accesso alla classe:"}, | |
| 150 | + {"appletprops.choice.class.item.restricted", "Limitato"}, | |
| 151 | + {"appletprops.choice.class.item.unrestricted", "Non limitato"}, | |
| 152 | + {"appletprops.label.unsignedapplet", "Consenti applet senza firma:"}, | |
| 153 | + {"appletprops.choice.unsignedapplet.no", "No"}, | |
| 154 | + {"appletprops.choice.unsignedapplet.yes", "S\u00EC"}, | |
| 155 | + {"appletprops.button.apply", "Applica"}, | |
| 156 | + {"appletprops.button.cancel", "Annulla"}, | |
| 157 | + {"appletprops.button.reset", "Reimposta"}, | |
| 158 | + {"appletprops.apply.exception", "Salvataggio delle propriet\u00E0 non riuscito: {0}"}, | |
| 159 | + /* 4066432 */ | |
| 160 | + {"appletprops.title.invalidproxy", "Voce non valida"}, | |
| 161 | + {"appletprops.label.invalidproxy", "La porta del proxy deve essere un valore intero positivo."}, | |
| 162 | + {"appletprops.button.ok", "OK"}, | |
| 163 | + /* end 4066432 */ | |
| 164 | + {"appletprops.prop.store", "Propriet\u00E0 specifiche dell'utente per AppletViewer"}, | |
| 165 | + {"appletsecurityexception.checkcreateclassloader", "Eccezione di sicurezza: classloader"}, | |
| 166 | + {"appletsecurityexception.checkaccess.thread", "Eccezione di sicurezza: thread"}, | |
| 167 | + {"appletsecurityexception.checkaccess.threadgroup", "Eccezione di sicurezza: threadgroup: {0}"}, | |
| 168 | + {"appletsecurityexception.checkexit", "Eccezione di sicurezza: exit: {0}"}, | |
| 169 | + {"appletsecurityexception.checkexec", "Eccezione di sicurezza: exec: {0}"}, | |
| 170 | + {"appletsecurityexception.checklink", "Eccezione di sicurezza: link: {0}"}, | |
| 171 | + {"appletsecurityexception.checkpropsaccess", "Eccezione di sicurezza: properties"}, | |
| 172 | + {"appletsecurityexception.checkpropsaccess.key", "Eccezione di sicurezza: properties access {0}"}, | |
| 173 | + {"appletsecurityexception.checkread.exception1", "Eccezione di sicurezza: {0}, {1}"}, | |
| 174 | + {"appletsecurityexception.checkread.exception2", "Eccezione di sicurezza: file.read: {0}"}, | |
| 175 | + {"appletsecurityexception.checkread", "Eccezione di sicurezza: file.read: {0} == {1}"}, | |
| 176 | + {"appletsecurityexception.checkwrite.exception", "Eccezione di sicurezza: {0}, {1}"}, | |
| 177 | + {"appletsecurityexception.checkwrite", "Eccezione di sicurezza: file.write: {0} == {1}"}, | |
| 178 | + {"appletsecurityexception.checkread.fd", "Eccezione di sicurezza: fd.read"}, | |
| 179 | + {"appletsecurityexception.checkwrite.fd", "Eccezione di sicurezza: fd.write"}, | |
| 180 | + {"appletsecurityexception.checklisten", "Eccezione di sicurezza: socket.listen: {0}"}, | |
| 181 | + {"appletsecurityexception.checkaccept", "Eccezione di sicurezza: socket.accept: {0}:{1}"}, | |
| 182 | + {"appletsecurityexception.checkconnect.networknone", "Eccezione di sicurezza: socket.connect: {0}->{1}"}, | |
| 183 | + {"appletsecurityexception.checkconnect.networkhost1", "Eccezione di sicurezza: impossibile connettersi a {0} con origine da {1}."}, | |
| 184 | + {"appletsecurityexception.checkconnect.networkhost2", "Eccezione di sicurezza: impossibile risolvere l''IP per l''host {0} o per {1}. "}, | |
| 185 | + {"appletsecurityexception.checkconnect.networkhost3", "Eccezione di sicurezza: impossibile non risolvere l''IP per l''host {0}. Vedere la propriet\u00E0 trustProxy."}, | |
| 186 | + {"appletsecurityexception.checkconnect", "Eccezione di sicurezza: connect: {0}->{1}"}, | |
| 187 | + {"appletsecurityexception.checkpackageaccess", "Eccezione di sicurezza: impossibile accedere al package {0}"}, | |
| 188 | + {"appletsecurityexception.checkpackagedefinition", "Eccezione di sicurezza: impossibile definire il package {0}"}, | |
| 189 | + {"appletsecurityexception.cannotsetfactory", "Eccezione di sicurezza: impossibile impostare il factory"}, | |
| 190 | + {"appletsecurityexception.checkmemberaccess", "Eccezione di sicurezza: controllare l'accesso dei membri"}, | |
| 191 | + {"appletsecurityexception.checkgetprintjob", "Eccezione di sicurezza: getPrintJob"}, | |
| 192 | + {"appletsecurityexception.checksystemclipboardaccess", "Eccezione di sicurezza: getSystemClipboard"}, | |
| 193 | + {"appletsecurityexception.checkawteventqueueaccess", "Eccezione di sicurezza: getEventQueue"}, | |
| 194 | + {"appletsecurityexception.checksecurityaccess", "Eccezione di sicurezza: operazione di sicurezza {0}"}, | |
| 195 | + {"appletsecurityexception.getsecuritycontext.unknown", "tipo di loader della classe sconosciuto. Impossibile verificare la presenza di getContext."}, | |
| 196 | + {"appletsecurityexception.checkread.unknown", "tipo di loader della classe sconosciuto. Impossibile verificare la presenza della lettura di controllo {0}."}, | |
| 197 | + {"appletsecurityexception.checkconnect.unknown", "tipo di loader della classe sconosciuto. Impossibile verificare la presenza della connessione di controllo."}, | |
| 198 | + }; | |
| 199 | + | |
| 200 | + return temp; | |
| 201 | + } | |
| 202 | +} | |
| @@ -0,0 +1,202 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1996, 2011, 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 | +package sun.applet.resources; | |
| 26 | + | |
| 27 | +import java.util.ListResourceBundle; | |
| 28 | + | |
| 29 | +public class MsgAppletViewer_ja extends ListResourceBundle { | |
| 30 | + | |
| 31 | + public Object[][] getContents() { | |
| 32 | + Object[][] temp = new Object[][] { | |
| 33 | + {"textframe.button.dismiss", "\u53D6\u6D88"}, | |
| 34 | + {"appletviewer.tool.title", "\u30A2\u30D7\u30EC\u30C3\u30C8\u30FB\u30D3\u30E5\u30FC\u30A2: {0}"}, | |
| 35 | + {"appletviewer.menu.applet", "\u30A2\u30D7\u30EC\u30C3\u30C8"}, | |
| 36 | + {"appletviewer.menuitem.restart", "\u518D\u8D77\u52D5"}, | |
| 37 | + {"appletviewer.menuitem.reload", "\u518D\u30ED\u30FC\u30C9"}, | |
| 38 | + {"appletviewer.menuitem.stop", "\u505C\u6B62"}, | |
| 39 | + {"appletviewer.menuitem.save", "\u4FDD\u5B58..."}, | |
| 40 | + {"appletviewer.menuitem.start", "\u958B\u59CB"}, | |
| 41 | + {"appletviewer.menuitem.clone", "\u30AF\u30ED\u30FC\u30F3\u306E\u4F5C\u6210..."}, | |
| 42 | + {"appletviewer.menuitem.tag", "\u30BF\u30B0..."}, | |
| 43 | + {"appletviewer.menuitem.info", "\u60C5\u5831..."}, | |
| 44 | + {"appletviewer.menuitem.edit", "\u7DE8\u96C6"}, | |
| 45 | + {"appletviewer.menuitem.encoding", "\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0"}, | |
| 46 | + {"appletviewer.menuitem.print", "\u5370\u5237..."}, | |
| 47 | + {"appletviewer.menuitem.props", "\u30D7\u30ED\u30D1\u30C6\u30A3..."}, | |
| 48 | + {"appletviewer.menuitem.close", "\u9589\u3058\u308B"}, | |
| 49 | + {"appletviewer.menuitem.quit", "\u7D42\u4E86"}, | |
| 50 | + {"appletviewer.label.hello", "Hello..."}, | |
| 51 | + {"appletviewer.status.start", "\u30A2\u30D7\u30EC\u30C3\u30C8\u3092\u958B\u59CB\u3057\u3066\u3044\u307E\u3059..."}, | |
| 52 | + {"appletviewer.appletsave.filedialogtitle","\u30A2\u30D7\u30EC\u30C3\u30C8\u3092\u30D5\u30A1\u30A4\u30EB\u306B\u30B7\u30EA\u30A2\u30E9\u30A4\u30BA"}, | |
| 53 | + {"appletviewer.appletsave.err1", "{0}\u3092{1}\u306B\u30B7\u30EA\u30A2\u30E9\u30A4\u30BA"}, | |
| 54 | + {"appletviewer.appletsave.err2", "appletSave\u5185: {0}"}, | |
| 55 | + {"appletviewer.applettag", "\u30BF\u30B0\u306E\u8868\u793A"}, | |
| 56 | + {"appletviewer.applettag.textframe", "\u30A2\u30D7\u30EC\u30C3\u30C8HTML\u30BF\u30B0"}, | |
| 57 | + {"appletviewer.appletinfo.applet", "-- \u30A2\u30D7\u30EC\u30C3\u30C8\u60C5\u5831\u306A\u3057 --"}, | |
| 58 | + {"appletviewer.appletinfo.param", "-- \u30D1\u30E9\u30E1\u30FC\u30BF\u60C5\u5831\u306A\u3057 --"}, | |
| 59 | + {"appletviewer.appletinfo.textframe", "\u30A2\u30D7\u30EC\u30C3\u30C8\u60C5\u5831"}, | |
| 60 | + {"appletviewer.appletprint.fail", "\u5370\u5237\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002"}, | |
| 61 | + {"appletviewer.appletprint.finish", "\u5370\u5237\u304C\u5B8C\u4E86\u3057\u307E\u3057\u305F\u3002"}, | |
| 62 | + {"appletviewer.appletprint.cancel", "\u5370\u5237\u304C\u4E2D\u6B62\u3055\u308C\u307E\u3057\u305F\u3002"}, | |
| 63 | + {"appletviewer.appletencoding", "\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0: {0}"}, | |
| 64 | + {"appletviewer.parse.warning.requiresname", "\u8B66\u544A: <param name=... value=...>\u30BF\u30B0\u306Bname\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"}, | |
| 65 | + {"appletviewer.parse.warning.paramoutside", "\u8B66\u544A: <param>\u30BF\u30B0\u304C<applet> ... </applet>\u306E\u5916\u5074\u3067\u3059\u3002"}, | |
| 66 | + {"appletviewer.parse.warning.applet.requirescode", "\u8B66\u544A: <applet>\u30BF\u30B0\u306Bcode\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"}, | |
| 67 | + {"appletviewer.parse.warning.applet.requiresheight", "\u8B66\u544A: <applet>\u30BF\u30B0\u306Bheight\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"}, | |
| 68 | + {"appletviewer.parse.warning.applet.requireswidth", "\u8B66\u544A: <applet>\u30BF\u30B0\u306Bwidth\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"}, | |
| 69 | + {"appletviewer.parse.warning.object.requirescode", "\u8B66\u544A: <object>\u30BF\u30B0\u306Bcode\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"}, | |
| 70 | + {"appletviewer.parse.warning.object.requiresheight", "\u8B66\u544A: <object>\u30BF\u30B0\u306Bheight\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"}, | |
| 71 | + {"appletviewer.parse.warning.object.requireswidth", "\u8B66\u544A: <object>\u30BF\u30B0\u306Bwidth\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"}, | |
| 72 | + {"appletviewer.parse.warning.embed.requirescode", "\u8B66\u544A: <embed>\u30BF\u30B0\u306Bcode\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"}, | |
| 73 | + {"appletviewer.parse.warning.embed.requiresheight", "\u8B66\u544A: <embed>\u30BF\u30B0\u306Bheight\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"}, | |
| 74 | + {"appletviewer.parse.warning.embed.requireswidth", "\u8B66\u544A: <embed>\u30BF\u30B0\u306Bwidth\u5C5E\u6027\u304C\u5FC5\u8981\u3067\u3059\u3002"}, | |
| 75 | + {"appletviewer.parse.warning.appnotLongersupported", "\u8B66\u544A: <app>\u30BF\u30B0\u306F\u73FE\u5728\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u304B\u308F\u308A\u306B<applet>\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}, | |
| 76 | + {"appletviewer.usage", "\u4F7F\u7528\u65B9\u6CD5: appletviewer <options> url(s)\n\n<options>\u306B\u306F\u6B21\u306E\u3082\u306E\u304C\u3042\u308A\u307E\u3059:\n -debug Java\u30C7\u30D0\u30C3\u30AC\u3067\u30A2\u30D7\u30EC\u30C3\u30C8\u30FB\u30D3\u30E5\u30FC\u30A2\u3092\u958B\u59CB\u3059\u308B\n -encoding <encoding> HTML\u30D5\u30A1\u30A4\u30EB\u306B\u3088\u3063\u3066\u4F7F\u7528\u3055\u308C\u308B\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3092\u6307\u5B9A\u3059\u308B\n -J<runtime flag> \u5F15\u6570\u3092Java\u30A4\u30F3\u30BF\u30D7\u30EA\u30BF\u306B\u6E21\u3059\n\n-J\u306F\u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u3042\u308A\u3001\u4E88\u544A\u306A\u3057\u306B\u5909\u66F4\u3055\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002"}, | |
| 77 | + {"appletviewer.main.err.unsupportedopt", "\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u306A\u3044\u30AA\u30D7\u30B7\u30E7\u30F3: {0}"}, | |
| 78 | + {"appletviewer.main.err.unrecognizedarg", "\u8A8D\u8B58\u3055\u308C\u306A\u3044\u5F15\u6570: {0}"}, | |
| 79 | + {"appletviewer.main.err.dupoption", "\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u4F7F\u7528\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059: {0}"}, | |
| 80 | + {"appletviewer.main.err.inputfile", "\u5165\u529B\u30D5\u30A1\u30A4\u30EB\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, | |
| 81 | + {"appletviewer.main.err.badurl", "\u4E0D\u6B63\u306AURL: {0} ( {1} )"}, | |
| 82 | + {"appletviewer.main.err.io", "\u8AAD\u8FBC\u307F\u4E2D\u306E\u5165\u51FA\u529B\u4F8B\u5916\u3067\u3059: {0}"}, | |
| 83 | + {"appletviewer.main.err.readablefile", "{0}\u304C\u30D5\u30A1\u30A4\u30EB\u3067\u3042\u308A\u3001\u8AAD\u8FBC\u307F\u53EF\u80FD\u3067\u3042\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}, | |
| 84 | + {"appletviewer.main.err.correcturl", "{0}\u306F\u6B63\u3057\u3044URL\u3067\u3059\u304B\u3002"}, | |
| 85 | + {"appletviewer.main.prop.store", "AppletViewer\u7528\u306E\u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F\u30D7\u30ED\u30D1\u30C6\u30A3"}, | |
| 86 | + {"appletviewer.main.err.prop.cantread", "\u30E6\u30FC\u30B6\u30FC\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093: {0}"}, | |
| 87 | + {"appletviewer.main.err.prop.cantsave", "\u30E6\u30FC\u30B6\u30FC\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u4FDD\u5B58\u3067\u304D\u307E\u305B\u3093: {0}"}, | |
| 88 | + {"appletviewer.main.warn.nosecmgr", "\u8B66\u544A: \u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u3092\u7121\u52B9\u5316\u3057\u307E\u3059\u3002"}, | |
| 89 | + {"appletviewer.main.debug.cantfinddebug", "\u30C7\u30D0\u30C3\u30AC\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002"}, | |
| 90 | + {"appletviewer.main.debug.cantfindmain", "\u30C7\u30D0\u30C3\u30AC\u306E\u30E1\u30A4\u30F3\u30FB\u30E1\u30BD\u30C3\u30C9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002"}, | |
| 91 | + {"appletviewer.main.debug.exceptionindebug", "\u30C7\u30D0\u30C3\u30AC\u306B\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002"}, | |
| 92 | + {"appletviewer.main.debug.cantaccess", "\u30C7\u30D0\u30C3\u30AC\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093\u3002"}, | |
| 93 | + {"appletviewer.main.nosecmgr", "\u8B66\u544A: SecurityManager\u304C\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, | |
| 94 | + {"appletviewer.main.warning", "\u8B66\u544A: \u30A2\u30D7\u30EC\u30C3\u30C8\u304C\u958B\u59CB\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u5165\u529B\u306B<applet>\u30BF\u30B0\u304C\u3042\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}, | |
| 95 | + {"appletviewer.main.warn.prop.overwrite", "\u8B66\u544A: \u30E6\u30FC\u30B6\u30FC\u306E\u30EA\u30AF\u30A8\u30B9\u30C8\u3067\u30B7\u30B9\u30C6\u30E0\u30FB\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u4E00\u6642\u7684\u306B\u4E0A\u66F8\u304D\u3057\u307E\u3059: \u30AD\u30FC: {0} \u53E4\u3044\u5024: {1} \u65B0\u3057\u3044\u5024: {2}"}, | |
| 96 | + {"appletviewer.main.warn.cantreadprops", "\u8B66\u544A: AppletViewer\u30D7\u30ED\u30D1\u30C6\u30A3\u30FB\u30D5\u30A1\u30A4\u30EB{0}\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002"}, | |
| 97 | + {"appletioexception.loadclass.throw.interrupted", "\u30AF\u30E9\u30B9\u306E\u30ED\u30FC\u30C9\u304C\u4E2D\u65AD\u3057\u307E\u3057\u305F: {0}"}, | |
| 98 | + {"appletioexception.loadclass.throw.notloaded", "\u30AF\u30E9\u30B9\u304C\u30ED\u30FC\u30C9\u3055\u308C\u307E\u305B\u3093: {0}"}, | |
| 99 | + {"appletclassloader.loadcode.verbose", "{1}\u3092\u53D6\u5F97\u3059\u308B\u305F\u3081\u306E{0}\u3078\u306E\u30B9\u30C8\u30EA\u30FC\u30E0\u3092\u958B\u304D\u307E\u3059"}, | |
| 100 | + {"appletclassloader.filenotfound", "{0}\u306E\u691C\u7D22\u4E2D\u306B\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093"}, | |
| 101 | + {"appletclassloader.fileformat", "{0}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B\u30D5\u30A1\u30A4\u30EB\u30FB\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F"}, | |
| 102 | + {"appletclassloader.fileioexception", "{0}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B\u5165\u51FA\u529B\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F"}, | |
| 103 | + {"appletclassloader.fileexception", "{1}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B{0}\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F"}, | |
| 104 | + {"appletclassloader.filedeath", "{1}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B{0}\u304C\u5F37\u5236\u7D42\u4E86\u3057\u307E\u3057\u305F"}, | |
| 105 | + {"appletclassloader.fileerror", "{1}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B{0}\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F"}, | |
| 106 | + {"appletclassloader.findclass.verbose.openstream", "{1}\u3092\u53D6\u5F97\u3059\u308B\u305F\u3081\u306E{0}\u3078\u306E\u30B9\u30C8\u30EA\u30FC\u30E0\u3092\u958B\u304D\u307E\u3059"}, | |
| 107 | + {"appletclassloader.getresource.verbose.forname", "\u540D\u524D{0}\u306EAppletClassLoader.getResource\u3067\u3059"}, | |
| 108 | + {"appletclassloader.getresource.verbose.found", "\u30EA\u30BD\u30FC\u30B9{0}\u304C\u30B7\u30B9\u30C6\u30E0\u30FB\u30EA\u30BD\u30FC\u30B9\u3068\u3057\u3066\u691C\u51FA\u3055\u308C\u307E\u3057\u305F"}, | |
| 109 | + {"appletclassloader.getresourceasstream.verbose", "\u30EA\u30BD\u30FC\u30B9{0}\u304C\u30B7\u30B9\u30C6\u30E0\u30FB\u30EA\u30BD\u30FC\u30B9\u3068\u3057\u3066\u691C\u51FA\u3055\u308C\u307E\u3057\u305F"}, | |
| 110 | + {"appletpanel.runloader.err", "\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u307E\u305F\u306F\u30B3\u30FC\u30C9\u30FB\u30D1\u30E9\u30E1\u30FC\u30BF\u306E\u3044\u305A\u308C\u304B\u3067\u3059\u3002"}, | |
| 111 | + {"appletpanel.runloader.exception", "{0}\u306E\u30C7\u30B7\u30EA\u30A2\u30E9\u30A4\u30BA\u4E2D\u306B\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F"}, | |
| 112 | + {"appletpanel.destroyed", "\u30A2\u30D7\u30EC\u30C3\u30C8\u304C\u7834\u68C4\u3055\u308C\u307E\u3057\u305F\u3002"}, | |
| 113 | + {"appletpanel.loaded", "\u30A2\u30D7\u30EC\u30C3\u30C8\u304C\u30ED\u30FC\u30C9\u3055\u308C\u307E\u3057\u305F\u3002"}, | |
| 114 | + {"appletpanel.started", "\u30A2\u30D7\u30EC\u30C3\u30C8\u304C\u958B\u59CB\u3055\u308C\u307E\u3057\u305F\u3002"}, | |
| 115 | + {"appletpanel.inited", "\u30A2\u30D7\u30EC\u30C3\u30C8\u304C\u521D\u671F\u5316\u3055\u308C\u307E\u3057\u305F\u3002"}, | |
| 116 | + {"appletpanel.stopped", "\u30A2\u30D7\u30EC\u30C3\u30C8\u304C\u505C\u6B62\u3055\u308C\u307E\u3057\u305F\u3002"}, | |
| 117 | + {"appletpanel.disposed", "\u30A2\u30D7\u30EC\u30C3\u30C8\u304C\u7834\u68C4\u3055\u308C\u307E\u3057\u305F\u3002"}, | |
| 118 | + {"appletpanel.nocode", "APPLET\u30BF\u30B0\u306BCODE\u30D1\u30E9\u30E1\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093\u3002"}, | |
| 119 | + {"appletpanel.notfound", "\u30ED\u30FC\u30C9: \u30AF\u30E9\u30B9{0}\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002"}, | |
| 120 | + {"appletpanel.nocreate", "\u30ED\u30FC\u30C9: {0}\u3092\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u5316\u3067\u304D\u307E\u305B\u3093\u3002"}, | |
| 121 | + {"appletpanel.noconstruct", "\u30ED\u30FC\u30C9: {0}\u306Fpublic\u3067\u306A\u3044\u304B\u3001public\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u3092\u6301\u3063\u3066\u3044\u307E\u305B\u3093\u3002"}, | |
| 122 | + {"appletpanel.death", "\u5F37\u5236\u7D42\u4E86\u3055\u308C\u307E\u3057\u305F"}, | |
| 123 | + {"appletpanel.exception", "\u4F8B\u5916: {0}\u3002"}, | |
| 124 | + {"appletpanel.exception2", "\u4F8B\u5916: {0}: {1}\u3002"}, | |
| 125 | + {"appletpanel.error", "\u30A8\u30E9\u30FC: {0}\u3002"}, | |
| 126 | + {"appletpanel.error2", "\u30A8\u30E9\u30FC: {0}: {1}\u3002"}, | |
| 127 | + {"appletpanel.notloaded", "\u521D\u671F\u5316: \u30A2\u30D7\u30EC\u30C3\u30C8\u304C\u30ED\u30FC\u30C9\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, | |
| 128 | + {"appletpanel.notinited", "\u958B\u59CB: \u30A2\u30D7\u30EC\u30C3\u30C8\u304C\u521D\u671F\u5316\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, | |
| 129 | + {"appletpanel.notstarted", "\u505C\u6B62: \u30A2\u30D7\u30EC\u30C3\u30C8\u304C\u958B\u59CB\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, | |
| 130 | + {"appletpanel.notstopped", "\u7834\u68C4: \u30A2\u30D7\u30EC\u30C3\u30C8\u304C\u505C\u6B62\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, | |
| 131 | + {"appletpanel.notdestroyed", "\u7834\u68C4: \u30A2\u30D7\u30EC\u30C3\u30C8\u304C\u7834\u68C4\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, | |
| 132 | + {"appletpanel.notdisposed", "\u30ED\u30FC\u30C9: \u30A2\u30D7\u30EC\u30C3\u30C8\u304C\u7834\u68C4\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, | |
| 133 | + {"appletpanel.bail", "\u4E2D\u65AD\u6E08: \u7D42\u4E86\u3057\u3066\u3044\u307E\u3059\u3002"}, | |
| 134 | + {"appletpanel.filenotfound", "{0}\u306E\u691C\u7D22\u4E2D\u306B\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093"}, | |
| 135 | + {"appletpanel.fileformat", "{0}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B\u30D5\u30A1\u30A4\u30EB\u30FB\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F"}, | |
| 136 | + {"appletpanel.fileioexception", "{0}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B\u5165\u51FA\u529B\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F"}, | |
| 137 | + {"appletpanel.fileexception", "{1}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B{0}\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F"}, | |
| 138 | + {"appletpanel.filedeath", "{1}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B{0}\u304C\u5F37\u5236\u7D42\u4E86\u3057\u307E\u3057\u305F"}, | |
| 139 | + {"appletpanel.fileerror", "{1}\u306E\u30ED\u30FC\u30C9\u4E2D\u306B{0}\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F"}, | |
| 140 | + {"appletpanel.badattribute.exception", "HTML\u89E3\u6790: width\u307E\u305F\u306Fheight\u5C5E\u6027\u306E\u5024\u304C\u4E0D\u6B63\u3067\u3059"}, | |
| 141 | + {"appletillegalargumentexception.objectinputstream", "AppletObjectInputStream\u306F\u975Enull\u306E\u30ED\u30FC\u30C0\u30FC\u304C\u5FC5\u8981\u3067\u3059"}, | |
| 142 | + {"appletprops.title", "AppletViewer\u30D7\u30ED\u30D1\u30C6\u30A3"}, | |
| 143 | + {"appletprops.label.http.server", "Http\u30D7\u30ED\u30AD\u30B7\u30FB\u30B5\u30FC\u30D0\u30FC:"}, | |
| 144 | + {"appletprops.label.http.proxy", "Http\u30D7\u30ED\u30AD\u30B7\u30FB\u30DD\u30FC\u30C8:"}, | |
| 145 | + {"appletprops.label.network", "\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u30FB\u30A2\u30AF\u30BB\u30B9:"}, | |
| 146 | + {"appletprops.choice.network.item.none", "\u306A\u3057"}, | |
| 147 | + {"appletprops.choice.network.item.applethost", "\u30A2\u30D7\u30EC\u30C3\u30C8\u30FB\u30DB\u30B9\u30C8"}, | |
| 148 | + {"appletprops.choice.network.item.unrestricted", "\u5236\u9650\u306A\u3057"}, | |
| 149 | + {"appletprops.label.class", "\u30AF\u30E9\u30B9\u30FB\u30A2\u30AF\u30BB\u30B9:"}, | |
| 150 | + {"appletprops.choice.class.item.restricted", "\u5236\u9650\u4ED8\u304D"}, | |
| 151 | + {"appletprops.choice.class.item.unrestricted", "\u5236\u9650\u306A\u3057"}, | |
| 152 | + {"appletprops.label.unsignedapplet", "\u7F72\u540D\u3055\u308C\u3066\u3044\u306A\u3044\u30A2\u30D7\u30EC\u30C3\u30C8\u3092\u8A31\u53EF:"}, | |
| 153 | + {"appletprops.choice.unsignedapplet.no", "\u3044\u3044\u3048"}, | |
| 154 | + {"appletprops.choice.unsignedapplet.yes", "\u306F\u3044"}, | |
| 155 | + {"appletprops.button.apply", "\u9069\u7528"}, | |
| 156 | + {"appletprops.button.cancel", "\u53D6\u6D88"}, | |
| 157 | + {"appletprops.button.reset", "\u30EA\u30BB\u30C3\u30C8"}, | |
| 158 | + {"appletprops.apply.exception", "\u30D7\u30ED\u30D1\u30C6\u30A3{0}\u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F"}, | |
| 159 | + /* 4066432 */ | |
| 160 | + {"appletprops.title.invalidproxy", "\u30A8\u30F3\u30C8\u30EA\u304C\u7121\u52B9\u3067\u3059"}, | |
| 161 | + {"appletprops.label.invalidproxy", "\u30D7\u30ED\u30AD\u30B7\u30FB\u30DD\u30FC\u30C8\u306F\u6B63\u306E\u6574\u6570\u5024\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"}, | |
| 162 | + {"appletprops.button.ok", "OK"}, | |
| 163 | + /* end 4066432 */ | |
| 164 | + {"appletprops.prop.store", "AppletViewer\u7528\u306E\u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F\u30D7\u30ED\u30D1\u30C6\u30A3"}, | |
| 165 | + {"appletsecurityexception.checkcreateclassloader", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u30AF\u30E9\u30B9\u30ED\u30FC\u30C0\u30FC"}, | |
| 166 | + {"appletsecurityexception.checkaccess.thread", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u30B9\u30EC\u30C3\u30C9"}, | |
| 167 | + {"appletsecurityexception.checkaccess.threadgroup", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u30B9\u30EC\u30C3\u30C9\u30B0\u30EB\u30FC\u30D7: {0}"}, | |
| 168 | + {"appletsecurityexception.checkexit", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u7D42\u4E86: {0}"}, | |
| 169 | + {"appletsecurityexception.checkexec", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u5B9F\u884C: {0}"}, | |
| 170 | + {"appletsecurityexception.checklink", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u30EA\u30F3\u30AF: {0}"}, | |
| 171 | + {"appletsecurityexception.checkpropsaccess", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u30D7\u30ED\u30D1\u30C6\u30A3"}, | |
| 172 | + {"appletsecurityexception.checkpropsaccess.key", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u30D7\u30ED\u30D1\u30C6\u30A3\u30FB\u30A2\u30AF\u30BB\u30B9{0}"}, | |
| 173 | + {"appletsecurityexception.checkread.exception1", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: {0}, {1}"}, | |
| 174 | + {"appletsecurityexception.checkread.exception2", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: file.read: {0}"}, | |
| 175 | + {"appletsecurityexception.checkread", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: file.read: {0} == {1}"}, | |
| 176 | + {"appletsecurityexception.checkwrite.exception", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: {0}, {1}"}, | |
| 177 | + {"appletsecurityexception.checkwrite", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: file.write: {0} == {1}"}, | |
| 178 | + {"appletsecurityexception.checkread.fd", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: fd.read"}, | |
| 179 | + {"appletsecurityexception.checkwrite.fd", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: fd.write"}, | |
| 180 | + {"appletsecurityexception.checklisten", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: socket.listen: {0}"}, | |
| 181 | + {"appletsecurityexception.checkaccept", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: socket.accept: {0}:{1}"}, | |
| 182 | + {"appletsecurityexception.checkconnect.networknone", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: socket.connect: {0}->{1}"}, | |
| 183 | + {"appletsecurityexception.checkconnect.networkhost1", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: {1}\u306E\u8D77\u70B9\u3092\u4F7F\u7528\u3057\u3066{0}\u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002"}, | |
| 184 | + {"appletsecurityexception.checkconnect.networkhost2", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u30DB\u30B9\u30C8{0}\u307E\u305F\u306F{1}\u306EIP\u3092\u89E3\u6C7A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002 "}, | |
| 185 | + {"appletsecurityexception.checkconnect.networkhost3", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u30DB\u30B9\u30C8{0}\u306EIP\u3092\u89E3\u6C7A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002trustProxy\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}, | |
| 186 | + {"appletsecurityexception.checkconnect", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u63A5\u7D9A: {0}->{1}"}, | |
| 187 | + {"appletsecurityexception.checkpackageaccess", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093: {0}"}, | |
| 188 | + {"appletsecurityexception.checkpackagedefinition", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u5B9A\u7FA9\u3067\u304D\u307E\u305B\u3093: {0}"}, | |
| 189 | + {"appletsecurityexception.cannotsetfactory", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u30D5\u30A1\u30AF\u30C8\u30EA\u3092\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093"}, | |
| 190 | + {"appletsecurityexception.checkmemberaccess", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u30E1\u30F3\u30D0\u30FC\u30FB\u30A2\u30AF\u30BB\u30B9\u306E\u78BA\u8A8D"}, | |
| 191 | + {"appletsecurityexception.checkgetprintjob", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: getPrintJob"}, | |
| 192 | + {"appletsecurityexception.checksystemclipboardaccess", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: getSystemClipboard"}, | |
| 193 | + {"appletsecurityexception.checkawteventqueueaccess", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: getEventQueue"}, | |
| 194 | + {"appletsecurityexception.checksecurityaccess", "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u306E\u4F8B\u5916: \u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u64CD\u4F5C: {0}"}, | |
| 195 | + {"appletsecurityexception.getsecuritycontext.unknown", "\u4E0D\u660E\u306A\u30AF\u30E9\u30B9\u30ED\u30FC\u30C0\u30FC\u30FB\u30BF\u30A4\u30D7\u3067\u3059\u3002getContext\u3092\u78BA\u8A8D\u3067\u304D\u307E\u305B\u3093"}, | |
| 196 | + {"appletsecurityexception.checkread.unknown", "\u4E0D\u660E\u306A\u30AF\u30E9\u30B9\u30ED\u30FC\u30C0\u30FC\u30FB\u30BF\u30A4\u30D7\u3067\u3059\u3002{0}\u306E\u8AAD\u53D6\u308A\u30C1\u30A7\u30C3\u30AF\u3092\u78BA\u8A8D\u3067\u304D\u307E\u305B\u3093"}, | |
| 197 | + {"appletsecurityexception.checkconnect.unknown", "\u4E0D\u660E\u306A\u30AF\u30E9\u30B9\u30ED\u30FC\u30C0\u30FC\u30FB\u30BF\u30A4\u30D7\u3067\u3059\u3002\u63A5\u7D9A\u30C1\u30A7\u30C3\u30AF\u3092\u78BA\u8A8D\u3067\u304D\u307E\u305B\u3093"}, | |
| 198 | + }; | |
| 199 | + | |
| 200 | + return temp; | |
| 201 | + } | |
| 202 | +} | |
| @@ -0,0 +1,202 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1996, 2011, 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 | +package sun.applet.resources; | |
| 26 | + | |
| 27 | +import java.util.ListResourceBundle; | |
| 28 | + | |
| 29 | +public class MsgAppletViewer_ko extends ListResourceBundle { | |
| 30 | + | |
| 31 | + public Object[][] getContents() { | |
| 32 | + Object[][] temp = new Object[][] { | |
| 33 | + {"textframe.button.dismiss", "\uD574\uC81C"}, | |
| 34 | + {"appletviewer.tool.title", "\uC560\uD50C\uB9BF \uBDF0\uC5B4: {0}"}, | |
| 35 | + {"appletviewer.menu.applet", "\uC560\uD50C\uB9BF"}, | |
| 36 | + {"appletviewer.menuitem.restart", "\uC7AC\uC2DC\uC791"}, | |
| 37 | + {"appletviewer.menuitem.reload", "\uC7AC\uB85C\uB4DC"}, | |
| 38 | + {"appletviewer.menuitem.stop", "\uC815\uC9C0"}, | |
| 39 | + {"appletviewer.menuitem.save", "\uC800\uC7A5..."}, | |
| 40 | + {"appletviewer.menuitem.start", "\uC2DC\uC791"}, | |
| 41 | + {"appletviewer.menuitem.clone", "\uBCF5\uC81C..."}, | |
| 42 | + {"appletviewer.menuitem.tag", "\uD0DC\uADF8 \uC9C0\uC815..."}, | |
| 43 | + {"appletviewer.menuitem.info", "\uC815\uBCF4..."}, | |
| 44 | + {"appletviewer.menuitem.edit", "\uD3B8\uC9D1"}, | |
| 45 | + {"appletviewer.menuitem.encoding", "\uBB38\uC790 \uC778\uCF54\uB529"}, | |
| 46 | + {"appletviewer.menuitem.print", "\uC778\uC1C4..."}, | |
| 47 | + {"appletviewer.menuitem.props", "\uC18D\uC131..."}, | |
| 48 | + {"appletviewer.menuitem.close", "\uB2EB\uAE30"}, | |
| 49 | + {"appletviewer.menuitem.quit", "\uC885\uB8CC"}, | |
| 50 | + {"appletviewer.label.hello", "\uC2DC\uC791..."}, | |
| 51 | + {"appletviewer.status.start", "\uC560\uD50C\uB9BF\uC744 \uC2DC\uC791\uD558\uB294 \uC911..."}, | |
| 52 | + {"appletviewer.appletsave.filedialogtitle","\uD30C\uC77C\uB85C \uC560\uD50C\uB9BF \uC9C1\uB82C\uD654"}, | |
| 53 | + {"appletviewer.appletsave.err1", "{0}\uC744(\uB97C) {1}(\uC73C)\uB85C \uC9C1\uB82C\uD654\uD558\uB294 \uC911"}, | |
| 54 | + {"appletviewer.appletsave.err2", "appletSave\uC5D0 \uC624\uB958 \uBC1C\uC0DD: {0}"}, | |
| 55 | + {"appletviewer.applettag", "\uD0DC\uADF8\uAC00 \uD45C\uC2DC\uB428"}, | |
| 56 | + {"appletviewer.applettag.textframe", "\uC560\uD50C\uB9BF HTML \uD0DC\uADF8"}, | |
| 57 | + {"appletviewer.appletinfo.applet", "-- \uC560\uD50C\uB9BF \uC815\uBCF4 \uC5C6\uC74C --"}, | |
| 58 | + {"appletviewer.appletinfo.param", "-- \uB9E4\uAC1C\uBCC0\uC218 \uC815\uBCF4 \uC5C6\uC74C --"}, | |
| 59 | + {"appletviewer.appletinfo.textframe", "\uC560\uD50C\uB9BF \uC815\uBCF4"}, | |
| 60 | + {"appletviewer.appletprint.fail", "\uC778\uC1C4\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4."}, | |
| 61 | + {"appletviewer.appletprint.finish", "\uC778\uC1C4\uB97C \uC644\uB8CC\uD588\uC2B5\uB2C8\uB2E4."}, | |
| 62 | + {"appletviewer.appletprint.cancel", "\uC778\uC1C4\uAC00 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4."}, | |
| 63 | + {"appletviewer.appletencoding", "\uBB38\uC790 \uC778\uCF54\uB529: {0}"}, | |
| 64 | + {"appletviewer.parse.warning.requiresname", "\uACBD\uACE0: <param name=... value=...> \uD0DC\uADF8\uC5D0\uB294 name \uC18D\uC131\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."}, | |
| 65 | + {"appletviewer.parse.warning.paramoutside", "\uACBD\uACE0: <param> \uD0DC\uADF8\uAC00 <applet> ... </applet> \uBC16\uC5D0 \uC788\uC2B5\uB2C8\uB2E4."}, | |
| 66 | + {"appletviewer.parse.warning.applet.requirescode", "\uACBD\uACE0: <applet> \uD0DC\uADF8\uC5D0\uB294 code \uC18D\uC131\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."}, | |
| 67 | + {"appletviewer.parse.warning.applet.requiresheight", "\uACBD\uACE0: <applet> \uD0DC\uADF8\uC5D0\uB294 height \uC18D\uC131\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."}, | |
| 68 | + {"appletviewer.parse.warning.applet.requireswidth", "\uACBD\uACE0: <applet> \uD0DC\uADF8\uC5D0\uB294 width \uC18D\uC131\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."}, | |
| 69 | + {"appletviewer.parse.warning.object.requirescode", "\uACBD\uACE0: <object> \uD0DC\uADF8\uC5D0\uB294 code \uC18D\uC131\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."}, | |
| 70 | + {"appletviewer.parse.warning.object.requiresheight", "\uACBD\uACE0: <object> \uD0DC\uADF8\uC5D0\uB294 height \uC18D\uC131\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."}, | |
| 71 | + {"appletviewer.parse.warning.object.requireswidth", "\uACBD\uACE0: <object> \uD0DC\uADF8\uC5D0\uB294 width \uC18D\uC131\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."}, | |
| 72 | + {"appletviewer.parse.warning.embed.requirescode", "\uACBD\uACE0: <embed> \uD0DC\uADF8\uC5D0\uB294 code \uC18D\uC131\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."}, | |
| 73 | + {"appletviewer.parse.warning.embed.requiresheight", "\uACBD\uACE0: <embed> \uD0DC\uADF8\uC5D0\uB294 height \uC18D\uC131\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."}, | |
| 74 | + {"appletviewer.parse.warning.embed.requireswidth", "\uACBD\uACE0: <embed> \uD0DC\uADF8\uC5D0\uB294 width \uC18D\uC131\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."}, | |
| 75 | + {"appletviewer.parse.warning.appnotLongersupported", "\uACBD\uACE0: <app> \uD0DC\uADF8\uB294 \uB354 \uC774\uC0C1 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uB300\uC2E0 <applet>\uC744 \uC0AC\uC6A9\uD558\uC2ED\uC2DC\uC624."}, | |
| 76 | + {"appletviewer.usage", "\uC0AC\uC6A9\uBC95: appletviewer <options> url(s)\n\n\uC5EC\uAE30\uC11C <options>\uB294 \uB2E4\uC74C\uACFC \uAC19\uC2B5\uB2C8\uB2E4.\n -debug Java \uB514\uBC84\uAC70\uC5D0\uC11C \uC560\uD50C\uB9BF \uBDF0\uC5B4\uB97C \uC2DC\uC791\uD569\uB2C8\uB2E4.\n -encoding <encoding> HTML \uD30C\uC77C\uC5D0 \uC0AC\uC6A9\uB420 \uBB38\uC790 \uC778\uCF54\uB529\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4.\n -J<runtime flag> Java \uC778\uD130\uD504\uB9AC\uD130\uB85C \uC778\uC218\uB97C \uC804\uB2EC\uD569\uB2C8\uB2E4.\n\n-J \uC635\uC158\uC740 \uD45C\uC900\uC774 \uC544\uB2C8\uBA70 \uC608\uACE0 \uC5C6\uC774 \uBCC0\uACBD\uB420 \uC218 \uC788\uC2B5\uB2C8\uB2E4."}, | |
| 77 | + {"appletviewer.main.err.unsupportedopt", "\uC9C0\uC6D0\uB418\uC9C0 \uC54A\uB294 \uC635\uC158: {0}"}, | |
| 78 | + {"appletviewer.main.err.unrecognizedarg", "\uC54C \uC218 \uC5C6\uB294 \uC778\uC218: {0}"}, | |
| 79 | + {"appletviewer.main.err.dupoption", "\uC911\uBCF5\uB41C \uC635\uC158 \uC0AC\uC6A9: {0}"}, | |
| 80 | + {"appletviewer.main.err.inputfile", "\uC9C0\uC815\uB41C \uC785\uB825 \uD30C\uC77C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}, | |
| 81 | + {"appletviewer.main.err.badurl", "\uC798\uBABB\uB41C URL: {0}({1})"}, | |
| 82 | + {"appletviewer.main.err.io", "\uC77D\uB294 \uC911 I/O \uC608\uC678 \uC0AC\uD56D \uBC1C\uC0DD: {0}"}, | |
| 83 | + {"appletviewer.main.err.readablefile", "{0}\uC774(\uAC00) \uD30C\uC77C\uC774\uBA70 \uC77D\uAE30 \uAC00\uB2A5\uD55C \uC0C1\uD0DC\uC778\uC9C0 \uD655\uC778\uD558\uC2ED\uC2DC\uC624."}, | |
| 84 | + {"appletviewer.main.err.correcturl", "{0}\uC774(\uAC00) \uC62C\uBC14\uB978 URL\uC785\uB2C8\uAE4C?"}, | |
| 85 | + {"appletviewer.main.prop.store", "\uC0AC\uC6A9\uC790 \uAD00\uB828 AppletViewer \uC18D\uC131"}, | |
| 86 | + {"appletviewer.main.err.prop.cantread", "\uC0AC\uC6A9\uC790 \uC18D\uC131 \uD30C\uC77C\uC744 \uC77D\uC744 \uC218 \uC5C6\uC74C: {0}"}, | |
| 87 | + {"appletviewer.main.err.prop.cantsave", "\uC0AC\uC6A9\uC790 \uC18D\uC131 \uD30C\uC77C\uC744 \uC800\uC7A5\uD560 \uC218 \uC5C6\uC74C: {0}"}, | |
| 88 | + {"appletviewer.main.warn.nosecmgr", "\uACBD\uACE0: \uBCF4\uC548\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD558\uB294 \uC911\uC785\uB2C8\uB2E4."}, | |
| 89 | + {"appletviewer.main.debug.cantfinddebug", "\uB514\uBC84\uAC70\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4!"}, | |
| 90 | + {"appletviewer.main.debug.cantfindmain", "\uB514\uBC84\uAC70\uC5D0\uC11C \uAE30\uBCF8 \uBA54\uC18C\uB4DC\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4!"}, | |
| 91 | + {"appletviewer.main.debug.exceptionindebug", "\uB514\uBC84\uAC70\uC5D0 \uC608\uC678 \uC0AC\uD56D\uC774 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4!"}, | |
| 92 | + {"appletviewer.main.debug.cantaccess", "\uB514\uBC84\uAC70\uC5D0 \uC561\uC138\uC2A4\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4!"}, | |
| 93 | + {"appletviewer.main.nosecmgr", "\uACBD\uACE0: SecurityManager\uAC00 \uC124\uCE58\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4!"}, | |
| 94 | + {"appletviewer.main.warning", "\uACBD\uACE0: \uC2DC\uC791\uB41C \uC560\uD50C\uB9BF\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. <applet> \uD0DC\uADF8\uAC00 \uC785\uB825\uB418\uC5C8\uB294\uC9C0 \uD655\uC778\uD558\uC2ED\uC2DC\uC624."}, | |
| 95 | + {"appletviewer.main.warn.prop.overwrite", "\uACBD\uACE0: \uC0AC\uC6A9\uC790\uC758 \uC694\uCCAD\uC5D0 \uB530\uB77C \uC77C\uC2DC\uC801\uC73C\uB85C \uC2DC\uC2A4\uD15C \uC18D\uC131\uC744 \uACB9\uCCD0 \uC4F0\uB294 \uC911: \uD0A4: {0}, \uC774\uC804 \uAC12: {1}, \uC0C8 \uAC12: {2}"}, | |
| 96 | + {"appletviewer.main.warn.cantreadprops", "\uACBD\uACE0: AppletViewer \uC18D\uC131 \uD30C\uC77C\uC744 \uC77D\uC744 \uC218 \uC5C6\uC74C: {0}. \uAE30\uBCF8\uAC12\uC744 \uC0AC\uC6A9\uD558\uB294 \uC911\uC785\uB2C8\uB2E4."}, | |
| 97 | + {"appletioexception.loadclass.throw.interrupted", "\uD074\uB798\uC2A4 \uB85C\uB4DC\uAC00 \uC911\uB2E8\uB428: {0}"}, | |
| 98 | + {"appletioexception.loadclass.throw.notloaded", "\uD074\uB798\uC2A4\uAC00 \uB85C\uB4DC\uB418\uC9C0 \uC54A\uC74C: {0}"}, | |
| 99 | + {"appletclassloader.loadcode.verbose", "{1}\uC744(\uB97C) \uAC00\uC838\uC624\uAE30 \uC704\uD574 {0}\uC5D0 \uB300\uD55C \uC2A4\uD2B8\uB9BC\uC744 \uC5EC\uB294 \uC911"}, | |
| 100 | + {"appletclassloader.filenotfound", "{0}\uC744(\uB97C) \uAC80\uC0C9\uD558\uB294 \uC911 \uD30C\uC77C\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."}, | |
| 101 | + {"appletclassloader.fileformat", "\uB85C\uB4DC \uC911 \uD30C\uC77C \uD615\uC2DD \uC608\uC678 \uC0AC\uD56D \uBC1C\uC0DD: {0}"}, | |
| 102 | + {"appletclassloader.fileioexception", "\uB85C\uB4DC \uC911 I/O \uC608\uC678 \uC0AC\uD56D \uBC1C\uC0DD: {0}"}, | |
| 103 | + {"appletclassloader.fileexception", "\uB85C\uB4DC \uC911 {0} \uC608\uC678 \uC0AC\uD56D \uBC1C\uC0DD: {1}"}, | |
| 104 | + {"appletclassloader.filedeath", "\uB85C\uB4DC \uC911 {0}\uC774(\uAC00) \uC885\uB8CC\uB428: {1}"}, | |
| 105 | + {"appletclassloader.fileerror", "\uB85C\uB4DC \uC911 {0} \uC624\uB958 \uBC1C\uC0DD: {1}"}, | |
| 106 | + {"appletclassloader.findclass.verbose.openstream", "{1}\uC744(\uB97C) \uAC00\uC838\uC624\uAE30 \uC704\uD574 {0}\uC5D0 \uB300\uD55C \uC2A4\uD2B8\uB9BC\uC744 \uC5EC\uB294 \uC911"}, | |
| 107 | + {"appletclassloader.getresource.verbose.forname", "\uC774\uB984\uC5D0 \uB300\uD55C AppletClassLoader.getResource: {0}"}, | |
| 108 | + {"appletclassloader.getresource.verbose.found", "\uC2DC\uC2A4\uD15C \uB9AC\uC18C\uC2A4\uB85C {0} \uB9AC\uC18C\uC2A4\uB97C \uCC3E\uC558\uC2B5\uB2C8\uB2E4."}, | |
| 109 | + {"appletclassloader.getresourceasstream.verbose", "\uC2DC\uC2A4\uD15C \uB9AC\uC18C\uC2A4\uB85C {0} \uB9AC\uC18C\uC2A4\uB97C \uCC3E\uC558\uC2B5\uB2C8\uB2E4."}, | |
| 110 | + {"appletpanel.runloader.err", "\uAC1D\uCCB4 \uB610\uB294 \uCF54\uB4DC \uB9E4\uAC1C\uBCC0\uC218\uC785\uB2C8\uB2E4!"}, | |
| 111 | + {"appletpanel.runloader.exception", "{0}\uC758 \uC9C1\uB82C\uD654\uB97C \uD574\uC81C\uD558\uB294 \uC911 \uC608\uC678 \uC0AC\uD56D\uC774 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4."}, | |
| 112 | + {"appletpanel.destroyed", "\uC560\uD50C\uB9BF\uC774 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4."}, | |
| 113 | + {"appletpanel.loaded", "\uC560\uD50C\uB9BF\uC774 \uB85C\uB4DC\uB418\uC5C8\uC2B5\uB2C8\uB2E4."}, | |
| 114 | + {"appletpanel.started", "\uC560\uD50C\uB9BF\uC774 \uC2DC\uC791\uB418\uC5C8\uC2B5\uB2C8\uB2E4."}, | |
| 115 | + {"appletpanel.inited", "\uC560\uD50C\uB9BF\uC774 \uCD08\uAE30\uD654\uB418\uC5C8\uC2B5\uB2C8\uB2E4."}, | |
| 116 | + {"appletpanel.stopped", "\uC560\uD50C\uB9BF\uC774 \uC815\uC9C0\uB418\uC5C8\uC2B5\uB2C8\uB2E4."}, | |
| 117 | + {"appletpanel.disposed", "\uC560\uD50C\uB9BF\uC774 \uBC30\uCE58\uB418\uC5C8\uC2B5\uB2C8\uB2E4."}, | |
| 118 | + {"appletpanel.nocode", "APPLET \uD0DC\uADF8\uC5D0 CODE \uB9E4\uAC1C\uBCC0\uC218\uAC00 \uB204\uB77D\uB418\uC5C8\uC2B5\uB2C8\uB2E4."}, | |
| 119 | + {"appletpanel.notfound", "\uB85C\uB4DC: {0} \uD074\uB798\uC2A4\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."}, | |
| 120 | + {"appletpanel.nocreate", "\uB85C\uB4DC: {0}\uC744(\uB97C) \uC778\uC2A4\uD134\uC2A4\uD654\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."}, | |
| 121 | + {"appletpanel.noconstruct", "\uB85C\uB4DC: {0}\uC740(\uB294) \uACF5\uC6A9\uC774 \uC544\uB2C8\uAC70\uB098 \uACF5\uC6A9 \uC0DD\uC131\uC790\uB97C \uD3EC\uD568\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."}, | |
| 122 | + {"appletpanel.death", "\uC885\uB8CC\uB428"}, | |
| 123 | + {"appletpanel.exception", "\uC608\uC678 \uC0AC\uD56D: {0}."}, | |
| 124 | + {"appletpanel.exception2", "\uC608\uC678 \uC0AC\uD56D: {0}: {1}."}, | |
| 125 | + {"appletpanel.error", "\uC624\uB958: {0}."}, | |
| 126 | + {"appletpanel.error2", "\uC624\uB958: {0}: {1}."}, | |
| 127 | + {"appletpanel.notloaded", "\uCD08\uAE30\uD654: \uC560\uD50C\uB9BF\uC774 \uB85C\uB4DC\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."}, | |
| 128 | + {"appletpanel.notinited", "\uC2DC\uC791: \uC560\uD50C\uB9BF\uC774 \uCD08\uAE30\uD654\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."}, | |
| 129 | + {"appletpanel.notstarted", "\uC815\uC9C0: \uC560\uD50C\uB9BF\uC774 \uC2DC\uC791\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."}, | |
| 130 | + {"appletpanel.notstopped", "\uC0AD\uC81C: \uC560\uD50C\uB9BF\uC774 \uC815\uC9C0\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."}, | |
| 131 | + {"appletpanel.notdestroyed", "\uBC30\uCE58: \uC560\uD50C\uB9BF\uC774 \uC0AD\uC81C\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."}, | |
| 132 | + {"appletpanel.notdisposed", "\uB85C\uB4DC: \uC560\uD50C\uB9BF\uC774 \uBC30\uCE58\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."}, | |
| 133 | + {"appletpanel.bail", "\uC911\uB2E8\uB428: \uC911\uB2E8\uD558\uB294 \uC911\uC785\uB2C8\uB2E4."}, | |
| 134 | + {"appletpanel.filenotfound", "{0}\uC744(\uB97C) \uAC80\uC0C9\uD558\uB294 \uC911 \uD30C\uC77C\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."}, | |
| 135 | + {"appletpanel.fileformat", "\uB85C\uB4DC \uC911 \uD30C\uC77C \uD615\uC2DD \uC608\uC678 \uC0AC\uD56D \uBC1C\uC0DD: {0}"}, | |
| 136 | + {"appletpanel.fileioexception", "\uB85C\uB4DC \uC911 I/O \uC608\uC678 \uC0AC\uD56D \uBC1C\uC0DD: {0}"}, | |
| 137 | + {"appletpanel.fileexception", "\uB85C\uB4DC \uC911 {0} \uC608\uC678 \uC0AC\uD56D \uBC1C\uC0DD: {1}"}, | |
| 138 | + {"appletpanel.filedeath", "\uB85C\uB4DC \uC911 {0}\uC774(\uAC00) \uC885\uB8CC\uB428: {1}"}, | |
| 139 | + {"appletpanel.fileerror", "\uB85C\uB4DC \uC911 {0} \uC624\uB958 \uBC1C\uC0DD: {1}"}, | |
| 140 | + {"appletpanel.badattribute.exception", "HTML \uAD6C\uBB38 \uBD84\uC11D \uC911: width/height \uC18D\uC131\uC5D0 \uB300\uD55C \uAC12\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."}, | |
| 141 | + {"appletillegalargumentexception.objectinputstream", "AppletObjectInputStream\uC5D0 \uB110\uC774 \uC544\uB2CC \uB85C\uB354\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4."}, | |
| 142 | + {"appletprops.title", "AppletViewer \uC18D\uC131"}, | |
| 143 | + {"appletprops.label.http.server", "HTTP \uD504\uB85D\uC2DC \uC11C\uBC84:"}, | |
| 144 | + {"appletprops.label.http.proxy", "HTTP \uD504\uB85D\uC2DC \uD3EC\uD2B8:"}, | |
| 145 | + {"appletprops.label.network", "\uB124\uD2B8\uC6CC\uD06C \uC561\uC138\uC2A4:"}, | |
| 146 | + {"appletprops.choice.network.item.none", "\uC5C6\uC74C"}, | |
| 147 | + {"appletprops.choice.network.item.applethost", "\uC560\uD50C\uB9BF \uD638\uC2A4\uD2B8"}, | |
| 148 | + {"appletprops.choice.network.item.unrestricted", "\uC81C\uD55C\uB418\uC9C0 \uC54A\uC74C"}, | |
| 149 | + {"appletprops.label.class", "\uD074\uB798\uC2A4 \uC561\uC138\uC2A4:"}, | |
| 150 | + {"appletprops.choice.class.item.restricted", "\uC81C\uD55C\uB428"}, | |
| 151 | + {"appletprops.choice.class.item.unrestricted", "\uC81C\uD55C\uB418\uC9C0 \uC54A\uC74C"}, | |
| 152 | + {"appletprops.label.unsignedapplet", "\uC11C\uBA85\uB418\uC9C0 \uC54A\uC740 \uC560\uD50C\uB9BF \uD5C8\uC6A9:"}, | |
| 153 | + {"appletprops.choice.unsignedapplet.no", "\uC544\uB2C8\uC624"}, | |
| 154 | + {"appletprops.choice.unsignedapplet.yes", "\uC608"}, | |
| 155 | + {"appletprops.button.apply", "\uC801\uC6A9"}, | |
| 156 | + {"appletprops.button.cancel", "\uCDE8\uC18C"}, | |
| 157 | + {"appletprops.button.reset", "\uC7AC\uC124\uC815"}, | |
| 158 | + {"appletprops.apply.exception", "\uC18D\uC131 \uC800\uC7A5 \uC2E4\uD328: {0}"}, | |
| 159 | + /* 4066432 */ | |
| 160 | + {"appletprops.title.invalidproxy", "\uBD80\uC801\uD569\uD55C \uD56D\uBAA9"}, | |
| 161 | + {"appletprops.label.invalidproxy", "\uD504\uB85D\uC2DC \uD3EC\uD2B8\uB294 \uC591\uC758 \uC815\uC218 \uAC12\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4."}, | |
| 162 | + {"appletprops.button.ok", "\uD655\uC778"}, | |
| 163 | + /* end 4066432 */ | |
| 164 | + {"appletprops.prop.store", "\uC0AC\uC6A9\uC790 \uAD00\uB828 AppletViewer \uC18D\uC131"}, | |
| 165 | + {"appletsecurityexception.checkcreateclassloader", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: \uD074\uB798\uC2A4 \uB85C\uB354"}, | |
| 166 | + {"appletsecurityexception.checkaccess.thread", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: \uC2A4\uB808\uB4DC"}, | |
| 167 | + {"appletsecurityexception.checkaccess.threadgroup", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: \uC2A4\uB808\uB4DC \uADF8\uB8F9: {0}"}, | |
| 168 | + {"appletsecurityexception.checkexit", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: \uC885\uB8CC: {0}"}, | |
| 169 | + {"appletsecurityexception.checkexec", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: \uC2E4\uD589: {0}"}, | |
| 170 | + {"appletsecurityexception.checklink", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: \uB9C1\uD06C: {0}"}, | |
| 171 | + {"appletsecurityexception.checkpropsaccess", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: \uC18D\uC131"}, | |
| 172 | + {"appletsecurityexception.checkpropsaccess.key", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: \uC18D\uC131 \uC561\uC138\uC2A4 {0}"}, | |
| 173 | + {"appletsecurityexception.checkread.exception1", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: {0}, {1}"}, | |
| 174 | + {"appletsecurityexception.checkread.exception2", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: file.read: {0}"}, | |
| 175 | + {"appletsecurityexception.checkread", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: file.read: {0} == {1}"}, | |
| 176 | + {"appletsecurityexception.checkwrite.exception", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: {0}, {1}"}, | |
| 177 | + {"appletsecurityexception.checkwrite", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: file.write: {0} == {1}"}, | |
| 178 | + {"appletsecurityexception.checkread.fd", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: fd.read"}, | |
| 179 | + {"appletsecurityexception.checkwrite.fd", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: fd.write"}, | |
| 180 | + {"appletsecurityexception.checklisten", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: socket.listen: {0}"}, | |
| 181 | + {"appletsecurityexception.checkaccept", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: socket.accept: {0}:{1}"}, | |
| 182 | + {"appletsecurityexception.checkconnect.networknone", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: socket.connect: {0}->{1}"}, | |
| 183 | + {"appletsecurityexception.checkconnect.networkhost1", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: {1}\uC5D0\uC11C {0}\uC5D0 \uC811\uC18D\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."}, | |
| 184 | + {"appletsecurityexception.checkconnect.networkhost2", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: {0} \uD638\uC2A4\uD2B8 \uB610\uB294 {1}\uC5D0 \uB300\uD55C IP\uB97C \uBD84\uC11D\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. "}, | |
| 185 | + {"appletsecurityexception.checkconnect.networkhost3", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: {0} \uD638\uC2A4\uD2B8\uC5D0 \uB300\uD55C IP\uB97C \uBD84\uC11D\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. trustProxy \uC18D\uC131\uC744 \uCC38\uC870\uD558\uC2ED\uC2DC\uC624."}, | |
| 186 | + {"appletsecurityexception.checkconnect", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: \uC811\uC18D: {0}->{1}"}, | |
| 187 | + {"appletsecurityexception.checkpackageaccess", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: \uD328\uD0A4\uC9C0\uC5D0 \uC561\uC138\uC2A4\uD560 \uC218 \uC5C6\uC74C: {0}"}, | |
| 188 | + {"appletsecurityexception.checkpackagedefinition", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: \uD328\uD0A4\uC9C0\uB97C \uC815\uC758\uD560 \uC218 \uC5C6\uC74C: {0}"}, | |
| 189 | + {"appletsecurityexception.cannotsetfactory", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: \uD329\uD1A0\uB9AC\uB97C \uC124\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."}, | |
| 190 | + {"appletsecurityexception.checkmemberaccess", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: \uBA64\uBC84 \uC561\uC138\uC2A4\uB97C \uD655\uC778\uD558\uC2ED\uC2DC\uC624."}, | |
| 191 | + {"appletsecurityexception.checkgetprintjob", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: getPrintJob"}, | |
| 192 | + {"appletsecurityexception.checksystemclipboardaccess", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: getSystemClipboard"}, | |
| 193 | + {"appletsecurityexception.checkawteventqueueaccess", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: getEventQueue"}, | |
| 194 | + {"appletsecurityexception.checksecurityaccess", "\uBCF4\uC548 \uC608\uC678 \uC0AC\uD56D: \uBCF4\uC548 \uC791\uC5C5: {0}"}, | |
| 195 | + {"appletsecurityexception.getsecuritycontext.unknown", "\uC54C \uC218 \uC5C6\uB294 \uD074\uB798\uC2A4 \uB85C\uB354 \uC720\uD615\uC785\uB2C8\uB2E4. getContext\uB97C \uD655\uC778\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."}, | |
| 196 | + {"appletsecurityexception.checkread.unknown", "\uC54C \uC218 \uC5C6\uB294 \uD074\uB798\uC2A4 \uB85C\uB354 \uC720\uD615\uC785\uB2C8\uB2E4. {0} \uC77D\uAE30\uB97C \uD655\uC778\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."}, | |
| 197 | + {"appletsecurityexception.checkconnect.unknown", "\uC54C \uC218 \uC5C6\uB294 \uD074\uB798\uC2A4 \uB85C\uB354 \uC720\uD615\uC785\uB2C8\uB2E4. \uC811\uC18D\uC744 \uD655\uC778\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."}, | |
| 198 | + }; | |
| 199 | + | |
| 200 | + return temp; | |
| 201 | + } | |
| 202 | +} | |
| @@ -0,0 +1,202 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1996, 2011, 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 | +package sun.applet.resources; | |
| 26 | + | |
| 27 | +import java.util.ListResourceBundle; | |
| 28 | + | |
| 29 | +public class MsgAppletViewer_pt_BR extends ListResourceBundle { | |
| 30 | + | |
| 31 | + public Object[][] getContents() { | |
| 32 | + Object[][] temp = new Object[][] { | |
| 33 | + {"textframe.button.dismiss", "Rejeitar"}, | |
| 34 | + {"appletviewer.tool.title", "Visualizador do Applet: {0}"}, | |
| 35 | + {"appletviewer.menu.applet", "Applet"}, | |
| 36 | + {"appletviewer.menuitem.restart", "Reiniciar"}, | |
| 37 | + {"appletviewer.menuitem.reload", "Recarregar"}, | |
| 38 | + {"appletviewer.menuitem.stop", "Interromper"}, | |
| 39 | + {"appletviewer.menuitem.save", "Salvar"}, | |
| 40 | + {"appletviewer.menuitem.start", "Iniciar"}, | |
| 41 | + {"appletviewer.menuitem.clone", "Clonar..."}, | |
| 42 | + {"appletviewer.menuitem.tag", "Tag..."}, | |
| 43 | + {"appletviewer.menuitem.info", "Informa\u00E7\u00F5es..."}, | |
| 44 | + {"appletviewer.menuitem.edit", "Editar"}, | |
| 45 | + {"appletviewer.menuitem.encoding", "Codifica\u00E7\u00E3o do Caractere"}, | |
| 46 | + {"appletviewer.menuitem.print", "Imprimir..."}, | |
| 47 | + {"appletviewer.menuitem.props", "Propriedades..."}, | |
| 48 | + {"appletviewer.menuitem.close", "Fechar"}, | |
| 49 | + {"appletviewer.menuitem.quit", "Sair"}, | |
| 50 | + {"appletviewer.label.hello", "Ol\u00E1..."}, | |
| 51 | + {"appletviewer.status.start", "iniciando o applet..."}, | |
| 52 | + {"appletviewer.appletsave.filedialogtitle","Serializar Applet no Arquivo"}, | |
| 53 | + {"appletviewer.appletsave.err1", "serializando um {0} para {1}"}, | |
| 54 | + {"appletviewer.appletsave.err2", "no appletSave: {0}"}, | |
| 55 | + {"appletviewer.applettag", "Tag mostrada"}, | |
| 56 | + {"appletviewer.applettag.textframe", "Tag HTML do Applet"}, | |
| 57 | + {"appletviewer.appletinfo.applet", "-- nenhuma informa\u00E7\u00E3o do applet --"}, | |
| 58 | + {"appletviewer.appletinfo.param", "-- sem informa\u00E7\u00E3o de par\u00E2metro --"}, | |
| 59 | + {"appletviewer.appletinfo.textframe", "Informa\u00E7\u00F5es do Applet"}, | |
| 60 | + {"appletviewer.appletprint.fail", "Falha na impress\u00E3o."}, | |
| 61 | + {"appletviewer.appletprint.finish", "Impress\u00E3o finalizada."}, | |
| 62 | + {"appletviewer.appletprint.cancel", "Impress\u00E3o cancelada."}, | |
| 63 | + {"appletviewer.appletencoding", "Codifica\u00E7\u00E3o de Caractere: {0}"}, | |
| 64 | + {"appletviewer.parse.warning.requiresname", "Advert\u00EAncia: a tag <param name=... value=...> requer um atributo de nome."}, | |
| 65 | + {"appletviewer.parse.warning.paramoutside", "Advert\u00EAncia: a tag <param> externa <applet> ... </applet>."}, | |
| 66 | + {"appletviewer.parse.warning.applet.requirescode", "Advert\u00EAncia: a tag <applet> requer um atributo de c\u00F3digo."}, | |
| 67 | + {"appletviewer.parse.warning.applet.requiresheight", "Advert\u00EAncia: a tag <applet> requer um atributo de altura."}, | |
| 68 | + {"appletviewer.parse.warning.applet.requireswidth", "Advert\u00EAncia: a tag <applet> requer um atributo de largura."}, | |
| 69 | + {"appletviewer.parse.warning.object.requirescode", "Advert\u00EAncia: a tag <object> requer um atributo de c\u00F3digo."}, | |
| 70 | + {"appletviewer.parse.warning.object.requiresheight", "Advert\u00EAncia: a tag <object> requer um atributo de altura."}, | |
| 71 | + {"appletviewer.parse.warning.object.requireswidth", "Advert\u00EAncia: a tag <object> requer um atributo de largura."}, | |
| 72 | + {"appletviewer.parse.warning.embed.requirescode", "Advert\u00EAncia: a tag <embed> requer um atributo de c\u00F3digo."}, | |
| 73 | + {"appletviewer.parse.warning.embed.requiresheight", "Advert\u00EAncia: a tag <embed> requer um atributo de altura."}, | |
| 74 | + {"appletviewer.parse.warning.embed.requireswidth", "Advert\u00EAncia: a tag <embed> requer um atributo de largura."}, | |
| 75 | + {"appletviewer.parse.warning.appnotLongersupported", "Advert\u00EAncia: a tag <app> n\u00E3o \u00E9 mais suportada; use <applet>:"}, | |
| 76 | + {"appletviewer.usage", "Uso: appletviewer <op\u00E7\u00F5es> url(s)\n\nem que as <op\u00E7\u00F5es> incluem:\n -debug Inicia o visualizador do applet no depurador Java\n -encoding <codifica\u00E7\u00E3o> Especifica a codifica\u00E7\u00E3o de caractere usada pelos arquivos HTML\n -J<flag de runtime> Informa o argumento ao intepretador java\n\nA op\u00E7\u00E3o -J n\u00E3o \u00E9 padr\u00E3o e est\u00E1 sujeita \u00E0 altera\u00E7\u00E3o sem notifica\u00E7\u00E3o."}, | |
| 77 | + {"appletviewer.main.err.unsupportedopt", "Op\u00E7\u00E3o n\u00E3o suportada: {0}"}, | |
| 78 | + {"appletviewer.main.err.unrecognizedarg", "Argumento n\u00E3o reconhecido: {0}"}, | |
| 79 | + {"appletviewer.main.err.dupoption", "Uso duplicado da op\u00E7\u00E3o: {0}"}, | |
| 80 | + {"appletviewer.main.err.inputfile", "Nenhum arquivo de entrada especificado."}, | |
| 81 | + {"appletviewer.main.err.badurl", "URL Inv\u00E1lido: {0} ( {1} )"}, | |
| 82 | + {"appletviewer.main.err.io", "Exce\u00E7\u00E3o de E/S ao ler: {0}"}, | |
| 83 | + {"appletviewer.main.err.readablefile", "Certifique-se de que {0} seja um arquivo e seja leg\u00EDvel."}, | |
| 84 | + {"appletviewer.main.err.correcturl", "O URL {0} est\u00E1 correto?"}, | |
| 85 | + {"appletviewer.main.prop.store", "Propriedades espec\u00EDficas do usu\u00E1rio do AppletViewer"}, | |
| 86 | + {"appletviewer.main.err.prop.cantread", "N\u00E3o \u00E9 poss\u00EDvel ler o arquivo de propriedades do usu\u00E1rio: {0}"}, | |
| 87 | + {"appletviewer.main.err.prop.cantsave", "N\u00E3o \u00E9 poss\u00EDvel salvar o arquivo de propriedades do usu\u00E1rio: {0}"}, | |
| 88 | + {"appletviewer.main.warn.nosecmgr", "Advert\u00EAncia: desativando a seguran\u00E7a."}, | |
| 89 | + {"appletviewer.main.debug.cantfinddebug", "N\u00E3o \u00E9 poss\u00EDvel localizar o depurador!"}, | |
| 90 | + {"appletviewer.main.debug.cantfindmain", "N\u00E3o \u00E9 poss\u00EDvel localizar o m\u00E9todo principal no depurador!"}, | |
| 91 | + {"appletviewer.main.debug.exceptionindebug", "Exce\u00E7\u00E3o no depurador!"}, | |
| 92 | + {"appletviewer.main.debug.cantaccess", "N\u00E3o \u00E9 poss\u00EDvel acessar o depurador!"}, | |
| 93 | + {"appletviewer.main.nosecmgr", "Advert\u00EAncia: SecurityManager n\u00E3o instalado!"}, | |
| 94 | + {"appletviewer.main.warning", "Advert\u00EAncia: Nenhum applet iniciado. Certifique-se de que a entrada contenha uma tag <applet>."}, | |
| 95 | + {"appletviewer.main.warn.prop.overwrite", "Advert\u00EAncia: Substituindo a propriedade do sistema temporariamente a pedido do usu\u00E1rio: chave: {0} valor antigo: {1} valor novo: {2}"}, | |
| 96 | + {"appletviewer.main.warn.cantreadprops", "Advert\u00EAncia: N\u00E3o \u00E9 poss\u00EDvel ler o arquivo de propriedades AppletViewer: {0} Usando defaults."}, | |
| 97 | + {"appletioexception.loadclass.throw.interrupted", "carregamento de classe interrompido: {0}"}, | |
| 98 | + {"appletioexception.loadclass.throw.notloaded", "classe n\u00E3o carregada: {0}"}, | |
| 99 | + {"appletclassloader.loadcode.verbose", "Fluxo de abertura para: {0} para obter {1}"}, | |
| 100 | + {"appletclassloader.filenotfound", "Arquivo n\u00E3o encontrado ao procurar: {0}"}, | |
| 101 | + {"appletclassloader.fileformat", "Exce\u00E7\u00E3o de formato do arquivo ao carregar: {0}"}, | |
| 102 | + {"appletclassloader.fileioexception", "Exce\u00E7\u00E3o de E/S ao carregar: {0}"}, | |
| 103 | + {"appletclassloader.fileexception", "exce\u00E7\u00E3o de {0} ao carregar: {1}"}, | |
| 104 | + {"appletclassloader.filedeath", "{0} eliminado ao carregar: {1}"}, | |
| 105 | + {"appletclassloader.fileerror", "erro de {0} ao carregar: {1}"}, | |
| 106 | + {"appletclassloader.findclass.verbose.openstream", "Fluxo de abertura para: {0} para obter {1}"}, | |
| 107 | + {"appletclassloader.getresource.verbose.forname", "AppletClassLoader.getResource do nome: {0}"}, | |
| 108 | + {"appletclassloader.getresource.verbose.found", "Recurso encontrado: {0} como um recurso do sistema"}, | |
| 109 | + {"appletclassloader.getresourceasstream.verbose", "Recurso encontrado: {0} como um recurso do sistema"}, | |
| 110 | + {"appletpanel.runloader.err", "Par\u00E2metro de c\u00F3digo ou objeto!"}, | |
| 111 | + {"appletpanel.runloader.exception", "exce\u00E7\u00E3o ao desserializar {0}"}, | |
| 112 | + {"appletpanel.destroyed", "Applet destru\u00EDdo."}, | |
| 113 | + {"appletpanel.loaded", "Applet carregado."}, | |
| 114 | + {"appletpanel.started", "Applet iniciado."}, | |
| 115 | + {"appletpanel.inited", "Applet inicializado."}, | |
| 116 | + {"appletpanel.stopped", "Applet interrompido."}, | |
| 117 | + {"appletpanel.disposed", "Applet descartado."}, | |
| 118 | + {"appletpanel.nocode", "A tag APPLET n\u00E3o encontrou o par\u00E2metro CODE."}, | |
| 119 | + {"appletpanel.notfound", "carga: classe {0} n\u00E3o encontrada."}, | |
| 120 | + {"appletpanel.nocreate", "carga: {0} n\u00E3o pode ser instanciada."}, | |
| 121 | + {"appletpanel.noconstruct", "carga: {0} n\u00E3o \u00E9 p\u00FAblica ou n\u00E3o tem construtor p\u00FAblico."}, | |
| 122 | + {"appletpanel.death", "eliminado"}, | |
| 123 | + {"appletpanel.exception", "exce\u00E7\u00E3o: {0}."}, | |
| 124 | + {"appletpanel.exception2", "exce\u00E7\u00E3o: {0}: {1}."}, | |
| 125 | + {"appletpanel.error", "erro: {0}."}, | |
| 126 | + {"appletpanel.error2", "erro: {0}: {1}."}, | |
| 127 | + {"appletpanel.notloaded", "Inic: applet n\u00E3o carregado."}, | |
| 128 | + {"appletpanel.notinited", "Iniciar: applet n\u00E3o inicializado."}, | |
| 129 | + {"appletpanel.notstarted", "Interromper: applet n\u00E3o inicializado."}, | |
| 130 | + {"appletpanel.notstopped", "Destruir: applet n\u00E3o interrompido."}, | |
| 131 | + {"appletpanel.notdestroyed", "Descartar: applet n\u00E3o destru\u00EDdo."}, | |
| 132 | + {"appletpanel.notdisposed", "Carregar: applet n\u00E3o descartado."}, | |
| 133 | + {"appletpanel.bail", "Interrompido: esvaziando."}, | |
| 134 | + {"appletpanel.filenotfound", "Arquivo n\u00E3o encontrado ao procurar: {0}"}, | |
| 135 | + {"appletpanel.fileformat", "Exce\u00E7\u00E3o de formato do arquivo ao carregar: {0}"}, | |
| 136 | + {"appletpanel.fileioexception", "Exce\u00E7\u00E3o de E/S ao carregar: {0}"}, | |
| 137 | + {"appletpanel.fileexception", "exce\u00E7\u00E3o de {0} ao carregar: {1}"}, | |
| 138 | + {"appletpanel.filedeath", "{0} eliminado ao carregar: {1}"}, | |
| 139 | + {"appletpanel.fileerror", "erro de {0} ao carregar: {1}"}, | |
| 140 | + {"appletpanel.badattribute.exception", "Parse de HTML: valor incorreto do atributo de largura/altura"}, | |
| 141 | + {"appletillegalargumentexception.objectinputstream", "AppletObjectInputStream requer um carregador n\u00E3o nulo"}, | |
| 142 | + {"appletprops.title", "Propriedades do AppletViewer"}, | |
| 143 | + {"appletprops.label.http.server", "Servidor proxy Http:"}, | |
| 144 | + {"appletprops.label.http.proxy", "Porta proxy Http:"}, | |
| 145 | + {"appletprops.label.network", "Acesso de rede:"}, | |
| 146 | + {"appletprops.choice.network.item.none", "Nenhum"}, | |
| 147 | + {"appletprops.choice.network.item.applethost", "Host do Applet"}, | |
| 148 | + {"appletprops.choice.network.item.unrestricted", "Irrestrito"}, | |
| 149 | + {"appletprops.label.class", "Acesso \u00E0 classe:"}, | |
| 150 | + {"appletprops.choice.class.item.restricted", "Restrito"}, | |
| 151 | + {"appletprops.choice.class.item.unrestricted", "Irrestrito"}, | |
| 152 | + {"appletprops.label.unsignedapplet", "Permitir applets n\u00E3o assinados:"}, | |
| 153 | + {"appletprops.choice.unsignedapplet.no", "N\u00E3o"}, | |
| 154 | + {"appletprops.choice.unsignedapplet.yes", "Sim"}, | |
| 155 | + {"appletprops.button.apply", "Aplicar"}, | |
| 156 | + {"appletprops.button.cancel", "Cancelar"}, | |
| 157 | + {"appletprops.button.reset", "Redefinir"}, | |
| 158 | + {"appletprops.apply.exception", "Falha ao salvar as propriedades: {0}"}, | |
| 159 | + /* 4066432 */ | |
| 160 | + {"appletprops.title.invalidproxy", "Entrada Inv\u00E1lida"}, | |
| 161 | + {"appletprops.label.invalidproxy", "A Porta Proxy deve ser um valor inteiro positivo."}, | |
| 162 | + {"appletprops.button.ok", "OK"}, | |
| 163 | + /* end 4066432 */ | |
| 164 | + {"appletprops.prop.store", "Propriedades espec\u00EDficas do usu\u00E1rio do AppletViewer"}, | |
| 165 | + {"appletsecurityexception.checkcreateclassloader", "Exce\u00E7\u00E3o de Seguran\u00E7a: carregador de classes"}, | |
| 166 | + {"appletsecurityexception.checkaccess.thread", "Exce\u00E7\u00E3o de Seguran\u00E7a: thread"}, | |
| 167 | + {"appletsecurityexception.checkaccess.threadgroup", "Exce\u00E7\u00E3o de Seguran\u00E7a: grupo de threads: {0}"}, | |
| 168 | + {"appletsecurityexception.checkexit", "Exce\u00E7\u00E3o de Seguran\u00E7a: sa\u00EDda: {0}"}, | |
| 169 | + {"appletsecurityexception.checkexec", "Exce\u00E7\u00E3o de Seguran\u00E7a: exec.: {0}"}, | |
| 170 | + {"appletsecurityexception.checklink", "Exce\u00E7\u00E3o de Seguran\u00E7a: link: {0}"}, | |
| 171 | + {"appletsecurityexception.checkpropsaccess", "Exce\u00E7\u00E3o de Seguran\u00E7a: propriedades"}, | |
| 172 | + {"appletsecurityexception.checkpropsaccess.key", "Exce\u00E7\u00E3o de Seguran\u00E7a: acesso \u00E0s propriedades {0}"}, | |
| 173 | + {"appletsecurityexception.checkread.exception1", "Exce\u00E7\u00E3o de Seguran\u00E7a: {0}, {1}"}, | |
| 174 | + {"appletsecurityexception.checkread.exception2", "Exce\u00E7\u00E3o de Seguran\u00E7a: file.read: {0}"}, | |
| 175 | + {"appletsecurityexception.checkread", "Exce\u00E7\u00E3o de Seguran\u00E7a: file.read: {0} == {1}"}, | |
| 176 | + {"appletsecurityexception.checkwrite.exception", "Exce\u00E7\u00E3o de Seguran\u00E7a: {0}, {1}"}, | |
| 177 | + {"appletsecurityexception.checkwrite", "Exce\u00E7\u00E3o de Seguran\u00E7a: file.write: {0} == {1}"}, | |
| 178 | + {"appletsecurityexception.checkread.fd", "Exce\u00E7\u00E3o de Seguran\u00E7a: fd.read"}, | |
| 179 | + {"appletsecurityexception.checkwrite.fd", "Exce\u00E7\u00E3o de Seguran\u00E7a: fd.write"}, | |
| 180 | + {"appletsecurityexception.checklisten", "Exce\u00E7\u00E3o de Seguran\u00E7a: socket.listen: {0}"}, | |
| 181 | + {"appletsecurityexception.checkaccept", "Exce\u00E7\u00E3o de Seguran\u00E7a: socket.accept: {0}:{1}"}, | |
| 182 | + {"appletsecurityexception.checkconnect.networknone", "Exce\u00E7\u00E3o de Seguran\u00E7a: socket.connect: {0}->{1}"}, | |
| 183 | + {"appletsecurityexception.checkconnect.networkhost1", "Exce\u00E7\u00E3o de Seguran\u00E7a: N\u00E3o foi poss\u00EDvel estabelecer conex\u00E3o com {0} com a origem de {1}."}, | |
| 184 | + {"appletsecurityexception.checkconnect.networkhost2", "Exce\u00E7\u00E3o de Seguran\u00E7a: N\u00E3o foi poss\u00EDvel resolver o IP para o host {0} ou para {1}. "}, | |
| 185 | + {"appletsecurityexception.checkconnect.networkhost3", "Exce\u00E7\u00E3o de Seguran\u00E7a: N\u00E3o foi poss\u00EDvel resolver o IP para o host {0}. Consulte a propriedade trustProxy."}, | |
| 186 | + {"appletsecurityexception.checkconnect", "Exce\u00E7\u00E3o de Seguran\u00E7a: conectar: {0}->{1}"}, | |
| 187 | + {"appletsecurityexception.checkpackageaccess", "Exce\u00E7\u00E3o de Seguran\u00E7a: n\u00E3o \u00E9 poss\u00EDvel acessar o pacote: {0}"}, | |
| 188 | + {"appletsecurityexception.checkpackagedefinition", "Exce\u00E7\u00E3o de Seguran\u00E7a: n\u00E3o \u00E9 poss\u00EDvel definir o pacote: {0}"}, | |
| 189 | + {"appletsecurityexception.cannotsetfactory", "Exce\u00E7\u00E3o de Seguran\u00E7a: n\u00E3o \u00E9 poss\u00EDvel definir o factory"}, | |
| 190 | + {"appletsecurityexception.checkmemberaccess", "Exce\u00E7\u00E3o de Seguran\u00E7a: verificar acesso do membro"}, | |
| 191 | + {"appletsecurityexception.checkgetprintjob", "Exce\u00E7\u00E3o de Seguran\u00E7a: getPrintJob"}, | |
| 192 | + {"appletsecurityexception.checksystemclipboardaccess", "Exce\u00E7\u00E3o de Seguran\u00E7a: getSystemClipboard"}, | |
| 193 | + {"appletsecurityexception.checkawteventqueueaccess", "Exce\u00E7\u00E3o de Seguran\u00E7a: getEventQueue"}, | |
| 194 | + {"appletsecurityexception.checksecurityaccess", "Exce\u00E7\u00E3o de Seguran\u00E7a: opera\u00E7\u00E3o de seguran\u00E7a: {0}"}, | |
| 195 | + {"appletsecurityexception.getsecuritycontext.unknown", "tipo de carregador de classe desconhecido. n\u00E3o \u00E9 poss\u00EDvel verificar getContext"}, | |
| 196 | + {"appletsecurityexception.checkread.unknown", "tipo de carregador de classe desconhecido. n\u00E3o \u00E9 poss\u00EDvel verificar a leitura {0}"}, | |
| 197 | + {"appletsecurityexception.checkconnect.unknown", "tipo de carregador de classe desconhecido. n\u00E3o \u00E9 poss\u00EDvel verificar a conex\u00E3o"}, | |
| 198 | + }; | |
| 199 | + | |
| 200 | + return temp; | |
| 201 | + } | |
| 202 | +} | |
| @@ -0,0 +1,202 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1996, 2011, 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 | +package sun.applet.resources; | |
| 26 | + | |
| 27 | +import java.util.ListResourceBundle; | |
| 28 | + | |
| 29 | +public class MsgAppletViewer_sv extends ListResourceBundle { | |
| 30 | + | |
| 31 | + public Object[][] getContents() { | |
| 32 | + Object[][] temp = new Object[][] { | |
| 33 | + {"textframe.button.dismiss", "St\u00E4ng"}, | |
| 34 | + {"appletviewer.tool.title", "Applet Viewer: {0}"}, | |
| 35 | + {"appletviewer.menu.applet", "Applet"}, | |
| 36 | + {"appletviewer.menuitem.restart", "Starta om"}, | |
| 37 | + {"appletviewer.menuitem.reload", "Ladda om"}, | |
| 38 | + {"appletviewer.menuitem.stop", "Stopp"}, | |
| 39 | + {"appletviewer.menuitem.save", "Spara..."}, | |
| 40 | + {"appletviewer.menuitem.start", "Starta"}, | |
| 41 | + {"appletviewer.menuitem.clone", "Klona..."}, | |
| 42 | + {"appletviewer.menuitem.tag", "Tagg..."}, | |
| 43 | + {"appletviewer.menuitem.info", "Information..."}, | |
| 44 | + {"appletviewer.menuitem.edit", "Redigera"}, | |
| 45 | + {"appletviewer.menuitem.encoding", "Teckenkodning"}, | |
| 46 | + {"appletviewer.menuitem.print", "Skriv ut..."}, | |
| 47 | + {"appletviewer.menuitem.props", "Egenskaper..."}, | |
| 48 | + {"appletviewer.menuitem.close", "St\u00E4ng"}, | |
| 49 | + {"appletviewer.menuitem.quit", "Avsluta"}, | |
| 50 | + {"appletviewer.label.hello", "Hej..."}, | |
| 51 | + {"appletviewer.status.start", "startar applet..."}, | |
| 52 | + {"appletviewer.appletsave.filedialogtitle","Serialisera applet till fil"}, | |
| 53 | + {"appletviewer.appletsave.err1", "serialiserar {0} till {1}"}, | |
| 54 | + {"appletviewer.appletsave.err2", "i appletSave: {0}"}, | |
| 55 | + {"appletviewer.applettag", "Tagg visas"}, | |
| 56 | + {"appletviewer.applettag.textframe", "HTML-tagg f\u00F6r applet"}, | |
| 57 | + {"appletviewer.appletinfo.applet", "-- ingen appletinformation --"}, | |
| 58 | + {"appletviewer.appletinfo.param", "-- ingen parameterinformation --"}, | |
| 59 | + {"appletviewer.appletinfo.textframe", "Appletinformation"}, | |
| 60 | + {"appletviewer.appletprint.fail", "Kunde inte skriva ut."}, | |
| 61 | + {"appletviewer.appletprint.finish", "Utskriften klar."}, | |
| 62 | + {"appletviewer.appletprint.cancel", "Utskriften avbruten."}, | |
| 63 | + {"appletviewer.appletencoding", "Teckenkodning: {0}"}, | |
| 64 | + {"appletviewer.parse.warning.requiresname", "Varning: <param name=... value=...>-taggen kr\u00E4ver ett namnattribut."}, | |
| 65 | + {"appletviewer.parse.warning.paramoutside", "Varning: <param>-taggen finns utanf\u00F6r <applet> ... </applet>."}, | |
| 66 | + {"appletviewer.parse.warning.applet.requirescode", "Varning: <applet>-taggen kr\u00E4ver ett kodattribut."}, | |
| 67 | + {"appletviewer.parse.warning.applet.requiresheight", "Varning: <applet>-taggen kr\u00E4ver ett h\u00F6jdattribut."}, | |
| 68 | + {"appletviewer.parse.warning.applet.requireswidth", "Varning: <applet>-taggen kr\u00E4ver ett breddattribut."}, | |
| 69 | + {"appletviewer.parse.warning.object.requirescode", "Varning: <object>-taggen kr\u00E4ver ett kodattribut."}, | |
| 70 | + {"appletviewer.parse.warning.object.requiresheight", "Varning: <object>-taggen kr\u00E4ver ett h\u00F6jdattribut."}, | |
| 71 | + {"appletviewer.parse.warning.object.requireswidth", "Varning: <object>-taggen kr\u00E4ver ett breddattribut."}, | |
| 72 | + {"appletviewer.parse.warning.embed.requirescode", "Varning: <embed>-taggen kr\u00E4ver ett kodattribut."}, | |
| 73 | + {"appletviewer.parse.warning.embed.requiresheight", "Varning: <embed>-taggen kr\u00E4ver ett h\u00F6jdattribut."}, | |
| 74 | + {"appletviewer.parse.warning.embed.requireswidth", "Varning: <embed>-taggen kr\u00E4ver ett breddattribut."}, | |
| 75 | + {"appletviewer.parse.warning.appnotLongersupported", "Varning: <app>-taggen st\u00F6ds inte l\u00E4ngre, anv\u00E4nd <applet> ist\u00E4llet:"}, | |
| 76 | + {"appletviewer.usage", "Syntax: appletviewer-<alternativ> url:er \n\nd\u00E4r <alternativ> inkluderar:\n -debug Startar appletvisning i Java-fels\u00F6kningen\n -encoding <kodning> Anger teckenkodning som anv\u00E4nds i HTML-filer\n -J<k\u00F6rningsflagga> \u00D6verf\u00F6r argument till Java-tolkningen\n\nAlternativet -J \u00E4r inte standard och kan \u00E4ndras utan f\u00F6reg\u00E5ende meddelande."}, | |
| 77 | + {"appletviewer.main.err.unsupportedopt", "Alternativ som inte st\u00F6ds: {0}"}, | |
| 78 | + {"appletviewer.main.err.unrecognizedarg", "Ok\u00E4nt argument: {0}"}, | |
| 79 | + {"appletviewer.main.err.dupoption", "Duplicerat alternativ: {0}"}, | |
| 80 | + {"appletviewer.main.err.inputfile", "Inga angivna indatafiler."}, | |
| 81 | + {"appletviewer.main.err.badurl", "Felaktig URL: {0} ( {1} )"}, | |
| 82 | + {"appletviewer.main.err.io", "I/O-undantag vid l\u00E4sning: {0}"}, | |
| 83 | + {"appletviewer.main.err.readablefile", "Kontrollera att {0} \u00E4r en fil som \u00E4r l\u00E4sbar."}, | |
| 84 | + {"appletviewer.main.err.correcturl", "\u00C4r {0} den korrekta URL:en?"}, | |
| 85 | + {"appletviewer.main.prop.store", "Anv\u00E4ndarspecifika egenskaper f\u00F6r AppletViewer"}, | |
| 86 | + {"appletviewer.main.err.prop.cantread", "Kan inte l\u00E4sa egenskapsfilen: {0}"}, | |
| 87 | + {"appletviewer.main.err.prop.cantsave", "Kan inte spara egenskapsfilen: {0}"}, | |
| 88 | + {"appletviewer.main.warn.nosecmgr", "Varning: s\u00E4kerheten inaktiveras."}, | |
| 89 | + {"appletviewer.main.debug.cantfinddebug", "Hittar inte fels\u00F6kningsprogrammet!"}, | |
| 90 | + {"appletviewer.main.debug.cantfindmain", "Hittar inte huvudmetoden i fels\u00F6kningsprogrammet!"}, | |
| 91 | + {"appletviewer.main.debug.exceptionindebug", "Undantag i fels\u00F6kningsprogrammet!"}, | |
| 92 | + {"appletviewer.main.debug.cantaccess", "Det finns ingen \u00E5tkomst till fels\u00F6kningsprogrammet!"}, | |
| 93 | + {"appletviewer.main.nosecmgr", "Varning: SecurityManager har inte installerats!"}, | |
| 94 | + {"appletviewer.main.warning", "Varning: Inga appletar har startats. Kontrollera att indata inneh\u00E5ller <applet>-tagg."}, | |
| 95 | + {"appletviewer.main.warn.prop.overwrite", "Varning: Skriver tillf\u00E4lligt \u00F6ver systemegenskap enligt beg\u00E4ran fr\u00E5n anv\u00E4ndare: nyckel: {0} gammalt v\u00E4rde: {1} nytt v\u00E4rde: {2}"}, | |
| 96 | + {"appletviewer.main.warn.cantreadprops", "Varning: Kan inte l\u00E4sa egenskapsfil f\u00F6r AppletViewer: {0} Standardv\u00E4rden anv\u00E4nds."}, | |
| 97 | + {"appletioexception.loadclass.throw.interrupted", "klassinl\u00E4sning avbr\u00F6ts: {0}"}, | |
| 98 | + {"appletioexception.loadclass.throw.notloaded", "klass inte inl\u00E4st: {0}"}, | |
| 99 | + {"appletclassloader.loadcode.verbose", "\u00D6ppnar str\u00F6m till: {0} f\u00F6r h\u00E4mtning av {1}"}, | |
| 100 | + {"appletclassloader.filenotfound", "Hittade inte fil vid s\u00F6kning efter: {0}"}, | |
| 101 | + {"appletclassloader.fileformat", "Undantag av filformat vid l\u00E4sning av: {0}"}, | |
| 102 | + {"appletclassloader.fileioexception", "I/O-undantag vid l\u00E4sning: {0}"}, | |
| 103 | + {"appletclassloader.fileexception", "{0} undantag vid l\u00E4sning: {1}"}, | |
| 104 | + {"appletclassloader.filedeath", "{0} avslutad vid l\u00E4sning: {1}"}, | |
| 105 | + {"appletclassloader.fileerror", "{0} fel vid l\u00E4sning: {1}"}, | |
| 106 | + {"appletclassloader.findclass.verbose.openstream", "\u00D6ppnar str\u00F6m till: {0} f\u00F6r h\u00E4mtning av {1}"}, | |
| 107 | + {"appletclassloader.getresource.verbose.forname", "AppletClassLoader.getResource f\u00F6r namnet: {0}"}, | |
| 108 | + {"appletclassloader.getresource.verbose.found", "Hittade resursen: {0} som systemresurs"}, | |
| 109 | + {"appletclassloader.getresourceasstream.verbose", "Hittade resursen: {0} som systemresurs"}, | |
| 110 | + {"appletpanel.runloader.err", "Antingen objekt- eller kodparameter!"}, | |
| 111 | + {"appletpanel.runloader.exception", "undantag vid avserialisering {0}"}, | |
| 112 | + {"appletpanel.destroyed", "Applet raderad."}, | |
| 113 | + {"appletpanel.loaded", "Applet laddad."}, | |
| 114 | + {"appletpanel.started", "Applet startad."}, | |
| 115 | + {"appletpanel.inited", "Applet initierad."}, | |
| 116 | + {"appletpanel.stopped", "Applet stoppad."}, | |
| 117 | + {"appletpanel.disposed", "Applet kasserad."}, | |
| 118 | + {"appletpanel.nocode", "APPLET-tagg saknar CODE-parameter."}, | |
| 119 | + {"appletpanel.notfound", "load: hittade inte klassen {0}."}, | |
| 120 | + {"appletpanel.nocreate", "load: {0} kan inte instansieras."}, | |
| 121 | + {"appletpanel.noconstruct", "load: {0} \u00E4r inte allm\u00E4n eller saknar allm\u00E4n konstruktor."}, | |
| 122 | + {"appletpanel.death", "avslutad"}, | |
| 123 | + {"appletpanel.exception", "undantag: {0}."}, | |
| 124 | + {"appletpanel.exception2", "undantag: {0}: {1}."}, | |
| 125 | + {"appletpanel.error", "fel: {0}."}, | |
| 126 | + {"appletpanel.error2", "fel {0}: {1}."}, | |
| 127 | + {"appletpanel.notloaded", "Initiera: applet \u00E4r inte inl\u00E4st."}, | |
| 128 | + {"appletpanel.notinited", "Starta: applet \u00E4r inte initierad."}, | |
| 129 | + {"appletpanel.notstarted", "Stoppa: applet har inte startats."}, | |
| 130 | + {"appletpanel.notstopped", "Radera: applet har inte stoppats."}, | |
| 131 | + {"appletpanel.notdestroyed", "Kassera: applet har inte raderats."}, | |
| 132 | + {"appletpanel.notdisposed", "Ladda: applet har inte kasserats."}, | |
| 133 | + {"appletpanel.bail", "Avbruten."}, | |
| 134 | + {"appletpanel.filenotfound", "Hittade inte fil vid s\u00F6kning efter: {0}"}, | |
| 135 | + {"appletpanel.fileformat", "Undantag av filformat vid l\u00E4sning av: {0}"}, | |
| 136 | + {"appletpanel.fileioexception", "I/O-undantag vid l\u00E4sning: {0}"}, | |
| 137 | + {"appletpanel.fileexception", "{0} undantag vid l\u00E4sning: {1}"}, | |
| 138 | + {"appletpanel.filedeath", "{0} avslutad vid l\u00E4sning: {1}"}, | |
| 139 | + {"appletpanel.fileerror", "{0} fel vid l\u00E4sning: {1}"}, | |
| 140 | + {"appletpanel.badattribute.exception", "HTML-tolkning: felaktigt v\u00E4rde f\u00F6r bredd-/h\u00F6jdattribut"}, | |
| 141 | + {"appletillegalargumentexception.objectinputstream", "AppletObjectInputStream kr\u00E4ver laddare med icke-null"}, | |
| 142 | + {"appletprops.title", "AppletViewer-egenskaper"}, | |
| 143 | + {"appletprops.label.http.server", "HTTP-proxyserver:"}, | |
| 144 | + {"appletprops.label.http.proxy", "HTTP-proxyport:"}, | |
| 145 | + {"appletprops.label.network", "N\u00E4tverks\u00E5tkomst:"}, | |
| 146 | + {"appletprops.choice.network.item.none", "Ingen"}, | |
| 147 | + {"appletprops.choice.network.item.applethost", "Appletv\u00E4rd"}, | |
| 148 | + {"appletprops.choice.network.item.unrestricted", "Obegr\u00E4nsad"}, | |
| 149 | + {"appletprops.label.class", "Klass\u00E5tkomst:"}, | |
| 150 | + {"appletprops.choice.class.item.restricted", "Begr\u00E4nsad"}, | |
| 151 | + {"appletprops.choice.class.item.unrestricted", "Obegr\u00E4nsad"}, | |
| 152 | + {"appletprops.label.unsignedapplet", "Till\u00E5t osignerade appletar:"}, | |
| 153 | + {"appletprops.choice.unsignedapplet.no", "Nej"}, | |
| 154 | + {"appletprops.choice.unsignedapplet.yes", "Ja"}, | |
| 155 | + {"appletprops.button.apply", "Anv\u00E4nd"}, | |
| 156 | + {"appletprops.button.cancel", "Avbryt"}, | |
| 157 | + {"appletprops.button.reset", "\u00C5terst\u00E4ll"}, | |
| 158 | + {"appletprops.apply.exception", "Kunde inte spara egenskaper: {0}"}, | |
| 159 | + /* 4066432 */ | |
| 160 | + {"appletprops.title.invalidproxy", "Ogiltig post"}, | |
| 161 | + {"appletprops.label.invalidproxy", "Proxyport m\u00E5ste vara ett positivt heltal."}, | |
| 162 | + {"appletprops.button.ok", "OK"}, | |
| 163 | + /* end 4066432 */ | |
| 164 | + {"appletprops.prop.store", "Anv\u00E4ndarspecifika egenskaper f\u00F6r AppletViewer"}, | |
| 165 | + {"appletsecurityexception.checkcreateclassloader", "S\u00E4kerhetsundantag: klassladdare"}, | |
| 166 | + {"appletsecurityexception.checkaccess.thread", "S\u00E4kerhetsundantag: tr\u00E5d"}, | |
| 167 | + {"appletsecurityexception.checkaccess.threadgroup", "S\u00E4kerhetsundantag: tr\u00E5dgrupp: {0}"}, | |
| 168 | + {"appletsecurityexception.checkexit", "S\u00E4kerhetsundantag: utg\u00E5ng: {0}"}, | |
| 169 | + {"appletsecurityexception.checkexec", "S\u00E4kerhetsundantag: exec: {0}"}, | |
| 170 | + {"appletsecurityexception.checklink", "S\u00E4kerhetsundantag: l\u00E4nk: {0}"}, | |
| 171 | + {"appletsecurityexception.checkpropsaccess", "S\u00E4kerhetsundantag: egenskaper"}, | |
| 172 | + {"appletsecurityexception.checkpropsaccess.key", "S\u00E4kerhetsundantag: egenskaps\u00E5tkomst {0}"}, | |
| 173 | + {"appletsecurityexception.checkread.exception1", "S\u00E4kerhetsundantag: {0}, {1}"}, | |
| 174 | + {"appletsecurityexception.checkread.exception2", "S\u00E4kerhetsundantag: file.read: {0}"}, | |
| 175 | + {"appletsecurityexception.checkread", "S\u00E4kerhetsundantag: file.read: {0} == {1}"}, | |
| 176 | + {"appletsecurityexception.checkwrite.exception", "S\u00E4kerhetsundantag: {0}, {1}"}, | |
| 177 | + {"appletsecurityexception.checkwrite", "S\u00E4kerhetsundantag: file.write: {0} == {1}"}, | |
| 178 | + {"appletsecurityexception.checkread.fd", "S\u00E4kerhetsundantag: fd.read"}, | |
| 179 | + {"appletsecurityexception.checkwrite.fd", "S\u00E4kerhetsundantag: fd.write"}, | |
| 180 | + {"appletsecurityexception.checklisten", "S\u00E4kerhetsundantag: socket.listen: {0}"}, | |
| 181 | + {"appletsecurityexception.checkaccept", "S\u00E4kerhetsundantag: socket.accept: {0}:{1}"}, | |
| 182 | + {"appletsecurityexception.checkconnect.networknone", "S\u00E4kerhetsundantag: socket.connect: {0}->{1}"}, | |
| 183 | + {"appletsecurityexception.checkconnect.networkhost1", "S\u00E4kerhetsundantag: Kunde inte ansluta till {0} med ursprung fr\u00E5n {1}."}, | |
| 184 | + {"appletsecurityexception.checkconnect.networkhost2", "S\u00E4kerhetsundantag: Kunde inte matcha IP f\u00F6r v\u00E4rd {0} eller f\u00F6r {1}. "}, | |
| 185 | + {"appletsecurityexception.checkconnect.networkhost3", "S\u00E4kerhetsundantag: Kunde inte matcha IP f\u00F6r v\u00E4rd {0}. Se egenskapen trustProxy."}, | |
| 186 | + {"appletsecurityexception.checkconnect", "S\u00E4kerhetsundantag: connect: {0}->{1}"}, | |
| 187 | + {"appletsecurityexception.checkpackageaccess", "S\u00E4kerhetsundantag: ingen \u00E5tkomst till paket: {0}"}, | |
| 188 | + {"appletsecurityexception.checkpackagedefinition", "S\u00E4kerhetsundantag: kan inte definiera paket: {0}"}, | |
| 189 | + {"appletsecurityexception.cannotsetfactory", "S\u00E4kerhetsundantag: kan inte ange fabrik"}, | |
| 190 | + {"appletsecurityexception.checkmemberaccess", "S\u00E4kerhetsundantag: kontrollera medlems\u00E5tkomst"}, | |
| 191 | + {"appletsecurityexception.checkgetprintjob", "S\u00E4kerhetsundantag: getPrintJob"}, | |
| 192 | + {"appletsecurityexception.checksystemclipboardaccess", "S\u00E4kerhetsundantag: getSystemClipboard"}, | |
| 193 | + {"appletsecurityexception.checkawteventqueueaccess", "S\u00E4kerhetsundantag: getEventQueue"}, | |
| 194 | + {"appletsecurityexception.checksecurityaccess", "S\u00E4kerhetsundantag: s\u00E4kerhets\u00E5tg\u00E4rd: {0}"}, | |
| 195 | + {"appletsecurityexception.getsecuritycontext.unknown", "ok\u00E4nd typ av klassladdare. kan inte kontrollera getContext"}, | |
| 196 | + {"appletsecurityexception.checkread.unknown", "ok\u00E4nd typ av klassladdare. kan inte kontrollera kontroll\u00E4sning {0}"}, | |
| 197 | + {"appletsecurityexception.checkconnect.unknown", "ok\u00E4nd typ av klassladdare. kan inte kontrollera kontrollanslutning"}, | |
| 198 | + }; | |
| 199 | + | |
| 200 | + return temp; | |
| 201 | + } | |
| 202 | +} | |
| @@ -0,0 +1,202 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1996, 2011, 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 | +package sun.applet.resources; | |
| 26 | + | |
| 27 | +import java.util.ListResourceBundle; | |
| 28 | + | |
| 29 | +public class MsgAppletViewer_zh_CN extends ListResourceBundle { | |
| 30 | + | |
| 31 | + public Object[][] getContents() { | |
| 32 | + Object[][] temp = new Object[][] { | |
| 33 | + {"textframe.button.dismiss", "\u5173\u95ED"}, | |
| 34 | + {"appletviewer.tool.title", "\u5C0F\u5E94\u7528\u7A0B\u5E8F\u67E5\u770B\u5668: {0}"}, | |
| 35 | + {"appletviewer.menu.applet", "\u5C0F\u5E94\u7528\u7A0B\u5E8F"}, | |
| 36 | + {"appletviewer.menuitem.restart", "\u91CD\u65B0\u542F\u52A8"}, | |
| 37 | + {"appletviewer.menuitem.reload", "\u91CD\u65B0\u52A0\u8F7D"}, | |
| 38 | + {"appletviewer.menuitem.stop", "\u505C\u6B62"}, | |
| 39 | + {"appletviewer.menuitem.save", "\u4FDD\u5B58..."}, | |
| 40 | + {"appletviewer.menuitem.start", "\u542F\u52A8"}, | |
| 41 | + {"appletviewer.menuitem.clone", "\u514B\u9686..."}, | |
| 42 | + {"appletviewer.menuitem.tag", "\u6807\u8BB0..."}, | |
| 43 | + {"appletviewer.menuitem.info", "\u4FE1\u606F..."}, | |
| 44 | + {"appletviewer.menuitem.edit", "\u7F16\u8F91"}, | |
| 45 | + {"appletviewer.menuitem.encoding", "\u5B57\u7B26\u7F16\u7801"}, | |
| 46 | + {"appletviewer.menuitem.print", "\u6253\u5370..."}, | |
| 47 | + {"appletviewer.menuitem.props", "\u5C5E\u6027..."}, | |
| 48 | + {"appletviewer.menuitem.close", "\u5173\u95ED"}, | |
| 49 | + {"appletviewer.menuitem.quit", "\u9000\u51FA"}, | |
| 50 | + {"appletviewer.label.hello", "\u60A8\u597D..."}, | |
| 51 | + {"appletviewer.status.start", "\u6B63\u5728\u542F\u52A8\u5C0F\u5E94\u7528\u7A0B\u5E8F..."}, | |
| 52 | + {"appletviewer.appletsave.filedialogtitle","\u5C06\u5C0F\u5E94\u7528\u7A0B\u5E8F\u5E8F\u5217\u5316\u4E3A\u6587\u4EF6"}, | |
| 53 | + {"appletviewer.appletsave.err1", "\u5C06{0}\u5E8F\u5217\u5316\u4E3A{1}"}, | |
| 54 | + {"appletviewer.appletsave.err2", "\u5728 appletSave \u4E2D: {0}"}, | |
| 55 | + {"appletviewer.applettag", "\u663E\u793A\u7684\u6807\u8BB0"}, | |
| 56 | + {"appletviewer.applettag.textframe", "\u5C0F\u5E94\u7528\u7A0B\u5E8F HTML \u6807\u8BB0"}, | |
| 57 | + {"appletviewer.appletinfo.applet", "-- \u6CA1\u6709\u5C0F\u5E94\u7528\u7A0B\u5E8F\u4FE1\u606F --"}, | |
| 58 | + {"appletviewer.appletinfo.param", "-- \u6CA1\u6709\u53C2\u6570\u4FE1\u606F --"}, | |
| 59 | + {"appletviewer.appletinfo.textframe", "\u5C0F\u5E94\u7528\u7A0B\u5E8F\u4FE1\u606F"}, | |
| 60 | + {"appletviewer.appletprint.fail", "\u6253\u5370\u5931\u8D25\u3002"}, | |
| 61 | + {"appletviewer.appletprint.finish", "\u5DF2\u5B8C\u6210\u6253\u5370\u3002"}, | |
| 62 | + {"appletviewer.appletprint.cancel", "\u6253\u5370\u5DF2\u53D6\u6D88\u3002"}, | |
| 63 | + {"appletviewer.appletencoding", "\u5B57\u7B26\u7F16\u7801: {0}"}, | |
| 64 | + {"appletviewer.parse.warning.requiresname", "\u8B66\u544A: <param name=... value=...> \u6807\u8BB0\u9700\u8981\u540D\u79F0\u5C5E\u6027\u3002"}, | |
| 65 | + {"appletviewer.parse.warning.paramoutside", "\u8B66\u544A: <param> \u6807\u8BB0\u5728 <applet> ... </applet> \u5916\u90E8\u3002"}, | |
| 66 | + {"appletviewer.parse.warning.applet.requirescode", "\u8B66\u544A: <applet> \u6807\u8BB0\u9700\u8981\u4EE3\u7801\u5C5E\u6027\u3002"}, | |
| 67 | + {"appletviewer.parse.warning.applet.requiresheight", "\u8B66\u544A: <applet> \u6807\u8BB0\u9700\u8981\u9AD8\u5EA6\u5C5E\u6027\u3002"}, | |
| 68 | + {"appletviewer.parse.warning.applet.requireswidth", "\u8B66\u544A: <applet> \u6807\u8BB0\u9700\u8981\u5BBD\u5EA6\u5C5E\u6027\u3002"}, | |
| 69 | + {"appletviewer.parse.warning.object.requirescode", "\u8B66\u544A: <object> \u6807\u8BB0\u9700\u8981\u4EE3\u7801\u5C5E\u6027\u3002"}, | |
| 70 | + {"appletviewer.parse.warning.object.requiresheight", "\u8B66\u544A: <object> \u6807\u8BB0\u9700\u8981\u9AD8\u5EA6\u5C5E\u6027\u3002"}, | |
| 71 | + {"appletviewer.parse.warning.object.requireswidth", "\u8B66\u544A: <object> \u6807\u8BB0\u9700\u8981\u5BBD\u5EA6\u5C5E\u6027\u3002"}, | |
| 72 | + {"appletviewer.parse.warning.embed.requirescode", "\u8B66\u544A: <embed> \u6807\u8BB0\u9700\u8981\u4EE3\u7801\u5C5E\u6027\u3002"}, | |
| 73 | + {"appletviewer.parse.warning.embed.requiresheight", "\u8B66\u544A: <embed> \u6807\u8BB0\u9700\u8981\u9AD8\u5EA6\u5C5E\u6027\u3002"}, | |
| 74 | + {"appletviewer.parse.warning.embed.requireswidth", "\u8B66\u544A: <embed> \u6807\u8BB0\u9700\u8981\u5BBD\u5EA6\u5C5E\u6027\u3002"}, | |
| 75 | + {"appletviewer.parse.warning.appnotLongersupported", "\u8B66\u544A: \u4E0D\u518D\u652F\u6301 <app> \u6807\u8BB0, \u8BF7\u6539\u7528 <applet>:"}, | |
| 76 | + {"appletviewer.usage", "\u7528\u6CD5: appletviewer <options> url\n\n\u5176\u4E2D, <options> \u5305\u62EC:\n -debug \u5728 Java \u8C03\u8BD5\u5668\u4E2D\u542F\u52A8\u5C0F\u5E94\u7528\u7A0B\u5E8F\u67E5\u770B\u5668\n -encoding <encoding> \u6307\u5B9A HTML \u6587\u4EF6\u4F7F\u7528\u7684\u5B57\u7B26\u7F16\u7801\n -J<runtime flag> \u5C06\u53C2\u6570\u4F20\u9012\u5230 java \u89E3\u91CA\u5668\n\n-J \u9009\u9879\u662F\u975E\u6807\u51C6\u9009\u9879, \u5982\u6709\u66F4\u6539, \u6055\u4E0D\u53E6\u884C\u901A\u77E5\u3002"}, | |
| 77 | + {"appletviewer.main.err.unsupportedopt", "\u4E0D\u652F\u6301\u7684\u9009\u9879: {0}"}, | |
| 78 | + {"appletviewer.main.err.unrecognizedarg", "\u65E0\u6CD5\u8BC6\u522B\u7684\u53C2\u6570: {0}"}, | |
| 79 | + {"appletviewer.main.err.dupoption", "\u91CD\u590D\u4F7F\u7528\u9009\u9879: {0}"}, | |
| 80 | + {"appletviewer.main.err.inputfile", "\u672A\u6307\u5B9A\u8F93\u5165\u6587\u4EF6\u3002"}, | |
| 81 | + {"appletviewer.main.err.badurl", "\u9519\u8BEF URL: {0} ({1})"}, | |
| 82 | + {"appletviewer.main.err.io", "\u8BFB\u53D6{0}\u65F6\u51FA\u73B0 I/O \u5F02\u5E38\u9519\u8BEF"}, | |
| 83 | + {"appletviewer.main.err.readablefile", "\u786E\u4FDD{0}\u662F\u6587\u4EF6\u4E14\u53EF\u8BFB\u3002"}, | |
| 84 | + {"appletviewer.main.err.correcturl", "{0} \u662F\u5426\u662F\u6B63\u786E\u7684 URL?"}, | |
| 85 | + {"appletviewer.main.prop.store", "AppletViewer \u7684\u7528\u6237\u7279\u5B9A\u5C5E\u6027"}, | |
| 86 | + {"appletviewer.main.err.prop.cantread", "\u65E0\u6CD5\u8BFB\u53D6\u7528\u6237\u5C5E\u6027\u6587\u4EF6: {0}"}, | |
| 87 | + {"appletviewer.main.err.prop.cantsave", "\u65E0\u6CD5\u4FDD\u5B58\u7528\u6237\u5C5E\u6027\u6587\u4EF6: {0}"}, | |
| 88 | + {"appletviewer.main.warn.nosecmgr", "\u8B66\u544A: \u7981\u7528\u5B89\u5168\u3002"}, | |
| 89 | + {"appletviewer.main.debug.cantfinddebug", "\u627E\u4E0D\u5230\u8C03\u8BD5\u5668!"}, | |
| 90 | + {"appletviewer.main.debug.cantfindmain", "\u5728\u8C03\u8BD5\u5668\u4E2D\u627E\u4E0D\u5230\u4E3B\u8981\u65B9\u6CD5!"}, | |
| 91 | + {"appletviewer.main.debug.exceptionindebug", "\u8C03\u8BD5\u5668\u4E2D\u5B58\u5728\u5F02\u5E38\u9519\u8BEF!"}, | |
| 92 | + {"appletviewer.main.debug.cantaccess", "\u65E0\u6CD5\u8BBF\u95EE\u8C03\u8BD5\u5668!"}, | |
| 93 | + {"appletviewer.main.nosecmgr", "\u8B66\u544A: \u672A\u5B89\u88C5 SecurityManager!"}, | |
| 94 | + {"appletviewer.main.warning", "\u8B66\u544A: \u672A\u542F\u52A8\u5C0F\u5E94\u7528\u7A0B\u5E8F\u3002\u786E\u4FDD\u8F93\u5165\u5305\u542B <applet> \u6807\u8BB0\u3002"}, | |
| 95 | + {"appletviewer.main.warn.prop.overwrite", "\u8B66\u544A: \u6839\u636E\u7528\u6237\u8BF7\u6C42\u4E34\u65F6\u8986\u76D6\u7CFB\u7EDF\u5C5E\u6027: \u5173\u952E\u5B57: {0}, \u65E7\u503C: {1}, \u65B0\u503C: {2}"}, | |
| 96 | + {"appletviewer.main.warn.cantreadprops", "\u8B66\u544A: \u65E0\u6CD5\u8BFB\u53D6 AppletViewer \u5C5E\u6027\u6587\u4EF6: {0}\u3002\u8BF7\u4F7F\u7528\u9ED8\u8BA4\u503C\u3002"}, | |
| 97 | + {"appletioexception.loadclass.throw.interrupted", "\u7C7B\u52A0\u8F7D\u4E2D\u65AD: {0}"}, | |
| 98 | + {"appletioexception.loadclass.throw.notloaded", "\u672A\u52A0\u8F7D\u7C7B: {0}"}, | |
| 99 | + {"appletclassloader.loadcode.verbose", "\u6253\u5F00\u5230{0}\u7684\u6D41\u4EE5\u83B7\u53D6{1}"}, | |
| 100 | + {"appletclassloader.filenotfound", "\u67E5\u627E\u65F6\u627E\u4E0D\u5230\u6587\u4EF6: {0}"}, | |
| 101 | + {"appletclassloader.fileformat", "\u52A0\u8F7D\u65F6\u51FA\u73B0\u6587\u4EF6\u683C\u5F0F\u5F02\u5E38\u9519\u8BEF: {0}"}, | |
| 102 | + {"appletclassloader.fileioexception", "\u52A0\u8F7D\u65F6\u51FA\u73B0 I/O \u5F02\u5E38\u9519\u8BEF: {0}"}, | |
| 103 | + {"appletclassloader.fileexception", "\u52A0\u8F7D\u65F6\u51FA\u73B0{0}\u5F02\u5E38\u9519\u8BEF: {1}"}, | |
| 104 | + {"appletclassloader.filedeath", "\u52A0\u8F7D\u65F6\u5DF2\u7EC8\u6B62{0}: {1}"}, | |
| 105 | + {"appletclassloader.fileerror", "\u52A0\u8F7D\u65F6\u51FA\u73B0{0}\u9519\u8BEF: {1}"}, | |
| 106 | + {"appletclassloader.findclass.verbose.openstream", "\u6253\u5F00\u5230{0}\u7684\u6D41\u4EE5\u83B7\u53D6{1}"}, | |
| 107 | + {"appletclassloader.getresource.verbose.forname", "\u540D\u79F0\u7684 AppletClassLoader.getResource: {0}"}, | |
| 108 | + {"appletclassloader.getresource.verbose.found", "\u5DF2\u627E\u5230\u4F5C\u4E3A\u7CFB\u7EDF\u8D44\u6E90\u7684\u8D44\u6E90{0}"}, | |
| 109 | + {"appletclassloader.getresourceasstream.verbose", "\u5DF2\u627E\u5230\u4F5C\u4E3A\u7CFB\u7EDF\u8D44\u6E90\u7684\u8D44\u6E90{0}"}, | |
| 110 | + {"appletpanel.runloader.err", "\u5BF9\u8C61\u6216\u4EE3\u7801\u53C2\u6570!"}, | |
| 111 | + {"appletpanel.runloader.exception", "\u53CD\u5E8F\u5217\u5316{0}\u65F6\u51FA\u73B0\u5F02\u5E38\u9519\u8BEF"}, | |
| 112 | + {"appletpanel.destroyed", "\u5DF2\u9500\u6BC1\u5C0F\u5E94\u7528\u7A0B\u5E8F\u3002"}, | |
| 113 | + {"appletpanel.loaded", "\u5DF2\u52A0\u8F7D\u5C0F\u5E94\u7528\u7A0B\u5E8F\u3002"}, | |
| 114 | + {"appletpanel.started", "\u5DF2\u542F\u52A8\u5C0F\u5E94\u7528\u7A0B\u5E8F\u3002"}, | |
| 115 | + {"appletpanel.inited", "\u5DF2\u521D\u59CB\u5316\u5C0F\u5E94\u7528\u7A0B\u5E8F\u3002"}, | |
| 116 | + {"appletpanel.stopped", "\u5DF2\u505C\u6B62\u5C0F\u5E94\u7528\u7A0B\u5E8F\u3002"}, | |
| 117 | + {"appletpanel.disposed", "\u5DF2\u5904\u7406\u5C0F\u5E94\u7528\u7A0B\u5E8F\u3002"}, | |
| 118 | + {"appletpanel.nocode", "APPLET \u6807\u8BB0\u7F3A\u5C11 CODE \u53C2\u6570\u3002"}, | |
| 119 | + {"appletpanel.notfound", "\u52A0\u8F7D: \u627E\u4E0D\u5230\u7C7B{0}\u3002"}, | |
| 120 | + {"appletpanel.nocreate", "\u52A0\u8F7D: \u65E0\u6CD5\u5B9E\u4F8B\u5316{0}\u3002"}, | |
| 121 | + {"appletpanel.noconstruct", "\u52A0\u8F7D: {0}\u4E0D\u662F\u516C\u5171\u7684, \u6216\u8005\u6CA1\u6709\u516C\u5171\u6784\u9020\u5668\u3002"}, | |
| 122 | + {"appletpanel.death", "\u5DF2\u7EC8\u6B62"}, | |
| 123 | + {"appletpanel.exception", "\u5F02\u5E38\u9519\u8BEF: {0}\u3002"}, | |
| 124 | + {"appletpanel.exception2", "\u5F02\u5E38\u9519\u8BEF: {0}: {1}\u3002"}, | |
| 125 | + {"appletpanel.error", "\u9519\u8BEF: {0}\u3002"}, | |
| 126 | + {"appletpanel.error2", "\u9519\u8BEF: {0}: {1}\u3002"}, | |
| 127 | + {"appletpanel.notloaded", "\u521D\u59CB\u5316: \u672A\u52A0\u8F7D\u5C0F\u5E94\u7528\u7A0B\u5E8F\u3002"}, | |
| 128 | + {"appletpanel.notinited", "\u542F\u52A8: \u672A\u521D\u59CB\u5316\u5C0F\u5E94\u7528\u7A0B\u5E8F\u3002"}, | |
| 129 | + {"appletpanel.notstarted", "\u505C\u6B62: \u672A\u542F\u52A8\u5C0F\u5E94\u7528\u7A0B\u5E8F\u3002"}, | |
| 130 | + {"appletpanel.notstopped", "\u9500\u6BC1: \u672A\u505C\u6B62\u5C0F\u5E94\u7528\u7A0B\u5E8F\u3002"}, | |
| 131 | + {"appletpanel.notdestroyed", "\u5904\u7406: \u672A\u9500\u6BC1\u5C0F\u5E94\u7528\u7A0B\u5E8F\u3002"}, | |
| 132 | + {"appletpanel.notdisposed", "\u52A0\u8F7D: \u672A\u5904\u7406\u5C0F\u5E94\u7528\u7A0B\u5E8F\u3002"}, | |
| 133 | + {"appletpanel.bail", "\u5DF2\u4E2D\u65AD: \u79BB\u5F00\u3002"}, | |
| 134 | + {"appletpanel.filenotfound", "\u67E5\u627E\u65F6\u627E\u4E0D\u5230\u6587\u4EF6: {0}"}, | |
| 135 | + {"appletpanel.fileformat", "\u52A0\u8F7D\u65F6\u51FA\u73B0\u6587\u4EF6\u683C\u5F0F\u5F02\u5E38\u9519\u8BEF: {0}"}, | |
| 136 | + {"appletpanel.fileioexception", "\u52A0\u8F7D\u65F6\u51FA\u73B0 I/O \u5F02\u5E38\u9519\u8BEF: {0}"}, | |
| 137 | + {"appletpanel.fileexception", "\u52A0\u8F7D\u65F6\u51FA\u73B0{0}\u5F02\u5E38\u9519\u8BEF: {1}"}, | |
| 138 | + {"appletpanel.filedeath", "\u52A0\u8F7D\u65F6\u5DF2\u7EC8\u6B62{0}: {1}"}, | |
| 139 | + {"appletpanel.fileerror", "\u52A0\u8F7D\u65F6\u51FA\u73B0{0}\u9519\u8BEF: {1}"}, | |
| 140 | + {"appletpanel.badattribute.exception", "HTML \u8BED\u6CD5\u5206\u6790: \u5BBD\u5EA6/\u9AD8\u5EA6\u5C5E\u6027\u7684\u503C\u4E0D\u6B63\u786E"}, | |
| 141 | + {"appletillegalargumentexception.objectinputstream", "AppletObjectInputStream \u9700\u8981\u975E\u7A7A\u52A0\u8F7D\u5668"}, | |
| 142 | + {"appletprops.title", "AppletViewer \u5C5E\u6027"}, | |
| 143 | + {"appletprops.label.http.server", "Http \u4EE3\u7406\u670D\u52A1\u5668:"}, | |
| 144 | + {"appletprops.label.http.proxy", "Http \u4EE3\u7406\u7AEF\u53E3:"}, | |
| 145 | + {"appletprops.label.network", "\u7F51\u7EDC\u8BBF\u95EE\u6743\u9650:"}, | |
| 146 | + {"appletprops.choice.network.item.none", "\u65E0"}, | |
| 147 | + {"appletprops.choice.network.item.applethost", "\u5C0F\u5E94\u7528\u7A0B\u5E8F\u4E3B\u673A"}, | |
| 148 | + {"appletprops.choice.network.item.unrestricted", "\u4E0D\u53D7\u9650\u5236"}, | |
| 149 | + {"appletprops.label.class", "\u7C7B\u8BBF\u95EE\u6743\u9650:"}, | |
| 150 | + {"appletprops.choice.class.item.restricted", "\u53D7\u9650\u5236"}, | |
| 151 | + {"appletprops.choice.class.item.unrestricted", "\u4E0D\u53D7\u9650\u5236"}, | |
| 152 | + {"appletprops.label.unsignedapplet", "\u5141\u8BB8\u672A\u7B7E\u540D\u5C0F\u5E94\u7528\u7A0B\u5E8F:"}, | |
| 153 | + {"appletprops.choice.unsignedapplet.no", "\u5426"}, | |
| 154 | + {"appletprops.choice.unsignedapplet.yes", "\u662F"}, | |
| 155 | + {"appletprops.button.apply", "\u5E94\u7528"}, | |
| 156 | + {"appletprops.button.cancel", "\u53D6\u6D88"}, | |
| 157 | + {"appletprops.button.reset", "\u91CD\u8BBE"}, | |
| 158 | + {"appletprops.apply.exception", "\u65E0\u6CD5\u4FDD\u5B58\u5C5E\u6027: {0}"}, | |
| 159 | + /* 4066432 */ | |
| 160 | + {"appletprops.title.invalidproxy", "\u6761\u76EE\u65E0\u6548"}, | |
| 161 | + {"appletprops.label.invalidproxy", "\u4EE3\u7406\u7AEF\u53E3\u5FC5\u987B\u662F\u4E00\u4E2A\u6B63\u6574\u6570\u503C\u3002"}, | |
| 162 | + {"appletprops.button.ok", "\u786E\u5B9A"}, | |
| 163 | + /* end 4066432 */ | |
| 164 | + {"appletprops.prop.store", "AppletViewer \u7684\u7528\u6237\u7279\u5B9A\u5C5E\u6027"}, | |
| 165 | + {"appletsecurityexception.checkcreateclassloader", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u7C7B\u52A0\u8F7D\u5668"}, | |
| 166 | + {"appletsecurityexception.checkaccess.thread", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u7EBF\u7A0B"}, | |
| 167 | + {"appletsecurityexception.checkaccess.threadgroup", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u7EBF\u7A0B\u7EC4: {0}"}, | |
| 168 | + {"appletsecurityexception.checkexit", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u9000\u51FA: {0}"}, | |
| 169 | + {"appletsecurityexception.checkexec", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u6267\u884C: {0}"}, | |
| 170 | + {"appletsecurityexception.checklink", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u94FE\u63A5: {0}"}, | |
| 171 | + {"appletsecurityexception.checkpropsaccess", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u5C5E\u6027"}, | |
| 172 | + {"appletsecurityexception.checkpropsaccess.key", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u5C5E\u6027\u8BBF\u95EE{0}"}, | |
| 173 | + {"appletsecurityexception.checkread.exception1", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: {0}, {1}"}, | |
| 174 | + {"appletsecurityexception.checkread.exception2", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: file.read: {0}"}, | |
| 175 | + {"appletsecurityexception.checkread", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: file.read: {0} == {1}"}, | |
| 176 | + {"appletsecurityexception.checkwrite.exception", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: {0}, {1}"}, | |
| 177 | + {"appletsecurityexception.checkwrite", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: file.write: {0} == {1}"}, | |
| 178 | + {"appletsecurityexception.checkread.fd", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: fd.read"}, | |
| 179 | + {"appletsecurityexception.checkwrite.fd", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: fd.write"}, | |
| 180 | + {"appletsecurityexception.checklisten", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: socket.listen: {0}"}, | |
| 181 | + {"appletsecurityexception.checkaccept", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: socket.accept: {0}:{1}"}, | |
| 182 | + {"appletsecurityexception.checkconnect.networknone", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: socket.connect: {0}->{1}"}, | |
| 183 | + {"appletsecurityexception.checkconnect.networkhost1", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u65E0\u6CD5\u8FDE\u63A5\u5230\u6E90\u81EA{1}\u7684{0}\u3002"}, | |
| 184 | + {"appletsecurityexception.checkconnect.networkhost2", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u65E0\u6CD5\u89E3\u6790\u4E3B\u673A{0}\u6216{1}\u7684 IP\u3002"}, | |
| 185 | + {"appletsecurityexception.checkconnect.networkhost3", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u65E0\u6CD5\u89E3\u6790\u4E3B\u673A{0}\u7684 IP\u3002\u8BF7\u53C2\u9605 trustProxy \u5C5E\u6027\u3002"}, | |
| 186 | + {"appletsecurityexception.checkconnect", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u8FDE\u63A5: {0}->{1}"}, | |
| 187 | + {"appletsecurityexception.checkpackageaccess", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u65E0\u6CD5\u8BBF\u95EE\u7A0B\u5E8F\u5305: {0}"}, | |
| 188 | + {"appletsecurityexception.checkpackagedefinition", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u65E0\u6CD5\u5B9A\u4E49\u7A0B\u5E8F\u5305: {0}"}, | |
| 189 | + {"appletsecurityexception.cannotsetfactory", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u65E0\u6CD5\u8BBE\u7F6E\u5DE5\u5382"}, | |
| 190 | + {"appletsecurityexception.checkmemberaccess", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u68C0\u67E5\u6210\u5458\u8BBF\u95EE\u6743\u9650"}, | |
| 191 | + {"appletsecurityexception.checkgetprintjob", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: getPrintJob"}, | |
| 192 | + {"appletsecurityexception.checksystemclipboardaccess", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: getSystemClipboard"}, | |
| 193 | + {"appletsecurityexception.checkawteventqueueaccess", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: getEventQueue"}, | |
| 194 | + {"appletsecurityexception.checksecurityaccess", "\u5B89\u5168\u5F02\u5E38\u9519\u8BEF: \u5B89\u5168\u64CD\u4F5C: {0}"}, | |
| 195 | + {"appletsecurityexception.getsecuritycontext.unknown", "\u7C7B\u52A0\u8F7D\u5668\u7C7B\u578B\u672A\u77E5\u3002\u65E0\u6CD5\u68C0\u67E5 getContext"}, | |
| 196 | + {"appletsecurityexception.checkread.unknown", "\u7C7B\u52A0\u8F7D\u5668\u7C7B\u578B\u672A\u77E5\u3002\u65E0\u6CD5\u4E3A\u68C0\u67E5\u8BFB\u53D6\u6743\u9650{0}\u800C\u8FDB\u884C\u68C0\u67E5"}, | |
| 197 | + {"appletsecurityexception.checkconnect.unknown", "\u7C7B\u52A0\u8F7D\u5668\u7C7B\u578B\u672A\u77E5\u3002\u65E0\u6CD5\u4E3A\u68C0\u67E5\u8FDE\u63A5\u800C\u8FDB\u884C\u68C0\u67E5"}, | |
| 198 | + }; | |
| 199 | + | |
| 200 | + return temp; | |
| 201 | + } | |
| 202 | +} | |
| @@ -0,0 +1,202 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1996, 2011, 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 | +package sun.applet.resources; | |
| 26 | + | |
| 27 | +import java.util.ListResourceBundle; | |
| 28 | + | |
| 29 | +public class MsgAppletViewer_zh_TW extends ListResourceBundle { | |
| 30 | + | |
| 31 | + public Object[][] getContents() { | |
| 32 | + Object[][] temp = new Object[][] { | |
| 33 | + {"textframe.button.dismiss", "\u95DC\u9589"}, | |
| 34 | + {"appletviewer.tool.title", "Applet \u6AA2\u8996\u5668: {0}"}, | |
| 35 | + {"appletviewer.menu.applet", "Applet"}, | |
| 36 | + {"appletviewer.menuitem.restart", "\u91CD\u65B0\u555F\u52D5"}, | |
| 37 | + {"appletviewer.menuitem.reload", "\u91CD\u65B0\u8F09\u5165"}, | |
| 38 | + {"appletviewer.menuitem.stop", "\u505C\u6B62"}, | |
| 39 | + {"appletviewer.menuitem.save", "\u5132\u5B58..."}, | |
| 40 | + {"appletviewer.menuitem.start", "\u555F\u52D5"}, | |
| 41 | + {"appletviewer.menuitem.clone", "\u8907\u88FD..."}, | |
| 42 | + {"appletviewer.menuitem.tag", "\u6A19\u8A18..."}, | |
| 43 | + {"appletviewer.menuitem.info", "\u8CC7\u8A0A..."}, | |
| 44 | + {"appletviewer.menuitem.edit", "\u7DE8\u8F2F"}, | |
| 45 | + {"appletviewer.menuitem.encoding", "\u5B57\u5143\u7DE8\u78BC"}, | |
| 46 | + {"appletviewer.menuitem.print", "\u5217\u5370..."}, | |
| 47 | + {"appletviewer.menuitem.props", "\u5C6C\u6027..."}, | |
| 48 | + {"appletviewer.menuitem.close", "\u95DC\u9589"}, | |
| 49 | + {"appletviewer.menuitem.quit", "\u7D50\u675F"}, | |
| 50 | + {"appletviewer.label.hello", "\u60A8\u597D..."}, | |
| 51 | + {"appletviewer.status.start", "\u6B63\u5728\u555F\u52D5 Applet..."}, | |
| 52 | + {"appletviewer.appletsave.filedialogtitle","\u5C07 Applet \u5E8F\u5217\u5316\u70BA\u6A94\u6848"}, | |
| 53 | + {"appletviewer.appletsave.err1", "\u5C07 {0} \u5E8F\u5217\u5316\u70BA {1}"}, | |
| 54 | + {"appletviewer.appletsave.err2", "\u5728 appletSave \u4E2D: {0}"}, | |
| 55 | + {"appletviewer.applettag", "\u986F\u793A\u7684\u6A19\u8A18"}, | |
| 56 | + {"appletviewer.applettag.textframe", "Applet HTML \u6A19\u8A18"}, | |
| 57 | + {"appletviewer.appletinfo.applet", "-- \u7121 Applet \u8CC7\u8A0A --"}, | |
| 58 | + {"appletviewer.appletinfo.param", "-- \u7121\u53C3\u6578\u8CC7\u8A0A --"}, | |
| 59 | + {"appletviewer.appletinfo.textframe", "Applet \u8CC7\u8A0A"}, | |
| 60 | + {"appletviewer.appletprint.fail", "\u5217\u5370\u5931\u6557\u3002"}, | |
| 61 | + {"appletviewer.appletprint.finish", "\u5B8C\u6210\u5217\u5370\u3002"}, | |
| 62 | + {"appletviewer.appletprint.cancel", "\u5217\u5370\u53D6\u6D88\u3002"}, | |
| 63 | + {"appletviewer.appletencoding", "\u5B57\u5143\u7DE8\u78BC: {0}"}, | |
| 64 | + {"appletviewer.parse.warning.requiresname", "\u8B66\u544A: <\u53C3\u6578\u540D\u7A31=... \u503C=...> \u6A19\u8A18\u9700\u8981\u540D\u7A31\u5C6C\u6027\u3002"}, | |
| 65 | + {"appletviewer.parse.warning.paramoutside", "\u8B66\u544A: <param> \u6A19\u8A18\u5728 <applet> ... </applet> \u4E4B\u5916\u3002"}, | |
| 66 | + {"appletviewer.parse.warning.applet.requirescode", "\u8B66\u544A: <applet> \u6A19\u8A18\u9700\u8981\u4EE3\u78BC\u5C6C\u6027\u3002"}, | |
| 67 | + {"appletviewer.parse.warning.applet.requiresheight", "\u8B66\u544A: <applet> \u6A19\u8A18\u9700\u8981\u9AD8\u5EA6\u5C6C\u6027\u3002"}, | |
| 68 | + {"appletviewer.parse.warning.applet.requireswidth", "\u8B66\u544A: <applet> \u6A19\u8A18\u9700\u8981\u5BEC\u5EA6\u5C6C\u6027\u3002"}, | |
| 69 | + {"appletviewer.parse.warning.object.requirescode", "\u8B66\u544A: <object> \u6A19\u8A18\u9700\u8981\u4EE3\u78BC\u5C6C\u6027\u3002"}, | |
| 70 | + {"appletviewer.parse.warning.object.requiresheight", "\u8B66\u544A: <object> \u6A19\u8A18\u9700\u8981\u9AD8\u5EA6\u5C6C\u6027\u3002"}, | |
| 71 | + {"appletviewer.parse.warning.object.requireswidth", "\u8B66\u544A: <object> \u6A19\u8A18\u9700\u8981\u5BEC\u5EA6\u5C6C\u6027\u3002"}, | |
| 72 | + {"appletviewer.parse.warning.embed.requirescode", "\u8B66\u544A: <embed> \u6A19\u8A18\u9700\u8981\u4EE3\u78BC\u5C6C\u6027\u3002"}, | |
| 73 | + {"appletviewer.parse.warning.embed.requiresheight", "\u8B66\u544A: <embed> \u6A19\u8A18\u9700\u8981\u9AD8\u5EA6\u5C6C\u6027\u3002"}, | |
| 74 | + {"appletviewer.parse.warning.embed.requireswidth", "\u8B66\u544A: <embed> \u6A19\u8A18\u9700\u8981\u5BEC\u5EA6\u5C6C\u6027\u3002"}, | |
| 75 | + {"appletviewer.parse.warning.appnotLongersupported", "\u8B66\u544A: \u4E0D\u518D\u652F\u63F4 <app> \u6A19\u8A18\uFF0C\u8ACB\u6539\u7528 <applet>:"}, | |
| 76 | + {"appletviewer.usage", "\u7528\u6CD5: appletviewer <\u9078\u9805> url(s)\n\n\u5176\u4E2D\u7684 <\u9078\u9805> \u5305\u62EC:\n -debug \u5728 Java \u9664\u932F\u7A0B\u5F0F\u4E2D\u555F\u52D5 Applet \u6AA2\u8996\u5668\n -encoding <\u7DE8\u78BC> \u6307\u5B9A HTML \u6A94\u6848\u4F7F\u7528\u7684\u5B57\u5143\u7DE8\u78BC\n -J<\u57F7\u884C\u968E\u6BB5\u65D7\u6A19> \u5C07\u5F15\u6578\u50B3\u9001\u81F3 java \u89E3\u8B6F\u5668\n\n -J \u9078\u9805\u4E0D\u662F\u6A19\u6E96\u9078\u9805\uFF0C\u82E5\u6709\u8B8A\u66F4\u4E0D\u53E6\u884C\u901A\u77E5\u3002"}, | |
| 77 | + {"appletviewer.main.err.unsupportedopt", "\u4E0D\u652F\u63F4\u7684\u9078\u9805: {0}"}, | |
| 78 | + {"appletviewer.main.err.unrecognizedarg", "\u7121\u6CD5\u8FA8\u8B58\u7684\u5F15\u6578: {0}"}, | |
| 79 | + {"appletviewer.main.err.dupoption", "\u91CD\u8907\u4F7F\u7528\u9078\u9805: {0}"}, | |
| 80 | + {"appletviewer.main.err.inputfile", "\u672A\u6307\u5B9A\u8F38\u5165\u6A94\u6848\u3002"}, | |
| 81 | + {"appletviewer.main.err.badurl", "\u932F\u8AA4\u7684 URL: {0} ( {1} )"}, | |
| 82 | + {"appletviewer.main.err.io", "\u8B80\u53D6\u6642\u767C\u751F I/O \u7570\u5E38\u72C0\u6CC1: {0}"}, | |
| 83 | + {"appletviewer.main.err.readablefile", "\u78BA\u8A8D {0} \u70BA\u6A94\u6848\u4E14\u53EF\u8B80\u53D6\u3002"}, | |
| 84 | + {"appletviewer.main.err.correcturl", "{0} \u662F\u5426\u70BA\u6B63\u78BA\u7684 URL\uFF1F"}, | |
| 85 | + {"appletviewer.main.prop.store", "AppletViewer \u7684\u4F7F\u7528\u8005\u7279\u5B9A\u5C6C\u6027"}, | |
| 86 | + {"appletviewer.main.err.prop.cantread", "\u7121\u6CD5\u8B80\u53D6\u4F7F\u7528\u8005\u5C6C\u6027\u6A94\u6848: {0}"}, | |
| 87 | + {"appletviewer.main.err.prop.cantsave", "\u7121\u6CD5\u5132\u5B58\u4F7F\u7528\u8005\u5C6C\u6027\u6A94\u6848: {0}"}, | |
| 88 | + {"appletviewer.main.warn.nosecmgr", "\u8B66\u544A: \u505C\u7528\u5B89\u5168\u529F\u80FD\u3002"}, | |
| 89 | + {"appletviewer.main.debug.cantfinddebug", "\u627E\u4E0D\u5230\u9664\u932F\u7A0B\u5F0F\uFF01"}, | |
| 90 | + {"appletviewer.main.debug.cantfindmain", "\u5728\u9664\u932F\u7A0B\u5F0F\u4E2D\u627E\u4E0D\u5230\u4E3B\u8981\u65B9\u6CD5\uFF01"}, | |
| 91 | + {"appletviewer.main.debug.exceptionindebug", "\u9664\u932F\u7A0B\u5F0F\u767C\u751F\u7570\u5E38\u72C0\u6CC1\uFF01"}, | |
| 92 | + {"appletviewer.main.debug.cantaccess", "\u7121\u6CD5\u5B58\u53D6\u9664\u932F\u7A0B\u5F0F\uFF01"}, | |
| 93 | + {"appletviewer.main.nosecmgr", "\u8B66\u544A: \u672A\u5B89\u88DD SecurityManager\uFF01"}, | |
| 94 | + {"appletviewer.main.warning", "\u8B66\u544A: \u672A\u555F\u52D5 Applet\u3002\u8ACB\u78BA\u8A8D\u8F38\u5165\u5305\u542B <applet> \u6A19\u8A18\u3002"}, | |
| 95 | + {"appletviewer.main.warn.prop.overwrite", "\u8B66\u544A: \u4F9D\u7167\u4F7F\u7528\u8005\u8981\u6C42\uFF0C\u66AB\u6642\u8986\u5BEB\u7CFB\u7D71\u5C6C\u6027: \u7D22\u5F15\u9375: {0} \u820A\u503C: {1} \u65B0\u503C: {2}"}, | |
| 96 | + {"appletviewer.main.warn.cantreadprops", "\u8B66\u544A: \u7121\u6CD5\u8B80\u53D6 AppletViewer \u5C6C\u6027\u6A94\u6848: {0} \u4F7F\u7528\u9810\u8A2D\u503C\u3002"}, | |
| 97 | + {"appletioexception.loadclass.throw.interrupted", "\u985E\u5225\u8F09\u5165\u4E2D\u65B7: {0}"}, | |
| 98 | + {"appletioexception.loadclass.throw.notloaded", "\u672A\u8F09\u5165\u985E\u5225: {0}"}, | |
| 99 | + {"appletclassloader.loadcode.verbose", "\u958B\u555F {0} \u7684\u4E32\u6D41\u4EE5\u53D6\u5F97 {1}"}, | |
| 100 | + {"appletclassloader.filenotfound", "\u5C0B\u627E {0} \u6642\u627E\u4E0D\u5230\u6A94\u6848"}, | |
| 101 | + {"appletclassloader.fileformat", "\u8F09\u5165\u6642\u767C\u751F\u6A94\u6848\u683C\u5F0F\u7570\u5E38\u72C0\u6CC1: {0}"}, | |
| 102 | + {"appletclassloader.fileioexception", "\u8F09\u5165\u6642\u767C\u751F I/O \u7570\u5E38\u72C0\u6CC1: {0}"}, | |
| 103 | + {"appletclassloader.fileexception", "\u8F09\u5165\u6642\u767C\u751F {0} \u7570\u5E38\u72C0\u6CC1: {1}"}, | |
| 104 | + {"appletclassloader.filedeath", "\u8F09\u5165\u6642\u522A\u9664 {0}: {1}"}, | |
| 105 | + {"appletclassloader.fileerror", "\u8F09\u5165\u6642\u767C\u751F {0} \u932F\u8AA4: {1}"}, | |
| 106 | + {"appletclassloader.findclass.verbose.openstream", "\u958B\u555F {0} \u7684\u4E32\u6D41\u4EE5\u53D6\u5F97 {1}"}, | |
| 107 | + {"appletclassloader.getresource.verbose.forname", "AppletClassLoader.getResource \u7684\u540D\u7A31: {0}"}, | |
| 108 | + {"appletclassloader.getresource.verbose.found", "\u627E\u5230\u8CC7\u6E90: {0} \u4F5C\u70BA\u7CFB\u7D71\u8CC7\u6E90"}, | |
| 109 | + {"appletclassloader.getresourceasstream.verbose", "\u627E\u5230\u8CC7\u6E90: {0} \u4F5C\u70BA\u7CFB\u7D71\u8CC7\u6E90"}, | |
| 110 | + {"appletpanel.runloader.err", "\u7269\u4EF6\u6216\u4EE3\u78BC\u53C3\u6578\uFF01"}, | |
| 111 | + {"appletpanel.runloader.exception", "\u9084\u539F\u5E8F\u5217\u5316 {0} \u6642\u767C\u751F\u7570\u5E38\u72C0\u6CC1"}, | |
| 112 | + {"appletpanel.destroyed", "\u5DF2\u640D\u6BC0 Applet\u3002"}, | |
| 113 | + {"appletpanel.loaded", "\u5DF2\u8F09\u5165 Applet\u3002"}, | |
| 114 | + {"appletpanel.started", "\u5DF2\u555F\u7528 Applet\u3002"}, | |
| 115 | + {"appletpanel.inited", "\u5DF2\u8D77\u59CB Applet\u3002"}, | |
| 116 | + {"appletpanel.stopped", "\u5DF2\u505C\u6B62 Applet\u3002"}, | |
| 117 | + {"appletpanel.disposed", "\u5DF2\u8655\u7F6E Applet\u3002"}, | |
| 118 | + {"appletpanel.nocode", "APPLET \u6A19\u8A18\u907A\u6F0F CODE \u53C3\u6578\u3002"}, | |
| 119 | + {"appletpanel.notfound", "\u8F09\u5165: \u627E\u4E0D\u5230\u985E\u5225 {0}\u3002"}, | |
| 120 | + {"appletpanel.nocreate", "\u8F09\u5165: \u7121\u6CD5\u5EFA\u7ACB {0}\u3002"}, | |
| 121 | + {"appletpanel.noconstruct", "\u8F09\u5165: {0} \u975E\u516C\u7528\u6216\u6C92\u6709\u516C\u7528\u5EFA\u69CB\u5B50\u3002"}, | |
| 122 | + {"appletpanel.death", "\u5DF2\u522A\u9664"}, | |
| 123 | + {"appletpanel.exception", "\u7570\u5E38\u72C0\u6CC1: {0}\u3002"}, | |
| 124 | + {"appletpanel.exception2", "\u7570\u5E38\u72C0\u6CC1: {0}: {1}\u3002"}, | |
| 125 | + {"appletpanel.error", "\u932F\u8AA4: {0}\u3002"}, | |
| 126 | + {"appletpanel.error2", "\u932F\u8AA4: {0}: {1}\u3002"}, | |
| 127 | + {"appletpanel.notloaded", "\u8D77\u59CB: \u672A\u8F09\u5165 Applet\u3002"}, | |
| 128 | + {"appletpanel.notinited", "\u555F\u52D5: \u672A\u8D77\u59CB Applet\u3002"}, | |
| 129 | + {"appletpanel.notstarted", "\u505C\u6B62: \u672A\u555F\u52D5 Applet\u3002"}, | |
| 130 | + {"appletpanel.notstopped", "\u640D\u6BC0: \u672A\u505C\u6B62 Applet\u3002"}, | |
| 131 | + {"appletpanel.notdestroyed", "\u8655\u7F6E: \u672A\u640D\u6BC0 Applet\u3002"}, | |
| 132 | + {"appletpanel.notdisposed", "\u8F09\u5165: \u672A\u8655\u7F6E Applet\u3002"}, | |
| 133 | + {"appletpanel.bail", "\u5DF2\u4E2D\u65B7: \u6B63\u5728\u7D50\u675F\u3002"}, | |
| 134 | + {"appletpanel.filenotfound", "\u5C0B\u627E {0} \u6642\u627E\u4E0D\u5230\u6A94\u6848"}, | |
| 135 | + {"appletpanel.fileformat", "\u8F09\u5165\u6642\u767C\u751F\u6A94\u6848\u683C\u5F0F\u7570\u5E38\u72C0\u6CC1: {0}"}, | |
| 136 | + {"appletpanel.fileioexception", "\u8F09\u5165\u6642\u767C\u751F I/O \u7570\u5E38\u72C0\u6CC1: {0}"}, | |
| 137 | + {"appletpanel.fileexception", "\u8F09\u5165\u6642\u767C\u751F {0} \u7570\u5E38\u72C0\u6CC1: {1}"}, | |
| 138 | + {"appletpanel.filedeath", "\u8F09\u5165\u6642\u522A\u9664 {0}: {1}"}, | |
| 139 | + {"appletpanel.fileerror", "\u8F09\u5165\u6642\u767C\u751F {0} \u932F\u8AA4: {1}"}, | |
| 140 | + {"appletpanel.badattribute.exception", "HTML \u5256\u6790: \u5BEC\u5EA6/\u9AD8\u5EA6\u5C6C\u6027\u7684\u503C\u4E0D\u6B63\u78BA"}, | |
| 141 | + {"appletillegalargumentexception.objectinputstream", "AppletObjectInputStream \u9700\u8981\u975E\u7A7A\u503C\u8F09\u5165\u5668"}, | |
| 142 | + {"appletprops.title", "AppletViewer \u5C6C\u6027"}, | |
| 143 | + {"appletprops.label.http.server", "Http \u4EE3\u7406\u4E3B\u6A5F\u4F3A\u670D\u5668:"}, | |
| 144 | + {"appletprops.label.http.proxy", "Http \u4EE3\u7406\u4E3B\u6A5F\u9023\u63A5\u57E0:"}, | |
| 145 | + {"appletprops.label.network", "\u7DB2\u8DEF\u5B58\u53D6:"}, | |
| 146 | + {"appletprops.choice.network.item.none", "\u7121"}, | |
| 147 | + {"appletprops.choice.network.item.applethost", "Applet \u4E3B\u6A5F"}, | |
| 148 | + {"appletprops.choice.network.item.unrestricted", "\u4E0D\u53D7\u9650\u5236"}, | |
| 149 | + {"appletprops.label.class", "\u985E\u5225\u5B58\u53D6:"}, | |
| 150 | + {"appletprops.choice.class.item.restricted", "\u53D7\u9650\u5236"}, | |
| 151 | + {"appletprops.choice.class.item.unrestricted", "\u4E0D\u53D7\u9650\u5236"}, | |
| 152 | + {"appletprops.label.unsignedapplet", "\u5141\u8A31\u672A\u7C3D\u7F72\u7684 Applet:"}, | |
| 153 | + {"appletprops.choice.unsignedapplet.no", "\u5426"}, | |
| 154 | + {"appletprops.choice.unsignedapplet.yes", "\u662F"}, | |
| 155 | + {"appletprops.button.apply", "\u5957\u7528"}, | |
| 156 | + {"appletprops.button.cancel", "\u53D6\u6D88"}, | |
| 157 | + {"appletprops.button.reset", "\u91CD\u8A2D"}, | |
| 158 | + {"appletprops.apply.exception", "\u7121\u6CD5\u5132\u5B58\u5C6C\u6027: {0}"}, | |
| 159 | + /* 4066432 */ | |
| 160 | + {"appletprops.title.invalidproxy", "\u7121\u6548\u7684\u9805\u76EE"}, | |
| 161 | + {"appletprops.label.invalidproxy", "\u4EE3\u7406\u4E3B\u6A5F\u9023\u63A5\u57E0\u5FC5\u9808\u662F\u6B63\u6574\u6578\u503C\u3002"}, | |
| 162 | + {"appletprops.button.ok", "\u78BA\u5B9A"}, | |
| 163 | + /* end 4066432 */ | |
| 164 | + {"appletprops.prop.store", "AppletViewer \u7684\u4F7F\u7528\u8005\u7279\u5B9A\u5C6C\u6027"}, | |
| 165 | + {"appletsecurityexception.checkcreateclassloader", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: classloader"}, | |
| 166 | + {"appletsecurityexception.checkaccess.thread", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: thread"}, | |
| 167 | + {"appletsecurityexception.checkaccess.threadgroup", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: threadgroup: {0}"}, | |
| 168 | + {"appletsecurityexception.checkexit", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: exit: {0}"}, | |
| 169 | + {"appletsecurityexception.checkexec", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: exec: {0}"}, | |
| 170 | + {"appletsecurityexception.checklink", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: link: {0}"}, | |
| 171 | + {"appletsecurityexception.checkpropsaccess", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: \u5C6C\u6027"}, | |
| 172 | + {"appletsecurityexception.checkpropsaccess.key", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: \u5C6C\u6027\u5B58\u53D6 {0}"}, | |
| 173 | + {"appletsecurityexception.checkread.exception1", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: {0}\uFF0C{1}"}, | |
| 174 | + {"appletsecurityexception.checkread.exception2", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: file.read: {0}"}, | |
| 175 | + {"appletsecurityexception.checkread", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: file.read: {0} == {1}"}, | |
| 176 | + {"appletsecurityexception.checkwrite.exception", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: {0}\uFF0C{1}"}, | |
| 177 | + {"appletsecurityexception.checkwrite", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: file.write: {0} == {1}"}, | |
| 178 | + {"appletsecurityexception.checkread.fd", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: fd.read"}, | |
| 179 | + {"appletsecurityexception.checkwrite.fd", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: fd.write"}, | |
| 180 | + {"appletsecurityexception.checklisten", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: socket.listen: {0}"}, | |
| 181 | + {"appletsecurityexception.checkaccept", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: socket.accept: {0}:{1}"}, | |
| 182 | + {"appletsecurityexception.checkconnect.networknone", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: socket.connect: {0}->{1}"}, | |
| 183 | + {"appletsecurityexception.checkconnect.networkhost1", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: \u7121\u6CD5\u5F9E\u4F86\u6E90 {1} \u9023\u7DDA\u81F3 {0}\u3002"}, | |
| 184 | + {"appletsecurityexception.checkconnect.networkhost2", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: \u7121\u6CD5\u89E3\u6790\u4E3B\u6A5F {0} \u6216 {1} \u7684 IP\u3002"}, | |
| 185 | + {"appletsecurityexception.checkconnect.networkhost3", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: \u7121\u6CD5\u89E3\u6790\u4E3B\u6A5F {0} \u7684 IP\u3002\u8ACB\u53C3\u95B1 trustProxy \u5C6C\u6027\u3002"}, | |
| 186 | + {"appletsecurityexception.checkconnect", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: connect: {0}->{1}"}, | |
| 187 | + {"appletsecurityexception.checkpackageaccess", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: \u7121\u6CD5\u5B58\u53D6\u5957\u88DD\u7A0B\u5F0F: {0}"}, | |
| 188 | + {"appletsecurityexception.checkpackagedefinition", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: \u7121\u6CD5\u5B9A\u7FA9\u5957\u88DD\u7A0B\u5F0F: {0}"}, | |
| 189 | + {"appletsecurityexception.cannotsetfactory", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: \u7121\u6CD5\u8A2D\u5B9A\u8655\u7406\u7AD9"}, | |
| 190 | + {"appletsecurityexception.checkmemberaccess", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: \u6AA2\u67E5\u6210\u54E1\u5B58\u53D6"}, | |
| 191 | + {"appletsecurityexception.checkgetprintjob", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: getPrintJob"}, | |
| 192 | + {"appletsecurityexception.checksystemclipboardaccess", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: getSystemClipboard"}, | |
| 193 | + {"appletsecurityexception.checkawteventqueueaccess", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: getEventQueue"}, | |
| 194 | + {"appletsecurityexception.checksecurityaccess", "\u5B89\u5168\u7570\u5E38\u72C0\u6CC1: \u5B89\u5168\u4F5C\u696D: {0}"}, | |
| 195 | + {"appletsecurityexception.getsecuritycontext.unknown", "\u4E0D\u660E\u7684\u985E\u5225\u8F09\u5165\u5668\u985E\u578B\u3002\u7121\u6CD5\u6AA2\u67E5 getContext"}, | |
| 196 | + {"appletsecurityexception.checkread.unknown", "\u4E0D\u660E\u7684\u985E\u5225\u8F09\u5165\u5668\u985E\u578B\u3002\u7121\u6CD5\u6AA2\u67E5 read {0}"}, | |
| 197 | + {"appletsecurityexception.checkconnect.unknown", "\u4E0D\u660E\u7684\u985E\u5225\u8F09\u5165\u5668\u985E\u578B\u3002\u7121\u6CD5\u6AA2\u67E5\u9023\u7DDA"}, | |
| 198 | + }; | |
| 199 | + | |
| 200 | + return temp; | |
| 201 | + } | |
| 202 | +} | |
| @@ -0,0 +1,18 @@ | ||
| 1 | +<../../../../../mkconfig | |
| 2 | + | |
| 3 | +TARG=\ | |
| 4 | + MsgAppletViewer.dis\ | |
| 5 | + MsgAppletViewer_de.dis\ | |
| 6 | + MsgAppletViewer_es.dis\ | |
| 7 | + MsgAppletViewer_fr.dis\ | |
| 8 | + MsgAppletViewer_it.dis\ | |
| 9 | + MsgAppletViewer_ja.dis\ | |
| 10 | + MsgAppletViewer_ko.dis\ | |
| 11 | + MsgAppletViewer_pt_BR.dis\ | |
| 12 | + MsgAppletViewer_sv.dis\ | |
| 13 | + MsgAppletViewer_zh_CN.dis\ | |
| 14 | + MsgAppletViewer_zh_TW.dis\ | |
| 15 | + | |
| 16 | +DISBIN=$ROOT/java/dis/java/java/sun/applet/resources | |
| 17 | + | |
| 18 | +<$ROOT/mkfiles/mkjava | |
| @@ -0,0 +1,98 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1999, 2002, 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 | +package sun.audio; | |
| 27 | + | |
| 28 | +import java.io.*; | |
| 29 | +import javax.sound.sampled.*; | |
| 30 | + | |
| 31 | + | |
| 32 | +/** | |
| 33 | + * A clip of audio data. This data can be used to construct an | |
| 34 | + * AudioDataStream, which can be played. <p> | |
| 35 | + * | |
| 36 | + * @author Arthur van Hoff | |
| 37 | + * @author Kara Kytle | |
| 38 | + * @see AudioDataStream | |
| 39 | + * @see AudioPlayer | |
| 40 | + */ | |
| 41 | + | |
| 42 | + /* | |
| 43 | + * the idea here is that the AudioData object encapsulates the | |
| 44 | + * data you need to play an audio clip based on a defined set | |
| 45 | + * of data. to do this, you require the audio data (a byte | |
| 46 | + * array rather than an arbitrary input stream) and a format | |
| 47 | + * object. | |
| 48 | + */ | |
| 49 | + | |
| 50 | + | |
| 51 | +public class AudioData { | |
| 52 | + | |
| 53 | + private static final AudioFormat DEFAULT_FORMAT = | |
| 54 | + new AudioFormat(AudioFormat.Encoding.ULAW, | |
| 55 | + 8000, // sample rate | |
| 56 | + 8, // sample size in bits | |
| 57 | + 1, // channels | |
| 58 | + 1, // frame size in bytes | |
| 59 | + 8000, // frame rate | |
| 60 | + true ); // bigendian (irrelevant for 8-bit data) | |
| 61 | + | |
| 62 | + AudioFormat format; // carry forth the format array amusement | |
| 63 | + byte buffer[]; | |
| 64 | + | |
| 65 | + /** | |
| 66 | + * Constructor | |
| 67 | + */ | |
| 68 | + public AudioData(byte buffer[]) { | |
| 69 | + | |
| 70 | + this.buffer = buffer; | |
| 71 | + // if we cannot extract valid format information, we resort to assuming the data will be 8k mono u-law | |
| 72 | + // in order to provide maximal backwards compatibility.... | |
| 73 | + this.format = DEFAULT_FORMAT; | |
| 74 | + | |
| 75 | + // okay, we need to extract the format and the byte buffer of data | |
| 76 | + try { | |
| 77 | + AudioInputStream ais = AudioSystem.getAudioInputStream(new ByteArrayInputStream(buffer)); | |
| 78 | + this.format = ais.getFormat(); | |
| 79 | + ais.close(); | |
| 80 | + // $$fb 2002-10-27: buffer contains the file header now! | |
| 81 | + } catch (IOException e) { | |
| 82 | + // use default format | |
| 83 | + } catch (UnsupportedAudioFileException e1 ) { | |
| 84 | + // use default format | |
| 85 | + } | |
| 86 | + } | |
| 87 | + | |
| 88 | + | |
| 89 | + /** | |
| 90 | + * Non-public constructor; this is the one we use in ADS and CADS | |
| 91 | + * constructors. | |
| 92 | + */ | |
| 93 | + AudioData(AudioFormat format, byte[] buffer) { | |
| 94 | + | |
| 95 | + this.format = format; | |
| 96 | + this.buffer = buffer; | |
| 97 | + } | |
| 98 | +} | |
| @@ -0,0 +1,56 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1999, 2002, 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 | +package sun.audio; | |
| 27 | + | |
| 28 | +import java.io.*; | |
| 29 | +import javax.sound.sampled.*; | |
| 30 | +import javax.sound.midi.*; | |
| 31 | + | |
| 32 | +/** | |
| 33 | + * An input stream to play AudioData. | |
| 34 | + * | |
| 35 | + * @see AudioPlayer | |
| 36 | + * @see AudioData | |
| 37 | + * @author Arthur van Hoff | |
| 38 | + * @author Kara Kytle | |
| 39 | + */ | |
| 40 | +public class AudioDataStream extends ByteArrayInputStream { | |
| 41 | + | |
| 42 | + AudioData ad; | |
| 43 | + | |
| 44 | + /** | |
| 45 | + * Constructor | |
| 46 | + */ | |
| 47 | + public AudioDataStream(AudioData data) { | |
| 48 | + | |
| 49 | + super(data.buffer); | |
| 50 | + this.ad = data; | |
| 51 | + } | |
| 52 | + | |
| 53 | + AudioData getAudioData() { | |
| 54 | + return ad; | |
| 55 | + } | |
| 56 | +} | |
| @@ -0,0 +1,429 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1999, 2003, 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 | +package sun.audio; | |
| 27 | + | |
| 28 | +import java.util.Hashtable; | |
| 29 | +import java.util.Vector; | |
| 30 | +import java.util.Enumeration; | |
| 31 | +import java.io.IOException; | |
| 32 | +import java.io.InputStream; | |
| 33 | +import java.io.BufferedInputStream; | |
| 34 | +import java.io.OutputStream; | |
| 35 | +import java.io.ByteArrayInputStream; | |
| 36 | + | |
| 37 | +import javax.sound.sampled.*; | |
| 38 | +import javax.sound.midi.*; | |
| 39 | +import com.sun.media.sound.DataPusher; | |
| 40 | +import com.sun.media.sound.Toolkit; | |
| 41 | + | |
| 42 | +/** | |
| 43 | + * This class provides an interface to the Headspace Audio engine through | |
| 44 | + * the Java Sound API. | |
| 45 | + * | |
| 46 | + * This class emulates systems with multiple audio channels, mixing | |
| 47 | + * multiple streams for the workstation's single-channel device. | |
| 48 | + * | |
| 49 | + * @see AudioData | |
| 50 | + * @see AudioDataStream | |
| 51 | + * @see AudioStream | |
| 52 | + * @see AudioStreamSequence | |
| 53 | + * @see ContinuousAudioDataStream | |
| 54 | + * @author David Rivas | |
| 55 | + * @author Kara Kytle | |
| 56 | + * @author Jan Borgersen | |
| 57 | + * @author Florian Bomers | |
| 58 | + */ | |
| 59 | + | |
| 60 | +public class | |
| 61 | + AudioDevice { | |
| 62 | + | |
| 63 | + private boolean DEBUG = false /*true*/ ; | |
| 64 | + | |
| 65 | + /** Hashtable of audio clips / input streams. */ | |
| 66 | + private Hashtable clipStreams; | |
| 67 | + | |
| 68 | + private Vector infos; | |
| 69 | + | |
| 70 | + /** Are we currently playing audio? */ | |
| 71 | + private boolean playing = false; | |
| 72 | + | |
| 73 | + /** Handle to the JS audio mixer. */ | |
| 74 | + private Mixer mixer = null; | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + /** | |
| 79 | + * The default audio player. This audio player is initialized | |
| 80 | + * automatically. | |
| 81 | + */ | |
| 82 | + public static final AudioDevice device = new AudioDevice(); | |
| 83 | + | |
| 84 | + /** | |
| 85 | + * Create an AudioDevice instance. | |
| 86 | + */ | |
| 87 | + private AudioDevice() { | |
| 88 | + | |
| 89 | + clipStreams = new Hashtable(); | |
| 90 | + infos = new Vector(); | |
| 91 | + } | |
| 92 | + | |
| 93 | + | |
| 94 | + private synchronized void startSampled( AudioInputStream as, | |
| 95 | + InputStream in ) throws UnsupportedAudioFileException, | |
| 96 | + LineUnavailableException { | |
| 97 | + | |
| 98 | + Info info = null; | |
| 99 | + DataPusher datapusher = null; | |
| 100 | + DataLine.Info lineinfo = null; | |
| 101 | + SourceDataLine sourcedataline = null; | |
| 102 | + | |
| 103 | + // if ALAW or ULAW, we must convert.... | |
| 104 | + as = Toolkit.getPCMConvertedAudioInputStream(as); | |
| 105 | + | |
| 106 | + if( as==null ) { | |
| 107 | + // could not convert | |
| 108 | + return; | |
| 109 | + } | |
| 110 | + | |
| 111 | + lineinfo = new DataLine.Info(SourceDataLine.class, | |
| 112 | + as.getFormat()); | |
| 113 | + if( !(AudioSystem.isLineSupported(lineinfo))) { | |
| 114 | + return; | |
| 115 | + } | |
| 116 | + sourcedataline = (SourceDataLine)AudioSystem.getLine(lineinfo); | |
| 117 | + datapusher = new DataPusher(sourcedataline, as); | |
| 118 | + | |
| 119 | + info = new Info( null, in, datapusher ); | |
| 120 | + infos.addElement( info ); | |
| 121 | + | |
| 122 | + datapusher.start(); | |
| 123 | + } | |
| 124 | + | |
| 125 | + private synchronized void startMidi( InputStream bis, | |
| 126 | + InputStream in ) throws InvalidMidiDataException, | |
| 127 | + MidiUnavailableException { | |
| 128 | + | |
| 129 | + Sequencer sequencer = null; | |
| 130 | + Info info = null; | |
| 131 | + | |
| 132 | + sequencer = MidiSystem.getSequencer( ); | |
| 133 | + sequencer.open(); | |
| 134 | + try { | |
| 135 | + sequencer.setSequence( bis ); | |
| 136 | + } catch( IOException e ) { | |
| 137 | + throw new InvalidMidiDataException( e.getMessage() ); | |
| 138 | + } | |
| 139 | + | |
| 140 | + info = new Info( sequencer, in, null ); | |
| 141 | + | |
| 142 | + infos.addElement( info ); | |
| 143 | + | |
| 144 | + // fix for bug 4302884: Audio device is not released when AudioClip stops | |
| 145 | + sequencer.addMetaEventListener(info); | |
| 146 | + | |
| 147 | + sequencer.start(); | |
| 148 | + | |
| 149 | + } | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + /** | |
| 154 | + * Open an audio channel. | |
| 155 | + */ | |
| 156 | + public synchronized void openChannel(InputStream in) { | |
| 157 | + | |
| 158 | + | |
| 159 | + if(DEBUG) { | |
| 160 | + System.out.println("AudioDevice: openChannel"); | |
| 161 | + System.out.println("input stream =" + in); | |
| 162 | + } | |
| 163 | + | |
| 164 | + Info info = null; | |
| 165 | + | |
| 166 | + // is this already playing? if so, then just return | |
| 167 | + for(int i=0; i<infos.size(); i++) { | |
| 168 | + info = (AudioDevice.Info)infos.elementAt(i); | |
| 169 | + if( info.in == in ) { | |
| 170 | + | |
| 171 | + return; | |
| 172 | + } | |
| 173 | + } | |
| 174 | + | |
| 175 | + | |
| 176 | + AudioInputStream as = null; | |
| 177 | + | |
| 178 | + if( in instanceof AudioStream ) { | |
| 179 | + | |
| 180 | + if ( ((AudioStream)in).midiformat != null ) { | |
| 181 | + | |
| 182 | + // it's a midi file | |
| 183 | + try { | |
| 184 | + startMidi( ((AudioStream)in).stream, in ); | |
| 185 | + } catch (Exception e) { | |
| 186 | + return; | |
| 187 | + } | |
| 188 | + | |
| 189 | + | |
| 190 | + } else if( ((AudioStream)in).ais != null ) { | |
| 191 | + | |
| 192 | + // it's sampled audio | |
| 193 | + try { | |
| 194 | + startSampled( ((AudioStream)in).ais, in ); | |
| 195 | + } catch (Exception e) { | |
| 196 | + return; | |
| 197 | + } | |
| 198 | + | |
| 199 | + } | |
| 200 | + } else if (in instanceof AudioDataStream ) { | |
| 201 | + if (in instanceof ContinuousAudioDataStream) { | |
| 202 | + try { | |
| 203 | + AudioInputStream ais = new AudioInputStream(in, | |
| 204 | + ((AudioDataStream)in).getAudioData().format, | |
| 205 | + AudioSystem.NOT_SPECIFIED); | |
| 206 | + startSampled(ais, in ); | |
| 207 | + } catch (Exception e) { | |
| 208 | + return; | |
| 209 | + } | |
| 210 | + } | |
| 211 | + else { | |
| 212 | + try { | |
| 213 | + AudioInputStream ais = new AudioInputStream(in, | |
| 214 | + ((AudioDataStream)in).getAudioData().format, | |
| 215 | + ((AudioDataStream)in).getAudioData().buffer.length); | |
| 216 | + startSampled(ais, in ); | |
| 217 | + } catch (Exception e) { | |
| 218 | + return; | |
| 219 | + } | |
| 220 | + } | |
| 221 | + } else { | |
| 222 | + BufferedInputStream bis = new BufferedInputStream( in, 1024 ); | |
| 223 | + | |
| 224 | + try { | |
| 225 | + | |
| 226 | + try { | |
| 227 | + as = AudioSystem.getAudioInputStream(bis); | |
| 228 | + } catch(IOException ioe) { | |
| 229 | + return; | |
| 230 | + } | |
| 231 | + | |
| 232 | + startSampled( as, in ); | |
| 233 | + | |
| 234 | + } catch( UnsupportedAudioFileException e ) { | |
| 235 | + | |
| 236 | + try { | |
| 237 | + try { | |
| 238 | + MidiFileFormat mff = | |
| 239 | + MidiSystem.getMidiFileFormat( bis ); | |
| 240 | + } catch(IOException ioe1) { | |
| 241 | + return; | |
| 242 | + } | |
| 243 | + | |
| 244 | + startMidi( bis, in ); | |
| 245 | + | |
| 246 | + | |
| 247 | + } catch( InvalidMidiDataException e1 ) { | |
| 248 | + | |
| 249 | + // $$jb:08.01.99: adding this section to make some of our other | |
| 250 | + // legacy classes work..... | |
| 251 | + // not MIDI either, special case handling for all others | |
| 252 | + | |
| 253 | + AudioFormat defformat = new AudioFormat( AudioFormat.Encoding.ULAW, | |
| 254 | + 8000, 8, 1, 1, 8000, true ); | |
| 255 | + try { | |
| 256 | + AudioInputStream defaif = new AudioInputStream( bis, | |
| 257 | + defformat, AudioSystem.NOT_SPECIFIED); | |
| 258 | + startSampled( defaif, in ); | |
| 259 | + } catch (UnsupportedAudioFileException es) { | |
| 260 | + return; | |
| 261 | + } catch (LineUnavailableException es2) { | |
| 262 | + return; | |
| 263 | + } | |
| 264 | + | |
| 265 | + } catch( MidiUnavailableException e2 ) { | |
| 266 | + | |
| 267 | + // could not open sequence | |
| 268 | + return; | |
| 269 | + } | |
| 270 | + | |
| 271 | + } catch( LineUnavailableException e ) { | |
| 272 | + | |
| 273 | + return; | |
| 274 | + } | |
| 275 | + } | |
| 276 | + | |
| 277 | + // don't forget adjust for a new stream. | |
| 278 | + notify(); | |
| 279 | + } | |
| 280 | + | |
| 281 | + | |
| 282 | + /** | |
| 283 | + * Close an audio channel. | |
| 284 | + */ | |
| 285 | + public synchronized void closeChannel(InputStream in) { | |
| 286 | + | |
| 287 | + if(DEBUG) { | |
| 288 | + System.out.println("AudioDevice.closeChannel"); | |
| 289 | + } | |
| 290 | + | |
| 291 | + if (in == null) return; // can't go anywhere here! | |
| 292 | + | |
| 293 | + Info info; | |
| 294 | + | |
| 295 | + for(int i=0; i<infos.size(); i++) { | |
| 296 | + | |
| 297 | + info = (AudioDevice.Info)infos.elementAt(i); | |
| 298 | + | |
| 299 | + if( info.in == in ) { | |
| 300 | + | |
| 301 | + if( info.sequencer != null ) { | |
| 302 | + | |
| 303 | + info.sequencer.stop(); | |
| 304 | + //info.sequencer.close(); | |
| 305 | + infos.removeElement( info ); | |
| 306 | + | |
| 307 | + } else if( info.datapusher != null ) { | |
| 308 | + | |
| 309 | + info.datapusher.stop(); | |
| 310 | + infos.removeElement( info ); | |
| 311 | + } | |
| 312 | + } | |
| 313 | + } | |
| 314 | + notify(); | |
| 315 | + } | |
| 316 | + | |
| 317 | + | |
| 318 | + /** | |
| 319 | + * Open the device (done automatically) | |
| 320 | + */ | |
| 321 | + public synchronized void open() { | |
| 322 | + | |
| 323 | + // $$jb: 06.24.99: This is done on a per-stream | |
| 324 | + // basis using the new JS API now. | |
| 325 | + } | |
| 326 | + | |
| 327 | + | |
| 328 | + /** | |
| 329 | + * Close the device (done automatically) | |
| 330 | + */ | |
| 331 | + public synchronized void close() { | |
| 332 | + | |
| 333 | + // $$jb: 06.24.99: This is done on a per-stream | |
| 334 | + // basis using the new JS API now. | |
| 335 | + | |
| 336 | + } | |
| 337 | + | |
| 338 | + | |
| 339 | + /** | |
| 340 | + * Play open audio stream(s) | |
| 341 | + */ | |
| 342 | + public void play() { | |
| 343 | + | |
| 344 | + // $$jb: 06.24.99: Holdover from old architechture ... | |
| 345 | + // we now open/close the devices as needed on a per-stream | |
| 346 | + // basis using the JavaSound API. | |
| 347 | + | |
| 348 | + if (DEBUG) { | |
| 349 | + System.out.println("exiting play()"); | |
| 350 | + } | |
| 351 | + } | |
| 352 | + | |
| 353 | + /** | |
| 354 | + * Close streams | |
| 355 | + */ | |
| 356 | + public synchronized void closeStreams() { | |
| 357 | + | |
| 358 | + Info info; | |
| 359 | + | |
| 360 | + for(int i=0; i<infos.size(); i++) { | |
| 361 | + | |
| 362 | + info = (AudioDevice.Info)infos.elementAt(i); | |
| 363 | + | |
| 364 | + if( info.sequencer != null ) { | |
| 365 | + | |
| 366 | + info.sequencer.stop(); | |
| 367 | + info.sequencer.close(); | |
| 368 | + infos.removeElement( info ); | |
| 369 | + | |
| 370 | + } else if( info.datapusher != null ) { | |
| 371 | + | |
| 372 | + info.datapusher.stop(); | |
| 373 | + infos.removeElement( info ); | |
| 374 | + } | |
| 375 | + } | |
| 376 | + | |
| 377 | + | |
| 378 | + if (DEBUG) { | |
| 379 | + System.err.println("Audio Device: Streams all closed."); | |
| 380 | + } | |
| 381 | + // Empty the hash table. | |
| 382 | + clipStreams = new Hashtable(); | |
| 383 | + infos = new Vector(); | |
| 384 | + } | |
| 385 | + | |
| 386 | + /** | |
| 387 | + * Number of channels currently open. | |
| 388 | + */ | |
| 389 | + public int openChannels() { | |
| 390 | + return infos.size(); | |
| 391 | + } | |
| 392 | + | |
| 393 | + /** | |
| 394 | + * Make the debug info print out. | |
| 395 | + */ | |
| 396 | + void setVerbose(boolean v) { | |
| 397 | + DEBUG = v; | |
| 398 | + } | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + // INFO CLASS | |
| 406 | + | |
| 407 | + class Info implements MetaEventListener { | |
| 408 | + | |
| 409 | + Sequencer sequencer; | |
| 410 | + InputStream in; | |
| 411 | + DataPusher datapusher; | |
| 412 | + | |
| 413 | + Info( Sequencer sequencer, InputStream in, DataPusher datapusher ) { | |
| 414 | + | |
| 415 | + this.sequencer = sequencer; | |
| 416 | + this.in = in; | |
| 417 | + this.datapusher = datapusher; | |
| 418 | + } | |
| 419 | + | |
| 420 | + public void meta(MetaMessage event) { | |
| 421 | + if (event.getType() == 47 && sequencer != null) { | |
| 422 | + sequencer.close(); | |
| 423 | + } | |
| 424 | + } | |
| 425 | + } | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | +} | |
| @@ -0,0 +1,195 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1999, 2003, 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 | +package sun.audio; | |
| 27 | + | |
| 28 | +import java.util.Vector; | |
| 29 | +import java.util.Enumeration; | |
| 30 | +import java.io.IOException; | |
| 31 | +import java.io.InputStream; | |
| 32 | +import java.io.OutputStream; | |
| 33 | +import java.io.FileOutputStream; | |
| 34 | + | |
| 35 | +import java.security.AccessController; | |
| 36 | +import java.security.PrivilegedAction; | |
| 37 | + | |
| 38 | + | |
| 39 | +/** | |
| 40 | + * This class provides an interface to play audio streams. | |
| 41 | + * | |
| 42 | + * To play an audio stream use: | |
| 43 | + * <pre> | |
| 44 | + * AudioPlayer.player.start(audiostream); | |
| 45 | + * </pre> | |
| 46 | + * To stop playing an audio stream use: | |
| 47 | + * <pre> | |
| 48 | + * AudioPlayer.player.stop(audiostream); | |
| 49 | + * </pre> | |
| 50 | + * To play an audio stream from a URL use: | |
| 51 | + * <pre> | |
| 52 | + * AudioStream audiostream = new AudioStream(url.openStream()); | |
| 53 | + * AudioPlayer.player.start(audiostream); | |
| 54 | + * </pre> | |
| 55 | + * To play a continuous sound you first have to | |
| 56 | + * create an AudioData instance and use it to construct a | |
| 57 | + * ContinuousAudioDataStream. | |
| 58 | + * For example: | |
| 59 | + * <pre> | |
| 60 | + * AudioData data = new AudioStream(url.openStream()).getData(); | |
| 61 | + * ContinuousAudioDataStream audiostream = new ContinuousAudioDataStream(data); | |
| 62 | + * AudioPlayer.player.start(audiostream); | |
| 63 | + * </pre> | |
| 64 | + * | |
| 65 | + * @see AudioData | |
| 66 | + * @see AudioDataStream | |
| 67 | + * @see AudioDevice | |
| 68 | + * @see AudioStream | |
| 69 | + * @author Arthur van Hoff, Thomas Ball | |
| 70 | + */ | |
| 71 | + | |
| 72 | +public | |
| 73 | + class AudioPlayer extends Thread { | |
| 74 | + | |
| 75 | + private AudioDevice devAudio; | |
| 76 | + private static boolean DEBUG = false /*true*/; | |
| 77 | + | |
| 78 | + /** | |
| 79 | + * The default audio player. This audio player is initialized | |
| 80 | + * automatically. | |
| 81 | + */ | |
| 82 | + public static final AudioPlayer player = getAudioPlayer(); | |
| 83 | + | |
| 84 | + private static ThreadGroup getAudioThreadGroup() { | |
| 85 | + | |
| 86 | + if(DEBUG) { System.out.println("AudioPlayer.getAudioThreadGroup()"); } | |
| 87 | + ThreadGroup g = currentThread().getThreadGroup(); | |
| 88 | + while ((g.getParent() != null) && | |
| 89 | + (g.getParent().getParent() != null)) { | |
| 90 | + g = g.getParent(); | |
| 91 | + } | |
| 92 | + return g; | |
| 93 | + } | |
| 94 | + | |
| 95 | + /** | |
| 96 | + * Create an AudioPlayer thread in a privileged block. | |
| 97 | + */ | |
| 98 | + | |
| 99 | + private static AudioPlayer getAudioPlayer() { | |
| 100 | + | |
| 101 | + if(DEBUG) { System.out.println("> AudioPlayer.getAudioPlayer()"); } | |
| 102 | + AudioPlayer audioPlayer; | |
| 103 | + PrivilegedAction action = new PrivilegedAction() { | |
| 104 | + public Object run() { | |
| 105 | + Thread t = new AudioPlayer(); | |
| 106 | + t.setPriority(MAX_PRIORITY); | |
| 107 | + t.setDaemon(true); | |
| 108 | + t.start(); | |
| 109 | + return t; | |
| 110 | + } | |
| 111 | + }; | |
| 112 | + audioPlayer = (AudioPlayer) AccessController.doPrivileged(action); | |
| 113 | + return audioPlayer; | |
| 114 | + } | |
| 115 | + | |
| 116 | + /** | |
| 117 | + * Construct an AudioPlayer. | |
| 118 | + */ | |
| 119 | + private AudioPlayer() { | |
| 120 | + | |
| 121 | + super(getAudioThreadGroup(), "Audio Player"); | |
| 122 | + if(DEBUG) { System.out.println("> AudioPlayer private constructor"); } | |
| 123 | + devAudio = AudioDevice.device; | |
| 124 | + devAudio.open(); | |
| 125 | + if(DEBUG) { System.out.println("< AudioPlayer private constructor completed"); } | |
| 126 | + } | |
| 127 | + | |
| 128 | + | |
| 129 | + /** | |
| 130 | + * Start playing a stream. The stream will continue to play | |
| 131 | + * until the stream runs out of data, or it is stopped. | |
| 132 | + * @see AudioPlayer#stop | |
| 133 | + */ | |
| 134 | + public synchronized void start(InputStream in) { | |
| 135 | + | |
| 136 | + if(DEBUG) { | |
| 137 | + System.out.println("> AudioPlayer.start"); | |
| 138 | + System.out.println(" InputStream = " + in); | |
| 139 | + } | |
| 140 | + devAudio.openChannel(in); | |
| 141 | + notify(); | |
| 142 | + if(DEBUG) { | |
| 143 | + System.out.println("< AudioPlayer.start completed"); | |
| 144 | + } | |
| 145 | + } | |
| 146 | + | |
| 147 | + /** | |
| 148 | + * Stop playing a stream. The stream will stop playing, | |
| 149 | + * nothing happens if the stream wasn't playing in the | |
| 150 | + * first place. | |
| 151 | + * @see AudioPlayer#start | |
| 152 | + */ | |
| 153 | + public synchronized void stop(InputStream in) { | |
| 154 | + | |
| 155 | + if(DEBUG) { | |
| 156 | + System.out.println("> AudioPlayer.stop"); | |
| 157 | + } | |
| 158 | + | |
| 159 | + devAudio.closeChannel(in); | |
| 160 | + if(DEBUG) { | |
| 161 | + System.out.println("< AudioPlayer.stop completed"); | |
| 162 | + } | |
| 163 | + } | |
| 164 | + | |
| 165 | + /** | |
| 166 | + * Main mixing loop. This is called automatically when the AudioPlayer | |
| 167 | + * is created. | |
| 168 | + */ | |
| 169 | + public void run() { | |
| 170 | + | |
| 171 | + // $$jb: 06.24.99: With the JS API, mixing is no longer done by AudioPlayer | |
| 172 | + // or AudioDevice ... it's done by the API itself, so this bit of legacy | |
| 173 | + // code does nothing. | |
| 174 | + // $$jb: 10.21.99: But it appears that some legacy applications | |
| 175 | + // check to see if this thread is alive or not, so we need to spin here. | |
| 176 | + | |
| 177 | + devAudio.play(); | |
| 178 | + if(DEBUG) { | |
| 179 | + System.out.println("AudioPlayer mixing loop."); | |
| 180 | + } | |
| 181 | + while(true) { | |
| 182 | + try{ | |
| 183 | + Thread.sleep(5000); | |
| 184 | + //wait(); | |
| 185 | + } catch(Exception e) { | |
| 186 | + break; | |
| 187 | + // interrupted | |
| 188 | + } | |
| 189 | + } | |
| 190 | + if(DEBUG) { | |
| 191 | + System.out.println("AudioPlayer exited."); | |
| 192 | + } | |
| 193 | + | |
| 194 | + } | |
| 195 | + } | |
| @@ -0,0 +1,30 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1999, 2002, 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 | +package sun.audio; | |
| 27 | + | |
| 28 | +public interface AudioSecurityAction { | |
| 29 | + Object run(); | |
| 30 | +} | |
| @@ -0,0 +1,30 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1999, 2002, 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 | +package sun.audio; | |
| 27 | + | |
| 28 | +public interface AudioSecurityExceptionAction { | |
| 29 | + Object run() throws Exception; | |
| 30 | +} | |
| @@ -0,0 +1,144 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1999, 2002, 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 | +package sun.audio; | |
| 27 | + | |
| 28 | +import java.io.InputStream; | |
| 29 | +import java.io.DataInputStream; | |
| 30 | +import java.io.FilterInputStream; | |
| 31 | +import java.io.ByteArrayInputStream; | |
| 32 | +import java.io.BufferedInputStream; | |
| 33 | +import java.io.IOException; | |
| 34 | + | |
| 35 | +import javax.sound.sampled.*; | |
| 36 | +import javax.sound.midi.*; | |
| 37 | + | |
| 38 | +/** | |
| 39 | + * Convert an InputStream to an AudioStream. | |
| 40 | + * | |
| 41 | + */ | |
| 42 | + | |
| 43 | + | |
| 44 | +public class AudioStream extends FilterInputStream { | |
| 45 | + | |
| 46 | + // AudioContainerInputStream acis; | |
| 47 | + protected AudioInputStream ais = null; | |
| 48 | + protected AudioFormat format = null; | |
| 49 | + protected MidiFileFormat midiformat = null; | |
| 50 | + protected InputStream stream = null; | |
| 51 | + | |
| 52 | + | |
| 53 | + /* | |
| 54 | + * create the AudioStream; if we survive without throwing | |
| 55 | + * an exception, we should now have some subclass of | |
| 56 | + * ACIS with all the header info already read | |
| 57 | + */ | |
| 58 | + | |
| 59 | + public AudioStream(InputStream in) throws IOException { | |
| 60 | + | |
| 61 | + super(in); | |
| 62 | + | |
| 63 | + stream = in; | |
| 64 | + | |
| 65 | + if( in.markSupported() == false ) { | |
| 66 | + | |
| 67 | + stream = new BufferedInputStream( in, 1024 ); | |
| 68 | + } | |
| 69 | + | |
| 70 | + try { | |
| 71 | + ais = AudioSystem.getAudioInputStream( stream ); | |
| 72 | + format = ais.getFormat(); | |
| 73 | + this.in = ais; | |
| 74 | + | |
| 75 | + } catch (UnsupportedAudioFileException e ) { | |
| 76 | + | |
| 77 | + // not an audio file, see if it's midi... | |
| 78 | + try { | |
| 79 | + midiformat = MidiSystem.getMidiFileFormat( stream ); | |
| 80 | + | |
| 81 | + } catch (InvalidMidiDataException e1) { | |
| 82 | + throw new IOException("could not create audio stream from input stream"); | |
| 83 | + } | |
| 84 | + } | |
| 85 | + } | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + /** | |
| 91 | + * A blocking read. | |
| 92 | + */ | |
| 93 | + /* public int read(byte buf[], int pos, int len) throws IOException { | |
| 94 | + | |
| 95 | + return(acis.readFully(buf, pos, len)); | |
| 96 | + } | |
| 97 | + */ | |
| 98 | + | |
| 99 | + /** | |
| 100 | + * Get the data. | |
| 101 | + */ | |
| 102 | + public AudioData getData() throws IOException { | |
| 103 | + int length = getLength(); | |
| 104 | + | |
| 105 | + //limit the memory to 1M, so too large au file won't load | |
| 106 | + if (length < 1024*1024) { | |
| 107 | + byte [] buffer = new byte[length]; | |
| 108 | + try { | |
| 109 | + ais.read(buffer, 0, length); | |
| 110 | + } catch (IOException ex) { | |
| 111 | + throw new IOException("Could not create AudioData Object"); | |
| 112 | + } | |
| 113 | + return new AudioData(format, buffer); | |
| 114 | + } | |
| 115 | + | |
| 116 | + /* acis.setData(); | |
| 117 | + | |
| 118 | + if (acis.stream instanceof ByteArrayInputStream) { | |
| 119 | + Format[] format = acis.getFormat(); | |
| 120 | + byte[] bytes = acis.getBytes(); | |
| 121 | + if (bytes == null) | |
| 122 | + throw new IOException("could not create AudioData object: no data received"); | |
| 123 | + return new AudioData((AudioFormat)format[0], bytes); | |
| 124 | + } | |
| 125 | + */ | |
| 126 | + | |
| 127 | + throw new IOException("could not create AudioData object"); | |
| 128 | + } | |
| 129 | + | |
| 130 | + | |
| 131 | + public int getLength() { | |
| 132 | + | |
| 133 | + if( ais != null && format != null ) { | |
| 134 | + return (int) (ais.getFrameLength() * | |
| 135 | + ais.getFormat().getFrameSize() ); | |
| 136 | + | |
| 137 | + } else if ( midiformat != null ) { | |
| 138 | + return (int) midiformat.getByteLength(); | |
| 139 | + | |
| 140 | + } else { | |
| 141 | + return -1; | |
| 142 | + } | |
| 143 | + } | |
| 144 | +} | |
| @@ -0,0 +1,60 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1999, 2002, 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 | +package sun.audio; | |
| 27 | + | |
| 28 | +import java.io.IOException; | |
| 29 | +import java.io.InputStream; | |
| 30 | +import java.io.SequenceInputStream; | |
| 31 | +import java.util.Enumeration; | |
| 32 | + | |
| 33 | +/** | |
| 34 | + * Convert a sequence of input streams into a single InputStream. | |
| 35 | + * This class can be used to play two audio clips in sequence.<p> | |
| 36 | + * For example: | |
| 37 | + * <pre> | |
| 38 | + * Vector v = new Vector(); | |
| 39 | + * v.addElement(audiostream1); | |
| 40 | + * v.addElement(audiostream2); | |
| 41 | + * AudioStreamSequence audiostream = new AudioStreamSequence(v.elements()); | |
| 42 | + * AudioPlayer.player.start(audiostream); | |
| 43 | + * </pre> | |
| 44 | + * @see AudioPlayer | |
| 45 | + * @author Arthur van Hoff | |
| 46 | + */ | |
| 47 | +public | |
| 48 | + class AudioStreamSequence extends SequenceInputStream { | |
| 49 | + Enumeration e; | |
| 50 | + InputStream in; | |
| 51 | + | |
| 52 | + /** | |
| 53 | + * Create an AudioStreamSequence given an | |
| 54 | + * enumeration of streams. | |
| 55 | + */ | |
| 56 | + public AudioStreamSequence(Enumeration e) { | |
| 57 | + super(e); | |
| 58 | + } | |
| 59 | + | |
| 60 | + } | |
| @@ -0,0 +1,51 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1999, 2002, 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 | +package sun.audio; | |
| 27 | + | |
| 28 | +import java.io.InputStream; | |
| 29 | +import java.io.DataInputStream; | |
| 30 | +import java.io.FilterInputStream; | |
| 31 | +import java.io.IOException; | |
| 32 | + | |
| 33 | +/** | |
| 34 | + * Translator for native audio formats (not implemented in this release). | |
| 35 | + * | |
| 36 | + */ | |
| 37 | +public | |
| 38 | + class AudioTranslatorStream extends NativeAudioStream { | |
| 39 | + | |
| 40 | + private int length = 0; | |
| 41 | + | |
| 42 | + public AudioTranslatorStream(InputStream in) throws IOException { | |
| 43 | + super(in); | |
| 44 | + // No translators supported yet. | |
| 45 | + throw new InvalidAudioFormatException(); | |
| 46 | + } | |
| 47 | + | |
| 48 | + public int getLength() { | |
| 49 | + return length; | |
| 50 | + } | |
| 51 | + } | |
| @@ -0,0 +1,83 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1999, 2002, 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 | +package sun.audio; | |
| 27 | + | |
| 28 | +/** | |
| 29 | + * Create a continuous audio stream. This wraps a stream | |
| 30 | + * around an AudioData object, the stream is restarted | |
| 31 | + * at the beginning everytime the end is reached, thus | |
| 32 | + * creating continuous sound.<p> | |
| 33 | + * For example: | |
| 34 | + * <pre> | |
| 35 | + * AudioData data = AudioData.getAudioData(url); | |
| 36 | + * ContinuousAudioDataStream audiostream = new ContinuousAudioDataStream(data); | |
| 37 | + * AudioPlayer.player.start(audiostream); | |
| 38 | + * </pre> | |
| 39 | + * | |
| 40 | + * @see AudioPlayer | |
| 41 | + * @see AudioData | |
| 42 | + * @author Arthur van Hoff | |
| 43 | + */ | |
| 44 | + | |
| 45 | +public | |
| 46 | + class ContinuousAudioDataStream extends AudioDataStream { | |
| 47 | + | |
| 48 | + | |
| 49 | + /** | |
| 50 | + * Create a continuous stream of audio. | |
| 51 | + */ | |
| 52 | + public ContinuousAudioDataStream(AudioData data) { | |
| 53 | + | |
| 54 | + super(data); | |
| 55 | + } | |
| 56 | + | |
| 57 | + | |
| 58 | + public int read() { | |
| 59 | + | |
| 60 | + int i = super.read(); | |
| 61 | + | |
| 62 | + if (i == -1) { | |
| 63 | + reset(); | |
| 64 | + i = super.read(); | |
| 65 | + } | |
| 66 | + | |
| 67 | + return i; | |
| 68 | + } | |
| 69 | + | |
| 70 | + | |
| 71 | + public int read(byte ab[], int i1, int j) { | |
| 72 | + | |
| 73 | + int k; | |
| 74 | + | |
| 75 | + for (k = 0; k < j; ) { | |
| 76 | + int i2 = super.read(ab, i1 + k, j - k); | |
| 77 | + if (i2 >= 0) k += i2; | |
| 78 | + else reset(); | |
| 79 | + } | |
| 80 | + | |
| 81 | + return k; | |
| 82 | + } | |
| 83 | + } | |
| @@ -0,0 +1,48 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1999, 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 | +package sun.audio; | |
| 27 | +import java.io.IOException; | |
| 28 | + | |
| 29 | +/** | |
| 30 | + * Signals an invalid audio stream for the stream handler. | |
| 31 | + */ | |
| 32 | +class InvalidAudioFormatException extends IOException { | |
| 33 | + | |
| 34 | + | |
| 35 | + /** | |
| 36 | + * Constructor. | |
| 37 | + */ | |
| 38 | + public InvalidAudioFormatException() { | |
| 39 | + super(); | |
| 40 | + } | |
| 41 | + | |
| 42 | + /** | |
| 43 | + * Constructor with a detail message. | |
| 44 | + */ | |
| 45 | + public InvalidAudioFormatException(String s) { | |
| 46 | + super(s); | |
| 47 | + } | |
| 48 | +} | |
| @@ -0,0 +1,59 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1999, 2002, 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 | +package sun.audio; | |
| 27 | + | |
| 28 | +import java.io.InputStream; | |
| 29 | +import java.io.DataInputStream; | |
| 30 | +import java.io.FilterInputStream; | |
| 31 | +import java.io.IOException; | |
| 32 | + | |
| 33 | +/** | |
| 34 | + * A Sun-specific AudioStream that supports native audio formats. | |
| 35 | + * | |
| 36 | + */ | |
| 37 | + | |
| 38 | + /* | |
| 39 | + * note: this file used to do the real header reading and | |
| 40 | + * format verification for .au files (the only kind supported). | |
| 41 | + * now we are way more cool than that and don't need this | |
| 42 | + * functionality here; i'm just gutting this class and letting | |
| 43 | + * it contain an ACIS instead (so now it should work for | |
| 44 | + * all the data types we support....). | |
| 45 | + */ | |
| 46 | + | |
| 47 | +public | |
| 48 | + class NativeAudioStream extends FilterInputStream { | |
| 49 | + | |
| 50 | + | |
| 51 | + public NativeAudioStream(InputStream in) throws IOException { | |
| 52 | + | |
| 53 | + super(in); | |
| 54 | + } | |
| 55 | + | |
| 56 | + public int getLength() { | |
| 57 | + return 0; | |
| 58 | + } | |
| 59 | + } | |
| @@ -0,0 +1,19 @@ | ||
| 1 | +<../../../../mkconfig | |
| 2 | + | |
| 3 | +TARG=\ | |
| 4 | + AudioData.dis\ | |
| 5 | + AudioDataStream.dis\ | |
| 6 | + AudioDevice.dis\ | |
| 7 | + AudioPlayer.dis\ | |
| 8 | + AudioSecurityAction.dis\ | |
| 9 | + AudioSecurityExceptionAction.dis\ | |
| 10 | + AudioStream.dis\ | |
| 11 | + AudioStreamSequence.dis\ | |
| 12 | + AudioTranslatorStream.dis\ | |
| 13 | + ContinuousAudioDataStream.dis\ | |
| 14 | + InvalidAudioFormatException.dis\ | |
| 15 | + NativeAudioStream.dis\ | |
| 16 | + | |
| 17 | +DISBIN=$ROOT/java/dis/java/java/sun/audio | |
| 18 | + | |
| 19 | +<$ROOT/mkfiles/mkjava | |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1,678 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 2008, 2011, 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 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.awt.*; | |
| 29 | +import java.awt.event.InputEvent; | |
| 30 | +import java.awt.geom.Point2D; | |
| 31 | +import java.awt.image.BufferedImage; | |
| 32 | + | |
| 33 | +import sun.misc.Unsafe; | |
| 34 | +import java.awt.peer.ComponentPeer; | |
| 35 | + | |
| 36 | +import java.security.AccessController; | |
| 37 | +import java.security.AccessControlContext; | |
| 38 | + | |
| 39 | +/** | |
| 40 | + * The AWTAccessor utility class. | |
| 41 | + * The main purpose of this class is to enable accessing | |
| 42 | + * private and package-private fields of classes from | |
| 43 | + * different classes/packages. See sun.misc.SharedSecretes | |
| 44 | + * for another example. | |
| 45 | + */ | |
| 46 | +public final class AWTAccessor { | |
| 47 | + | |
| 48 | + private static final Unsafe unsafe = Unsafe.getUnsafe(); | |
| 49 | + | |
| 50 | + /* | |
| 51 | + * We don't need any objects of this class. | |
| 52 | + * It's rather a collection of static methods | |
| 53 | + * and interfaces. | |
| 54 | + */ | |
| 55 | + private AWTAccessor() { | |
| 56 | + } | |
| 57 | + | |
| 58 | + /* | |
| 59 | + * An interface of accessor for the java.awt.Component class. | |
| 60 | + */ | |
| 61 | + public interface ComponentAccessor { | |
| 62 | + /* | |
| 63 | + * Sets whether the native background erase for a component | |
| 64 | + * has been disabled via SunToolkit.disableBackgroundErase(). | |
| 65 | + */ | |
| 66 | + void setBackgroundEraseDisabled(Component comp, boolean disabled); | |
| 67 | + /* | |
| 68 | + * Indicates whether the native background erase for a | |
| 69 | + * component has been disabled via | |
| 70 | + * SunToolkit.disableBackgroundErase(). | |
| 71 | + */ | |
| 72 | + boolean getBackgroundEraseDisabled(Component comp); | |
| 73 | + /* | |
| 74 | + * | |
| 75 | + * Gets the bounds of this component in the form of a | |
| 76 | + * <code>Rectangle</code> object. The bounds specify this | |
| 77 | + * component's width, height, and location relative to | |
| 78 | + * its parent. | |
| 79 | + */ | |
| 80 | + Rectangle getBounds(Component comp); | |
| 81 | + /* | |
| 82 | + * Sets the shape of a lw component to cut out from hw components. | |
| 83 | + * | |
| 84 | + * See 6797587, 6776743, 6768307, and 6768332 for details | |
| 85 | + */ | |
| 86 | + void setMixingCutoutShape(Component comp, Shape shape); | |
| 87 | + | |
| 88 | + /** | |
| 89 | + * Sets GraphicsConfiguration value for the component. | |
| 90 | + */ | |
| 91 | + void setGraphicsConfiguration(Component comp, GraphicsConfiguration gc); | |
| 92 | + /* | |
| 93 | + * Requests focus to the component. | |
| 94 | + */ | |
| 95 | + boolean requestFocus(Component comp, CausedFocusEvent.Cause cause); | |
| 96 | + /* | |
| 97 | + * Determines if the component can gain focus. | |
| 98 | + */ | |
| 99 | + boolean canBeFocusOwner(Component comp); | |
| 100 | + | |
| 101 | + /** | |
| 102 | + * Returns whether the component is visible without invoking | |
| 103 | + * any client code. | |
| 104 | + */ | |
| 105 | + boolean isVisible(Component comp); | |
| 106 | + | |
| 107 | + /** | |
| 108 | + * Sets the RequestFocusController. | |
| 109 | + */ | |
| 110 | + void setRequestFocusController(RequestFocusController requestController); | |
| 111 | + | |
| 112 | + /** | |
| 113 | + * Returns the appContext of the component. | |
| 114 | + */ | |
| 115 | + AppContext getAppContext(Component comp); | |
| 116 | + | |
| 117 | + /** | |
| 118 | + * Sets the appContext of the component. | |
| 119 | + */ | |
| 120 | + void setAppContext(Component comp, AppContext appContext); | |
| 121 | + | |
| 122 | + /** | |
| 123 | + * Returns the parent of the component. | |
| 124 | + */ | |
| 125 | + Container getParent(Component comp); | |
| 126 | + | |
| 127 | + /** | |
| 128 | + * Sets the parent of the component to the specified parent. | |
| 129 | + */ | |
| 130 | + void setParent(Component comp, Container parent); | |
| 131 | + | |
| 132 | + /** | |
| 133 | + * Resizes the component to the specified width and height. | |
| 134 | + */ | |
| 135 | + void setSize(Component comp, int width, int height); | |
| 136 | + | |
| 137 | + /** | |
| 138 | + * Returns the location of the component. | |
| 139 | + */ | |
| 140 | + Point getLocation(Component comp); | |
| 141 | + | |
| 142 | + /** | |
| 143 | + * Moves the component to the new location. | |
| 144 | + */ | |
| 145 | + void setLocation(Component comp, int x, int y); | |
| 146 | + | |
| 147 | + /** | |
| 148 | + * Determines whether this component is enabled. | |
| 149 | + */ | |
| 150 | + boolean isEnabled(Component comp); | |
| 151 | + | |
| 152 | + /** | |
| 153 | + * Determines whether this component is displayable. | |
| 154 | + */ | |
| 155 | + boolean isDisplayable(Component comp); | |
| 156 | + | |
| 157 | + /** | |
| 158 | + * Gets the cursor set in the component. | |
| 159 | + */ | |
| 160 | + Cursor getCursor(Component comp); | |
| 161 | + | |
| 162 | + /** | |
| 163 | + * Returns the peer of the component. | |
| 164 | + */ | |
| 165 | + ComponentPeer getPeer(Component comp); | |
| 166 | + | |
| 167 | + /** | |
| 168 | + * Sets the peer of the component to the specified peer. | |
| 169 | + */ | |
| 170 | + void setPeer(Component comp, ComponentPeer peer); | |
| 171 | + | |
| 172 | + /** | |
| 173 | + * Determines whether this component is lightweight. | |
| 174 | + */ | |
| 175 | + boolean isLightweight(Component comp); | |
| 176 | + | |
| 177 | + /** | |
| 178 | + * Returns whether or not paint messages received from | |
| 179 | + * the operating system should be ignored. | |
| 180 | + */ | |
| 181 | + boolean getIgnoreRepaint(Component comp); | |
| 182 | + | |
| 183 | + /** | |
| 184 | + * Returns the width of the component. | |
| 185 | + */ | |
| 186 | + int getWidth(Component comp); | |
| 187 | + | |
| 188 | + /** | |
| 189 | + * Returns the height of the component. | |
| 190 | + */ | |
| 191 | + int getHeight(Component comp); | |
| 192 | + | |
| 193 | + /** | |
| 194 | + * Returns the x coordinate of the component. | |
| 195 | + */ | |
| 196 | + int getX(Component comp); | |
| 197 | + | |
| 198 | + /** | |
| 199 | + * Returns the y coordinate of the component. | |
| 200 | + */ | |
| 201 | + int getY(Component comp); | |
| 202 | + | |
| 203 | + /** | |
| 204 | + * Gets the foreground color of this component. | |
| 205 | + */ | |
| 206 | + Color getForeground(Component comp); | |
| 207 | + | |
| 208 | + /** | |
| 209 | + * Gets the background color of this component. | |
| 210 | + */ | |
| 211 | + Color getBackground(Component comp); | |
| 212 | + | |
| 213 | + /** | |
| 214 | + * Sets the background of this component to the specified color. | |
| 215 | + */ | |
| 216 | + void setBackground(Component comp, Color background); | |
| 217 | + | |
| 218 | + /** | |
| 219 | + * Gets the font of the component. | |
| 220 | + */ | |
| 221 | + Font getFont(Component comp); | |
| 222 | + | |
| 223 | + /** | |
| 224 | + * Processes events occurring on this component. | |
| 225 | + */ | |
| 226 | + void processEvent(Component comp, AWTEvent e); | |
| 227 | + | |
| 228 | + | |
| 229 | + /* | |
| 230 | + * Returns the acc this component was constructed with. | |
| 231 | + */ | |
| 232 | + AccessControlContext getAccessControlContext(Component comp); | |
| 233 | + | |
| 234 | + } | |
| 235 | + | |
| 236 | + /* | |
| 237 | + * An interface of accessor for the java.awt.Container class. | |
| 238 | + */ | |
| 239 | + public interface ContainerAccessor { | |
| 240 | + /** | |
| 241 | + * Validates the container unconditionally. | |
| 242 | + */ | |
| 243 | + void validateUnconditionally(Container cont); | |
| 244 | + } | |
| 245 | + | |
| 246 | + /* | |
| 247 | + * An interface of accessor for java.awt.Window class. | |
| 248 | + */ | |
| 249 | + public interface WindowAccessor { | |
| 250 | + /* | |
| 251 | + * Get opacity level of the given window. | |
| 252 | + */ | |
| 253 | + float getOpacity(Window window); | |
| 254 | + /* | |
| 255 | + * Set opacity level to the given window. | |
| 256 | + */ | |
| 257 | + void setOpacity(Window window, float opacity); | |
| 258 | + /* | |
| 259 | + * Get a shape assigned to the given window. | |
| 260 | + */ | |
| 261 | + Shape getShape(Window window); | |
| 262 | + /* | |
| 263 | + * Set a shape to the given window. | |
| 264 | + */ | |
| 265 | + void setShape(Window window, Shape shape); | |
| 266 | + /* | |
| 267 | + * Set the opaque preoperty to the given window. | |
| 268 | + */ | |
| 269 | + void setOpaque(Window window, boolean isOpaque); | |
| 270 | + /* | |
| 271 | + * Update the image of a non-opaque (translucent) window. | |
| 272 | + */ | |
| 273 | + void updateWindow(Window window); | |
| 274 | + | |
| 275 | + /** Get the size of the security warning. | |
| 276 | + */ | |
| 277 | + Dimension getSecurityWarningSize(Window w); | |
| 278 | + | |
| 279 | + /** | |
| 280 | + * Set the size of the security warning. | |
| 281 | + */ | |
| 282 | + void setSecurityWarningSize(Window w, int width, int height); | |
| 283 | + | |
| 284 | + /** Set the position of the security warning. | |
| 285 | + */ | |
| 286 | + void setSecurityWarningPosition(Window w, Point2D point, | |
| 287 | + float alignmentX, float alignmentY); | |
| 288 | + | |
| 289 | + /** Request to recalculate the new position of the security warning for | |
| 290 | + * the given window size/location as reported by the native system. | |
| 291 | + */ | |
| 292 | + Point2D calculateSecurityWarningPosition(Window window, | |
| 293 | + double x, double y, double w, double h); | |
| 294 | + | |
| 295 | + /** Sets the synchronous status of focus requests on lightweight | |
| 296 | + * components in the specified window to the specified value. | |
| 297 | + */ | |
| 298 | + void setLWRequestStatus(Window changed, boolean status); | |
| 299 | + | |
| 300 | + /** | |
| 301 | + * Indicates whether this window should receive focus on subsequently | |
| 302 | + * being shown, or being moved to the front. | |
| 303 | + */ | |
| 304 | + boolean isAutoRequestFocus(Window w); | |
| 305 | + | |
| 306 | + /** | |
| 307 | + * Indicates whether the specified window is an utility window for TrayIcon. | |
| 308 | + */ | |
| 309 | + boolean isTrayIconWindow(Window w); | |
| 310 | + | |
| 311 | + /** | |
| 312 | + * Marks the specified window as an utility window for TrayIcon. | |
| 313 | + */ | |
| 314 | + void setTrayIconWindow(Window w, boolean isTrayIconWindow); | |
| 315 | + } | |
| 316 | + | |
| 317 | + /* | |
| 318 | + * An accessor for the AWTEvent class. | |
| 319 | + */ | |
| 320 | + public interface AWTEventAccessor { | |
| 321 | + /** | |
| 322 | + * Marks the event as posted. | |
| 323 | + */ | |
| 324 | + void setPosted(AWTEvent ev); | |
| 325 | + | |
| 326 | + /** | |
| 327 | + * Sets the flag on this AWTEvent indicating that it was | |
| 328 | + * generated by the system. | |
| 329 | + */ | |
| 330 | + void setSystemGenerated(AWTEvent ev); | |
| 331 | + | |
| 332 | + /** | |
| 333 | + * Indicates whether this AWTEvent was generated by the system. | |
| 334 | + */ | |
| 335 | + boolean isSystemGenerated(AWTEvent ev); | |
| 336 | + | |
| 337 | + | |
| 338 | + /* | |
| 339 | + * Returns the acc this event was constructed with. | |
| 340 | + */ | |
| 341 | + AccessControlContext getAccessControlContext(AWTEvent ev); | |
| 342 | + | |
| 343 | + } | |
| 344 | + | |
| 345 | + public interface InputEventAccessor { | |
| 346 | + /* | |
| 347 | + * Accessor for InputEvent.getButtonDownMasks() | |
| 348 | + */ | |
| 349 | + int[] getButtonDownMasks(); | |
| 350 | + } | |
| 351 | + | |
| 352 | + /* | |
| 353 | + * An accessor for the java.awt.Frame class. | |
| 354 | + */ | |
| 355 | + public interface FrameAccessor { | |
| 356 | + /* | |
| 357 | + * Sets the state of this frame. | |
| 358 | + */ | |
| 359 | + void setExtendedState(Frame frame, int state); | |
| 360 | + /* | |
| 361 | + * Gets the state of this frame. | |
| 362 | + */ | |
| 363 | + int getExtendedState(Frame frame); | |
| 364 | + /* | |
| 365 | + * Gets the maximized bounds of this frame. | |
| 366 | + */ | |
| 367 | + Rectangle getMaximizedBounds(Frame frame); | |
| 368 | + } | |
| 369 | + | |
| 370 | + /* | |
| 371 | + * An interface of accessor for the java.awt.KeyboardFocusManager class. | |
| 372 | + */ | |
| 373 | + public interface KeyboardFocusManagerAccessor { | |
| 374 | + /* | |
| 375 | + * Indicates whether the native implementation should | |
| 376 | + * proceed with a pending focus request for the heavyweight. | |
| 377 | + */ | |
| 378 | + int shouldNativelyFocusHeavyweight(Component heavyweight, | |
| 379 | + Component descendant, | |
| 380 | + boolean temporary, | |
| 381 | + boolean focusedWindowChangeAllowed, | |
| 382 | + long time, | |
| 383 | + CausedFocusEvent.Cause cause); | |
| 384 | + /* | |
| 385 | + * Delivers focus for the lightweight descendant of the heavyweight | |
| 386 | + * synchronously. | |
| 387 | + */ | |
| 388 | + boolean processSynchronousLightweightTransfer(Component heavyweight, | |
| 389 | + Component descendant, | |
| 390 | + boolean temporary, | |
| 391 | + boolean focusedWindowChangeAllowed, | |
| 392 | + long time); | |
| 393 | + /* | |
| 394 | + * Removes the last focus request for the heavyweight from the queue. | |
| 395 | + */ | |
| 396 | + void removeLastFocusRequest(Component heavyweight); | |
| 397 | + | |
| 398 | + /* | |
| 399 | + * Sets the most recent focus owner in the window. | |
| 400 | + */ | |
| 401 | + void setMostRecentFocusOwner(Window window, Component component); | |
| 402 | + } | |
| 403 | + | |
| 404 | + /* | |
| 405 | + * An accessor for the MenuComponent class. | |
| 406 | + */ | |
| 407 | + public interface MenuComponentAccessor { | |
| 408 | + /** | |
| 409 | + * Returns the appContext of the menu component. | |
| 410 | + */ | |
| 411 | + AppContext getAppContext(MenuComponent menuComp); | |
| 412 | + | |
| 413 | + /** | |
| 414 | + * Sets the appContext of the menu component. | |
| 415 | + */ | |
| 416 | + void setAppContext(MenuComponent menuComp, AppContext appContext); | |
| 417 | + | |
| 418 | + /** | |
| 419 | + * Returns the menu container of the menu component | |
| 420 | + */ | |
| 421 | + MenuContainer getParent(MenuComponent menuComp); | |
| 422 | + } | |
| 423 | + | |
| 424 | + /* | |
| 425 | + * An accessor for the EventQueue class | |
| 426 | + */ | |
| 427 | + public interface EventQueueAccessor { | |
| 428 | + /* | |
| 429 | + * Gets the event dispatch thread. | |
| 430 | + */ | |
| 431 | + Thread getDispatchThread(EventQueue eventQueue); | |
| 432 | + /* | |
| 433 | + * Checks if the current thread is EDT for the given EQ. | |
| 434 | + */ | |
| 435 | + public boolean isDispatchThreadImpl(EventQueue eventQueue); | |
| 436 | + } | |
| 437 | + | |
| 438 | + /* | |
| 439 | + * An accessor for the PopupMenu class | |
| 440 | + */ | |
| 441 | + public interface PopupMenuAccessor { | |
| 442 | + /* | |
| 443 | + * Returns whether the popup menu is attached to a tray | |
| 444 | + */ | |
| 445 | + boolean isTrayIconPopup(PopupMenu popupMenu); | |
| 446 | + } | |
| 447 | + | |
| 448 | + /* | |
| 449 | + * An accessor for the FileDialog class | |
| 450 | + */ | |
| 451 | + public interface FileDialogAccessor { | |
| 452 | + /* | |
| 453 | + * Sets the files the user selects | |
| 454 | + */ | |
| 455 | + void setFiles(FileDialog fileDialog, String directory, String files[]); | |
| 456 | + | |
| 457 | + /* | |
| 458 | + * Sets the file the user selects | |
| 459 | + */ | |
| 460 | + void setFile(FileDialog fileDialog, String file); | |
| 461 | + | |
| 462 | + /* | |
| 463 | + * Sets the directory the user selects | |
| 464 | + */ | |
| 465 | + void setDirectory(FileDialog fileDialog, String directory); | |
| 466 | + | |
| 467 | + /* | |
| 468 | + * Returns whether the file dialog allows the multiple file selection. | |
| 469 | + */ | |
| 470 | + boolean isMultipleMode(FileDialog fileDialog); | |
| 471 | + } | |
| 472 | + | |
| 473 | + /* | |
| 474 | + * Accessor instances are initialized in the static initializers of | |
| 475 | + * corresponding AWT classes by using setters defined below. | |
| 476 | + */ | |
| 477 | + private static ComponentAccessor componentAccessor; | |
| 478 | + private static ContainerAccessor containerAccessor; | |
| 479 | + private static WindowAccessor windowAccessor; | |
| 480 | + private static AWTEventAccessor awtEventAccessor; | |
| 481 | + private static InputEventAccessor inputEventAccessor; | |
| 482 | + private static FrameAccessor frameAccessor; | |
| 483 | + private static KeyboardFocusManagerAccessor kfmAccessor; | |
| 484 | + private static MenuComponentAccessor menuComponentAccessor; | |
| 485 | + private static EventQueueAccessor eventQueueAccessor; | |
| 486 | + private static PopupMenuAccessor popupMenuAccessor; | |
| 487 | + private static FileDialogAccessor fileDialogAccessor; | |
| 488 | + | |
| 489 | + /* | |
| 490 | + * Set an accessor object for the java.awt.Component class. | |
| 491 | + */ | |
| 492 | + public static void setComponentAccessor(ComponentAccessor ca) { | |
| 493 | + componentAccessor = ca; | |
| 494 | + } | |
| 495 | + | |
| 496 | + /* | |
| 497 | + * Retrieve the accessor object for the java.awt.Component class. | |
| 498 | + */ | |
| 499 | + public static ComponentAccessor getComponentAccessor() { | |
| 500 | + if (componentAccessor == null) { | |
| 501 | + unsafe.ensureClassInitialized(Component.class); | |
| 502 | + } | |
| 503 | + | |
| 504 | + return componentAccessor; | |
| 505 | + } | |
| 506 | + | |
| 507 | + /* | |
| 508 | + * Set an accessor object for the java.awt.Container class. | |
| 509 | + */ | |
| 510 | + public static void setContainerAccessor(ContainerAccessor ca) { | |
| 511 | + containerAccessor = ca; | |
| 512 | + } | |
| 513 | + | |
| 514 | + /* | |
| 515 | + * Retrieve the accessor object for the java.awt.Container class. | |
| 516 | + */ | |
| 517 | + public static ContainerAccessor getContainerAccessor() { | |
| 518 | + if (containerAccessor == null) { | |
| 519 | + unsafe.ensureClassInitialized(Container.class); | |
| 520 | + } | |
| 521 | + | |
| 522 | + return containerAccessor; | |
| 523 | + } | |
| 524 | + | |
| 525 | + /* | |
| 526 | + * Set an accessor object for the java.awt.Window class. | |
| 527 | + */ | |
| 528 | + public static void setWindowAccessor(WindowAccessor wa) { | |
| 529 | + windowAccessor = wa; | |
| 530 | + } | |
| 531 | + | |
| 532 | + /* | |
| 533 | + * Retrieve the accessor object for the java.awt.Window class. | |
| 534 | + */ | |
| 535 | + public static WindowAccessor getWindowAccessor() { | |
| 536 | + if (windowAccessor == null) { | |
| 537 | + unsafe.ensureClassInitialized(Window.class); | |
| 538 | + } | |
| 539 | + return windowAccessor; | |
| 540 | + } | |
| 541 | + | |
| 542 | + /* | |
| 543 | + * Set an accessor object for the java.awt.AWTEvent class. | |
| 544 | + */ | |
| 545 | + public static void setAWTEventAccessor(AWTEventAccessor aea) { | |
| 546 | + awtEventAccessor = aea; | |
| 547 | + } | |
| 548 | + | |
| 549 | + /* | |
| 550 | + * Retrieve the accessor object for the java.awt.AWTEvent class. | |
| 551 | + */ | |
| 552 | + public static AWTEventAccessor getAWTEventAccessor() { | |
| 553 | + if (awtEventAccessor == null) { | |
| 554 | + unsafe.ensureClassInitialized(AWTEvent.class); | |
| 555 | + } | |
| 556 | + return awtEventAccessor; | |
| 557 | + } | |
| 558 | + | |
| 559 | + /* | |
| 560 | + * Set an accessor object for the java.awt.event.InputEvent class. | |
| 561 | + */ | |
| 562 | + public static void setInputEventAccessor(InputEventAccessor iea) { | |
| 563 | + inputEventAccessor = iea; | |
| 564 | + } | |
| 565 | + | |
| 566 | + /* | |
| 567 | + * Retrieve the accessor object for the java.awt.event.InputEvent class. | |
| 568 | + */ | |
| 569 | + public static InputEventAccessor getInputEventAccessor() { | |
| 570 | + if (inputEventAccessor == null) { | |
| 571 | + unsafe.ensureClassInitialized(InputEvent.class); | |
| 572 | + } | |
| 573 | + return inputEventAccessor; | |
| 574 | + } | |
| 575 | + | |
| 576 | + /* | |
| 577 | + * Set an accessor object for the java.awt.Frame class. | |
| 578 | + */ | |
| 579 | + public static void setFrameAccessor(FrameAccessor fa) { | |
| 580 | + frameAccessor = fa; | |
| 581 | + } | |
| 582 | + | |
| 583 | + /* | |
| 584 | + * Retrieve the accessor object for the java.awt.Frame class. | |
| 585 | + */ | |
| 586 | + public static FrameAccessor getFrameAccessor() { | |
| 587 | + if (frameAccessor == null) { | |
| 588 | + unsafe.ensureClassInitialized(Frame.class); | |
| 589 | + } | |
| 590 | + return frameAccessor; | |
| 591 | + } | |
| 592 | + | |
| 593 | + /* | |
| 594 | + * Set an accessor object for the java.awt.KeyboardFocusManager class. | |
| 595 | + */ | |
| 596 | + public static void setKeyboardFocusManagerAccessor(KeyboardFocusManagerAccessor kfma) { | |
| 597 | + kfmAccessor = kfma; | |
| 598 | + } | |
| 599 | + | |
| 600 | + /* | |
| 601 | + * Retrieve the accessor object for the java.awt.KeyboardFocusManager class. | |
| 602 | + */ | |
| 603 | + public static KeyboardFocusManagerAccessor getKeyboardFocusManagerAccessor() { | |
| 604 | + if (kfmAccessor == null) { | |
| 605 | + unsafe.ensureClassInitialized(KeyboardFocusManager.class); | |
| 606 | + } | |
| 607 | + return kfmAccessor; | |
| 608 | + } | |
| 609 | + | |
| 610 | + /* | |
| 611 | + * Set an accessor object for the java.awt.MenuComponent class. | |
| 612 | + */ | |
| 613 | + public static void setMenuComponentAccessor(MenuComponentAccessor mca) { | |
| 614 | + menuComponentAccessor = mca; | |
| 615 | + } | |
| 616 | + | |
| 617 | + /* | |
| 618 | + * Retrieve the accessor object for the java.awt.MenuComponent class. | |
| 619 | + */ | |
| 620 | + public static MenuComponentAccessor getMenuComponentAccessor() { | |
| 621 | + if (menuComponentAccessor == null) { | |
| 622 | + unsafe.ensureClassInitialized(MenuComponent.class); | |
| 623 | + } | |
| 624 | + return menuComponentAccessor; | |
| 625 | + } | |
| 626 | + | |
| 627 | + /* | |
| 628 | + * Set an accessor object for the java.awt.EventQueue class. | |
| 629 | + */ | |
| 630 | + public static void setEventQueueAccessor(EventQueueAccessor eqa) { | |
| 631 | + eventQueueAccessor = eqa; | |
| 632 | + } | |
| 633 | + | |
| 634 | + /* | |
| 635 | + * Retrieve the accessor object for the java.awt.EventQueue class. | |
| 636 | + */ | |
| 637 | + public static EventQueueAccessor getEventQueueAccessor() { | |
| 638 | + if (eventQueueAccessor == null) { | |
| 639 | + unsafe.ensureClassInitialized(EventQueue.class); | |
| 640 | + } | |
| 641 | + return eventQueueAccessor; | |
| 642 | + } | |
| 643 | + | |
| 644 | + /* | |
| 645 | + * Set an accessor object for the java.awt.PopupMenu class. | |
| 646 | + */ | |
| 647 | + public static void setPopupMenuAccessor(PopupMenuAccessor pma) { | |
| 648 | + popupMenuAccessor = pma; | |
| 649 | + } | |
| 650 | + | |
| 651 | + /* | |
| 652 | + * Retrieve the accessor object for the java.awt.PopupMenu class. | |
| 653 | + */ | |
| 654 | + public static PopupMenuAccessor getPopupMenuAccessor() { | |
| 655 | + if (popupMenuAccessor == null) { | |
| 656 | + unsafe.ensureClassInitialized(PopupMenu.class); | |
| 657 | + } | |
| 658 | + return popupMenuAccessor; | |
| 659 | + } | |
| 660 | + | |
| 661 | + /* | |
| 662 | + * Set an accessor object for the java.awt.FileDialog class. | |
| 663 | + */ | |
| 664 | + public static void setFileDialogAccessor(FileDialogAccessor fda) { | |
| 665 | + fileDialogAccessor = fda; | |
| 666 | + } | |
| 667 | + | |
| 668 | + /* | |
| 669 | + * Retrieve the accessor object for the java.awt.FileDialog class. | |
| 670 | + */ | |
| 671 | + public static FileDialogAccessor getFileDialogAccessor() { | |
| 672 | + if (fileDialogAccessor == null) { | |
| 673 | + unsafe.ensureClassInitialized(FileDialog.class); | |
| 674 | + } | |
| 675 | + return fileDialogAccessor; | |
| 676 | + } | |
| 677 | + | |
| 678 | +} | |
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1,383 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 2000, 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 | + */ | |
| 25 | + | |
| 26 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.awt.AWTEvent; | |
| 29 | +import java.util.Collections; | |
| 30 | +import java.util.HashSet; | |
| 31 | +import java.util.IdentityHashMap; | |
| 32 | +import java.util.Map; | |
| 33 | +import sun.util.logging.PlatformLogger; | |
| 34 | + | |
| 35 | +/** | |
| 36 | + * This class is to let AWT shutdown automatically when a user is done | |
| 37 | + * with AWT. It tracks AWT state using the following parameters: | |
| 38 | + * <ul> | |
| 39 | + * <li><code>peerMap</code> - the map between the existing peer objects | |
| 40 | + * and their associated targets | |
| 41 | + * <li><code>toolkitThreadBusy</code> - whether the toolkit thread | |
| 42 | + * is waiting for a new native event to appear in its queue | |
| 43 | + * or is dispatching an event | |
| 44 | + * <li><code>busyThreadSet</code> - a set of all the event dispatch | |
| 45 | + * threads that are busy at this moment, i.e. those that are not | |
| 46 | + * waiting for a new event to appear in their event queue. | |
| 47 | + * </ul><p> | |
| 48 | + * AWT is considered to be in ready-to-shutdown state when | |
| 49 | + * <code>peerMap</code> is empty and <code>toolkitThreadBusy</code> | |
| 50 | + * is false and <code>busyThreadSet</code> is empty. | |
| 51 | + * The internal AWTAutoShutdown logic secures that the single non-daemon | |
| 52 | + * thread (<code>blockerThread</code>) is running when AWT is not in | |
| 53 | + * ready-to-shutdown state. This blocker thread is to prevent AWT from | |
| 54 | + * exiting since the toolkit thread is now daemon and all the event | |
| 55 | + * dispatch threads are started only when needed. Once it is detected | |
| 56 | + * that AWT is in ready-to-shutdown state this blocker thread waits | |
| 57 | + * for a certain timeout and if AWT state doesn't change during timeout | |
| 58 | + * this blocker thread terminates all the event dispatch threads and | |
| 59 | + * exits. | |
| 60 | + */ | |
| 61 | +public final class AWTAutoShutdown implements Runnable { | |
| 62 | + | |
| 63 | + private static final AWTAutoShutdown theInstance = new AWTAutoShutdown(); | |
| 64 | + | |
| 65 | + /** | |
| 66 | + * This lock object is used to synchronize shutdown operations. | |
| 67 | + */ | |
| 68 | + private final Object mainLock = new Object(); | |
| 69 | + | |
| 70 | + /** | |
| 71 | + * This lock object is to secure that when a new blocker thread is | |
| 72 | + * started it will be the first who acquire the main lock after | |
| 73 | + * the thread that created the new blocker released the main lock | |
| 74 | + * by calling lock.wait() to wait for the blocker to start. | |
| 75 | + */ | |
| 76 | + private final Object activationLock = new Object(); | |
| 77 | + | |
| 78 | + /** | |
| 79 | + * This set keeps references to all the event dispatch threads that | |
| 80 | + * are busy at this moment, i.e. those that are not waiting for a | |
| 81 | + * new event to appear in their event queue. | |
| 82 | + * Access is synchronized on the main lock object. | |
| 83 | + */ | |
| 84 | + private final HashSet busyThreadSet = new HashSet(7); | |
| 85 | + | |
| 86 | + /** | |
| 87 | + * Indicates whether the toolkit thread is waiting for a new native | |
| 88 | + * event to appear or is dispatching an event. | |
| 89 | + */ | |
| 90 | + private boolean toolkitThreadBusy = false; | |
| 91 | + | |
| 92 | + /** | |
| 93 | + * This is a map between components and their peers. | |
| 94 | + * we should work with in under activationLock&mainLock lock. | |
| 95 | + */ | |
| 96 | + private final Map peerMap = new IdentityHashMap(); | |
| 97 | + | |
| 98 | + /** | |
| 99 | + * References the alive non-daemon thread that is currently used | |
| 100 | + * for keeping AWT from exiting. | |
| 101 | + */ | |
| 102 | + private Thread blockerThread = null; | |
| 103 | + | |
| 104 | + /** | |
| 105 | + * We need this flag to secure that AWT state hasn't changed while | |
| 106 | + * we were waiting for the safety timeout to pass. | |
| 107 | + */ | |
| 108 | + private boolean timeoutPassed = false; | |
| 109 | + | |
| 110 | + /** | |
| 111 | + * Once we detect that AWT is ready to shutdown we wait for a certain | |
| 112 | + * timeout to pass before stopping event dispatch threads. | |
| 113 | + */ | |
| 114 | + private static final int SAFETY_TIMEOUT = 1000; | |
| 115 | + | |
| 116 | + /** | |
| 117 | + * Constructor method is intentionally made private to secure | |
| 118 | + * a single instance. Use getInstance() to reference it. | |
| 119 | + * | |
| 120 | + * @see AWTAutoShutdown#getInstance | |
| 121 | + */ | |
| 122 | + private AWTAutoShutdown() {} | |
| 123 | + | |
| 124 | + /** | |
| 125 | + * Returns reference to a single AWTAutoShutdown instance. | |
| 126 | + */ | |
| 127 | + public static AWTAutoShutdown getInstance() { | |
| 128 | + return theInstance; | |
| 129 | + } | |
| 130 | + | |
| 131 | + /** | |
| 132 | + * Notify that the toolkit thread is not waiting for a native event | |
| 133 | + * to appear in its queue. | |
| 134 | + * | |
| 135 | + * @see AWTAutoShutdown#notifyToolkitThreadFree | |
| 136 | + * @see AWTAutoShutdown#setToolkitBusy | |
| 137 | + * @see AWTAutoShutdown#isReadyToShutdown | |
| 138 | + */ | |
| 139 | + public static void notifyToolkitThreadBusy() { | |
| 140 | + getInstance().setToolkitBusy(true); | |
| 141 | + } | |
| 142 | + | |
| 143 | + /** | |
| 144 | + * Notify that the toolkit thread is waiting for a native event | |
| 145 | + * to appear in its queue. | |
| 146 | + * | |
| 147 | + * @see AWTAutoShutdown#notifyToolkitThreadFree | |
| 148 | + * @see AWTAutoShutdown#setToolkitBusy | |
| 149 | + * @see AWTAutoShutdown#isReadyToShutdown | |
| 150 | + */ | |
| 151 | + public static void notifyToolkitThreadFree() { | |
| 152 | + getInstance().setToolkitBusy(false); | |
| 153 | + } | |
| 154 | + | |
| 155 | + /** | |
| 156 | + * Add a specified thread to the set of busy event dispatch threads. | |
| 157 | + * If this set already contains the specified thread or the thread is null, | |
| 158 | + * the call leaves this set unchanged and returns silently. | |
| 159 | + * | |
| 160 | + * @param thread thread to be added to this set, if not present. | |
| 161 | + * @see AWTAutoShutdown#notifyThreadFree | |
| 162 | + * @see AWTAutoShutdown#isReadyToShutdown | |
| 163 | + */ | |
| 164 | + public void notifyThreadBusy(final Thread thread) { | |
| 165 | + if (thread == null) { | |
| 166 | + return; | |
| 167 | + } | |
| 168 | + synchronized (activationLock) { | |
| 169 | + synchronized (mainLock) { | |
| 170 | + if (blockerThread == null) { | |
| 171 | + activateBlockerThread(); | |
| 172 | + } else if (isReadyToShutdown()) { | |
| 173 | + mainLock.notifyAll(); | |
| 174 | + timeoutPassed = false; | |
| 175 | + } | |
| 176 | + busyThreadSet.add(thread); | |
| 177 | + } | |
| 178 | + } | |
| 179 | + } | |
| 180 | + | |
| 181 | + /** | |
| 182 | + * Remove a specified thread from the set of busy event dispatch threads. | |
| 183 | + * If this set doesn't contain the specified thread or the thread is null, | |
| 184 | + * the call leaves this set unchanged and returns silently. | |
| 185 | + * | |
| 186 | + * @param thread thread to be removed from this set, if present. | |
| 187 | + * @see AWTAutoShutdown#notifyThreadBusy | |
| 188 | + * @see AWTAutoShutdown#isReadyToShutdown | |
| 189 | + */ | |
| 190 | + public void notifyThreadFree(final Thread thread) { | |
| 191 | + if (thread == null) { | |
| 192 | + return; | |
| 193 | + } | |
| 194 | + synchronized (activationLock) { | |
| 195 | + synchronized (mainLock) { | |
| 196 | + busyThreadSet.remove(thread); | |
| 197 | + if (isReadyToShutdown()) { | |
| 198 | + mainLock.notifyAll(); | |
| 199 | + timeoutPassed = false; | |
| 200 | + } | |
| 201 | + } | |
| 202 | + } | |
| 203 | + } | |
| 204 | + | |
| 205 | + /** | |
| 206 | + * Notify that the peermap has been updated, that means a new peer | |
| 207 | + * has been created or some existing peer has been disposed. | |
| 208 | + * | |
| 209 | + * @see AWTAutoShutdown#isReadyToShutdown | |
| 210 | + */ | |
| 211 | + void notifyPeerMapUpdated() { | |
| 212 | + synchronized (activationLock) { | |
| 213 | + synchronized (mainLock) { | |
| 214 | + if (!isReadyToShutdown() && blockerThread == null) { | |
| 215 | + activateBlockerThread(); | |
| 216 | + } else { | |
| 217 | + mainLock.notifyAll(); | |
| 218 | + timeoutPassed = false; | |
| 219 | + } | |
| 220 | + } | |
| 221 | + } | |
| 222 | + } | |
| 223 | + | |
| 224 | + /** | |
| 225 | + * Determine whether AWT is currently in ready-to-shutdown state. | |
| 226 | + * AWT is considered to be in ready-to-shutdown state if | |
| 227 | + * <code>peerMap</code> is empty and <code>toolkitThreadBusy</code> | |
| 228 | + * is false and <code>busyThreadSet</code> is empty. | |
| 229 | + * | |
| 230 | + * @return true if AWT is in ready-to-shutdown state. | |
| 231 | + */ | |
| 232 | + private boolean isReadyToShutdown() { | |
| 233 | + return (!toolkitThreadBusy && | |
| 234 | + peerMap.isEmpty() && | |
| 235 | + busyThreadSet.isEmpty()); | |
| 236 | + } | |
| 237 | + | |
| 238 | + /** | |
| 239 | + * Notify about the toolkit thread state change. | |
| 240 | + * | |
| 241 | + * @param busy true if the toolkit thread state changes from idle | |
| 242 | + * to busy. | |
| 243 | + * @see AWTAutoShutdown#notifyToolkitThreadBusy | |
| 244 | + * @see AWTAutoShutdown#notifyToolkitThreadFree | |
| 245 | + * @see AWTAutoShutdown#isReadyToShutdown | |
| 246 | + */ | |
| 247 | + private void setToolkitBusy(final boolean busy) { | |
| 248 | + if (busy != toolkitThreadBusy) { | |
| 249 | + synchronized (activationLock) { | |
| 250 | + synchronized (mainLock) { | |
| 251 | + if (busy != toolkitThreadBusy) { | |
| 252 | + if (busy) { | |
| 253 | + if (blockerThread == null) { | |
| 254 | + activateBlockerThread(); | |
| 255 | + } else if (isReadyToShutdown()) { | |
| 256 | + mainLock.notifyAll(); | |
| 257 | + timeoutPassed = false; | |
| 258 | + } | |
| 259 | + toolkitThreadBusy = busy; | |
| 260 | + } else { | |
| 261 | + toolkitThreadBusy = busy; | |
| 262 | + if (isReadyToShutdown()) { | |
| 263 | + mainLock.notifyAll(); | |
| 264 | + timeoutPassed = false; | |
| 265 | + } | |
| 266 | + } | |
| 267 | + } | |
| 268 | + } | |
| 269 | + } | |
| 270 | + } | |
| 271 | + } | |
| 272 | + | |
| 273 | + /** | |
| 274 | + * Implementation of the Runnable interface. | |
| 275 | + * Incapsulates the blocker thread functionality. | |
| 276 | + * | |
| 277 | + * @see AWTAutoShutdown#isReadyToShutdown | |
| 278 | + */ | |
| 279 | + public void run() { | |
| 280 | + Thread currentThread = Thread.currentThread(); | |
| 281 | + boolean interrupted = false; | |
| 282 | + synchronized (mainLock) { | |
| 283 | + try { | |
| 284 | + /* Notify that the thread is started. */ | |
| 285 | + mainLock.notifyAll(); | |
| 286 | + while (blockerThread == currentThread) { | |
| 287 | + mainLock.wait(); | |
| 288 | + timeoutPassed = false; | |
| 289 | + /* | |
| 290 | + * This loop is introduced to handle the following case: | |
| 291 | + * it is possible that while we are waiting for the | |
| 292 | + * safety timeout to pass AWT state can change to | |
| 293 | + * not-ready-to-shutdown and back to ready-to-shutdown. | |
| 294 | + * In this case we have to wait once again. | |
| 295 | + * NOTE: we shouldn't break into the outer loop | |
| 296 | + * in this case, since we may never be notified | |
| 297 | + * in an outer infinite wait at this point. | |
| 298 | + */ | |
| 299 | + while (isReadyToShutdown()) { | |
| 300 | + if (timeoutPassed) { | |
| 301 | + timeoutPassed = false; | |
| 302 | + blockerThread = null; | |
| 303 | + break; | |
| 304 | + } | |
| 305 | + timeoutPassed = true; | |
| 306 | + mainLock.wait(SAFETY_TIMEOUT); | |
| 307 | + } | |
| 308 | + } | |
| 309 | + } catch (InterruptedException e) { | |
| 310 | + interrupted = true; | |
| 311 | + } finally { | |
| 312 | + if (blockerThread == currentThread) { | |
| 313 | + blockerThread = null; | |
| 314 | + } | |
| 315 | + } | |
| 316 | + } | |
| 317 | + if (!interrupted) { | |
| 318 | + AppContext.stopEventDispatchThreads(); | |
| 319 | + } | |
| 320 | + } | |
| 321 | + | |
| 322 | + static AWTEvent getShutdownEvent() { | |
| 323 | + return new AWTEvent(getInstance(), 0) {}; | |
| 324 | + } | |
| 325 | + | |
| 326 | + /** | |
| 327 | + * Creates and starts a new blocker thread. Doesn't return until | |
| 328 | + * the new blocker thread starts. | |
| 329 | + */ | |
| 330 | + private void activateBlockerThread() { | |
| 331 | + Thread thread = new Thread(this, "AWT-Shutdown"); | |
| 332 | + thread.setDaemon(false); | |
| 333 | + blockerThread = thread; | |
| 334 | + thread.start(); | |
| 335 | + try { | |
| 336 | + /* Wait for the blocker thread to start. */ | |
| 337 | + mainLock.wait(); | |
| 338 | + } catch (InterruptedException e) { | |
| 339 | + System.err.println("AWT blocker activation interrupted:"); | |
| 340 | + e.printStackTrace(); | |
| 341 | + } | |
| 342 | + } | |
| 343 | + | |
| 344 | + final void registerPeer(final Object target, final Object peer) { | |
| 345 | + synchronized (activationLock) { | |
| 346 | + synchronized (mainLock) { | |
| 347 | + peerMap.put(target, peer); | |
| 348 | + notifyPeerMapUpdated(); | |
| 349 | + } | |
| 350 | + } | |
| 351 | + } | |
| 352 | + | |
| 353 | + final void unregisterPeer(final Object target, final Object peer) { | |
| 354 | + synchronized (activationLock) { | |
| 355 | + synchronized (mainLock) { | |
| 356 | + if (peerMap.get(target) == peer) { | |
| 357 | + peerMap.remove(target); | |
| 358 | + notifyPeerMapUpdated(); | |
| 359 | + } | |
| 360 | + } | |
| 361 | + } | |
| 362 | + } | |
| 363 | + | |
| 364 | + final Object getPeer(final Object target) { | |
| 365 | + synchronized (activationLock) { | |
| 366 | + synchronized (mainLock) { | |
| 367 | + return peerMap.get(target); | |
| 368 | + } | |
| 369 | + } | |
| 370 | + } | |
| 371 | + | |
| 372 | + final void dumpPeers(final PlatformLogger aLog) { | |
| 373 | + synchronized (activationLock) { | |
| 374 | + synchronized (mainLock) { | |
| 375 | + aLog.fine("Mapped peers:"); | |
| 376 | + for (Object key : peerMap.keySet()) { | |
| 377 | + aLog.fine(key + "->" + peerMap.get(key)); | |
| 378 | + } | |
| 379 | + } | |
| 380 | + } | |
| 381 | + } | |
| 382 | + | |
| 383 | +} // class AWTAutoShutdown | |
| @@ -0,0 +1,140 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 2005, 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 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.nio.CharBuffer; | |
| 29 | +import java.nio.ByteBuffer; | |
| 30 | +import java.nio.charset.*; | |
| 31 | + | |
| 32 | + | |
| 33 | +//This class delegates all invokes to the charset "javaCs" if | |
| 34 | +//its subclasses do not provide their own en/decode solution. | |
| 35 | + | |
| 36 | +public class AWTCharset extends Charset { | |
| 37 | + protected Charset awtCs; | |
| 38 | + protected Charset javaCs; | |
| 39 | + | |
| 40 | + public AWTCharset(String awtCsName, Charset javaCs) { | |
| 41 | + super(awtCsName, null); | |
| 42 | + this.javaCs = javaCs; | |
| 43 | + this.awtCs = this; | |
| 44 | + } | |
| 45 | + | |
| 46 | + public boolean contains(Charset cs) { | |
| 47 | + if (javaCs == null) return false; | |
| 48 | + return javaCs.contains(cs); | |
| 49 | + } | |
| 50 | + | |
| 51 | + public CharsetEncoder newEncoder() { | |
| 52 | + if (javaCs == null) | |
| 53 | + throw new Error("Encoder is not supported by this Charset"); | |
| 54 | + return new Encoder(javaCs.newEncoder()); | |
| 55 | + } | |
| 56 | + | |
| 57 | + public CharsetDecoder newDecoder() { | |
| 58 | + if (javaCs == null) | |
| 59 | + throw new Error("Decoder is not supported by this Charset"); | |
| 60 | + return new Decoder(javaCs.newDecoder()); | |
| 61 | + } | |
| 62 | + | |
| 63 | + public class Encoder extends CharsetEncoder { | |
| 64 | + protected CharsetEncoder enc; | |
| 65 | + protected Encoder () { | |
| 66 | + this(javaCs.newEncoder()); | |
| 67 | + } | |
| 68 | + protected Encoder (CharsetEncoder enc) { | |
| 69 | + super(awtCs, | |
| 70 | + enc.averageBytesPerChar(), | |
| 71 | + enc.maxBytesPerChar()); | |
| 72 | + this.enc = enc; | |
| 73 | + } | |
| 74 | + public boolean canEncode(char c) { | |
| 75 | + return enc.canEncode(c); | |
| 76 | + } | |
| 77 | + public boolean canEncode(CharSequence cs) { | |
| 78 | + return enc.canEncode(cs); | |
| 79 | + } | |
| 80 | + protected CoderResult encodeLoop(CharBuffer src, ByteBuffer dst) { | |
| 81 | + return enc.encode(src, dst, true); | |
| 82 | + } | |
| 83 | + protected CoderResult implFlush(ByteBuffer out) { | |
| 84 | + return enc.flush(out); | |
| 85 | + } | |
| 86 | + protected void implReset() { | |
| 87 | + enc.reset(); | |
| 88 | + } | |
| 89 | + protected void implReplaceWith(byte[] newReplacement) { | |
| 90 | + if (enc != null) | |
| 91 | + enc.replaceWith(newReplacement); | |
| 92 | + } | |
| 93 | + protected void implOnMalformedInput(CodingErrorAction newAction) { | |
| 94 | + enc.onMalformedInput(newAction); | |
| 95 | + } | |
| 96 | + protected void implOnUnmappableCharacter(CodingErrorAction newAction) { | |
| 97 | + enc.onUnmappableCharacter(newAction); | |
| 98 | + } | |
| 99 | + public boolean isLegalReplacement(byte[] repl) { | |
| 100 | + return true; | |
| 101 | + } | |
| 102 | + } | |
| 103 | + | |
| 104 | + public class Decoder extends CharsetDecoder { | |
| 105 | + protected CharsetDecoder dec; | |
| 106 | + private String nr; | |
| 107 | + | |
| 108 | + protected Decoder () { | |
| 109 | + this(javaCs.newDecoder()); | |
| 110 | + } | |
| 111 | + | |
| 112 | + protected Decoder (CharsetDecoder dec) { | |
| 113 | + super(awtCs, | |
| 114 | + dec.averageCharsPerByte(), | |
| 115 | + dec.maxCharsPerByte()); | |
| 116 | + this.dec = dec; | |
| 117 | + } | |
| 118 | + protected CoderResult decodeLoop(ByteBuffer src, CharBuffer dst) { | |
| 119 | + return dec.decode(src, dst, true); | |
| 120 | + } | |
| 121 | + ByteBuffer fbb = ByteBuffer.allocate(0); | |
| 122 | + protected CoderResult implFlush(CharBuffer out) { | |
| 123 | + dec.decode(fbb, out, true); | |
| 124 | + return dec.flush(out); | |
| 125 | + } | |
| 126 | + protected void implReset() { | |
| 127 | + dec.reset(); | |
| 128 | + } | |
| 129 | + protected void implReplaceWith(String newReplacement) { | |
| 130 | + if (dec != null) | |
| 131 | + dec.replaceWith(newReplacement); | |
| 132 | + } | |
| 133 | + protected void implOnMalformedInput(CodingErrorAction newAction) { | |
| 134 | + dec.onMalformedInput(newAction); | |
| 135 | + } | |
| 136 | + protected void implOnUnmappableCharacter(CodingErrorAction newAction) { | |
| 137 | + dec.onUnmappableCharacter(newAction); | |
| 138 | + } | |
| 139 | + } | |
| 140 | +} | |
| @@ -0,0 +1,42 @@ | ||
| 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 | + */ | |
| 25 | + | |
| 26 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.awt.AWTPermission; | |
| 29 | +import sun.security.util.PermissionFactory; | |
| 30 | + | |
| 31 | +/** | |
| 32 | + * A factory object for AWTPermission objects. | |
| 33 | + */ | |
| 34 | + | |
| 35 | +public class AWTPermissionFactory | |
| 36 | + implements PermissionFactory<AWTPermission> | |
| 37 | +{ | |
| 38 | + @Override | |
| 39 | + public AWTPermission newPermission(String name) { | |
| 40 | + return new AWTPermission(name); | |
| 41 | + } | |
| 42 | +} | |
Binary file not shown.
| @@ -0,0 +1,65 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1999, 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 | +package sun.awt; | |
| 27 | + | |
| 28 | +/** | |
| 29 | + * The AWTSecurityManager class provides the ability to secondarily | |
| 30 | + * index AppContext objects through SecurityManager extensions. | |
| 31 | + * As noted in AppContext.java, AppContexts are primarily indexed by | |
| 32 | + * ThreadGroup. In the case where the ThreadGroup doesn't provide | |
| 33 | + * enough information to determine AppContext (e.g. system threads), | |
| 34 | + * if a SecurityManager is installed which derives from | |
| 35 | + * AWTSecurityManager, the AWTSecurityManager's getAppContext() | |
| 36 | + * method is called to determine the AppContext. | |
| 37 | + * | |
| 38 | + * A typical example of the use of this class is where an applet | |
| 39 | + * is called by a system thread, yet the system AppContext is | |
| 40 | + * inappropriate, because applet code is currently executing. | |
| 41 | + * In this case, the getAppContext() method can walk the call stack | |
| 42 | + * to determine the applet code being executed and return the applet's | |
| 43 | + * AppContext object. | |
| 44 | + * | |
| 45 | + * @author Fred Ecks | |
| 46 | + */ | |
| 47 | +public class AWTSecurityManager extends SecurityManager { | |
| 48 | + | |
| 49 | + /** | |
| 50 | + * Get the AppContext corresponding to the current context. | |
| 51 | + * The default implementation returns null, but this method | |
| 52 | + * may be overridden by various SecurityManagers | |
| 53 | + * (e.g. AppletSecurity) to index AppContext objects by the | |
| 54 | + * calling context. | |
| 55 | + * | |
| 56 | + * @return the AppContext corresponding to the current context. | |
| 57 | + * @see sun.awt.AppContext | |
| 58 | + * @see java.lang.SecurityManager | |
| 59 | + * @since JDK1.2.1 | |
| 60 | + */ | |
| 61 | + public AppContext getAppContext() { | |
| 62 | + return null; // Default implementation returns null | |
| 63 | + } | |
| 64 | + | |
| 65 | +} /* class AWTSecurityManager */ | |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1,793 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1998, 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 | + */ | |
| 25 | + | |
| 26 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.awt.EventQueue; | |
| 29 | +import java.awt.Window; | |
| 30 | +import java.awt.SystemTray; | |
| 31 | +import java.awt.TrayIcon; | |
| 32 | +import java.awt.Toolkit; | |
| 33 | +import java.awt.GraphicsEnvironment; | |
| 34 | +import java.awt.event.InvocationEvent; | |
| 35 | +import java.security.AccessController; | |
| 36 | +import java.security.PrivilegedAction; | |
| 37 | +import java.util.Collections; | |
| 38 | +import java.util.HashMap; | |
| 39 | +import java.util.IdentityHashMap; | |
| 40 | +import java.util.Map; | |
| 41 | +import java.util.Set; | |
| 42 | +import java.util.HashSet; | |
| 43 | +import java.beans.PropertyChangeSupport; | |
| 44 | +import java.beans.PropertyChangeListener; | |
| 45 | +import sun.util.logging.PlatformLogger; | |
| 46 | +import java.util.concurrent.locks.Condition; | |
| 47 | +import java.util.concurrent.locks.Lock; | |
| 48 | +import java.util.concurrent.locks.ReentrantLock; | |
| 49 | + | |
| 50 | +/** | |
| 51 | + * The AppContext is a table referenced by ThreadGroup which stores | |
| 52 | + * application service instances. (If you are not writing an application | |
| 53 | + * service, or don't know what one is, please do not use this class.) | |
| 54 | + * The AppContext allows applet access to what would otherwise be | |
| 55 | + * potentially dangerous services, such as the ability to peek at | |
| 56 | + * EventQueues or change the look-and-feel of a Swing application.<p> | |
| 57 | + * | |
| 58 | + * Most application services use a singleton object to provide their | |
| 59 | + * services, either as a default (such as getSystemEventQueue or | |
| 60 | + * getDefaultToolkit) or as static methods with class data (System). | |
| 61 | + * The AppContext works with the former method by extending the concept | |
| 62 | + * of "default" to be ThreadGroup-specific. Application services | |
| 63 | + * lookup their singleton in the AppContext.<p> | |
| 64 | + * | |
| 65 | + * For example, here we have a Foo service, with its pre-AppContext | |
| 66 | + * code:<p> | |
| 67 | + * <code><pre> | |
| 68 | + * public class Foo { | |
| 69 | + * private static Foo defaultFoo = new Foo(); | |
| 70 | + * | |
| 71 | + * public static Foo getDefaultFoo() { | |
| 72 | + * return defaultFoo; | |
| 73 | + * } | |
| 74 | + * | |
| 75 | + * ... Foo service methods | |
| 76 | + * }</pre></code><p> | |
| 77 | + * | |
| 78 | + * The problem with the above is that the Foo service is global in scope, | |
| 79 | + * so that applets and other untrusted code can execute methods on the | |
| 80 | + * single, shared Foo instance. The Foo service therefore either needs | |
| 81 | + * to block its use by untrusted code using a SecurityManager test, or | |
| 82 | + * restrict its capabilities so that it doesn't matter if untrusted code | |
| 83 | + * executes it.<p> | |
| 84 | + * | |
| 85 | + * Here's the Foo class written to use the AppContext:<p> | |
| 86 | + * <code><pre> | |
| 87 | + * public class Foo { | |
| 88 | + * public static Foo getDefaultFoo() { | |
| 89 | + * Foo foo = (Foo)AppContext.getAppContext().get(Foo.class); | |
| 90 | + * if (foo == null) { | |
| 91 | + * foo = new Foo(); | |
| 92 | + * getAppContext().put(Foo.class, foo); | |
| 93 | + * } | |
| 94 | + * return foo; | |
| 95 | + * } | |
| 96 | + * | |
| 97 | + * ... Foo service methods | |
| 98 | + * }</pre></code><p> | |
| 99 | + * | |
| 100 | + * Since a separate AppContext can exist for each ThreadGroup, trusted | |
| 101 | + * and untrusted code have access to different Foo instances. This allows | |
| 102 | + * untrusted code access to "system-wide" services -- the service remains | |
| 103 | + * within the AppContext "sandbox". For example, say a malicious applet | |
| 104 | + * wants to peek all of the key events on the EventQueue to listen for | |
| 105 | + * passwords; if separate EventQueues are used for each ThreadGroup | |
| 106 | + * using AppContexts, the only key events that applet will be able to | |
| 107 | + * listen to are its own. A more reasonable applet request would be to | |
| 108 | + * change the Swing default look-and-feel; with that default stored in | |
| 109 | + * an AppContext, the applet's look-and-feel will change without | |
| 110 | + * disrupting other applets or potentially the browser itself.<p> | |
| 111 | + * | |
| 112 | + * Because the AppContext is a facility for safely extending application | |
| 113 | + * service support to applets, none of its methods may be blocked by a | |
| 114 | + * a SecurityManager check in a valid Java implementation. Applets may | |
| 115 | + * therefore safely invoke any of its methods without worry of being | |
| 116 | + * blocked. | |
| 117 | + * | |
| 118 | + * Note: If a SecurityManager is installed which derives from | |
| 119 | + * sun.awt.AWTSecurityManager, it may override the | |
| 120 | + * AWTSecurityManager.getAppContext() method to return the proper | |
| 121 | + * AppContext based on the execution context, in the case where | |
| 122 | + * the default ThreadGroup-based AppContext indexing would return | |
| 123 | + * the main "system" AppContext. For example, in an applet situation, | |
| 124 | + * if a system thread calls into an applet, rather than returning the | |
| 125 | + * main "system" AppContext (the one corresponding to the system thread), | |
| 126 | + * an installed AWTSecurityManager may return the applet's AppContext | |
| 127 | + * based on the execution context. | |
| 128 | + * | |
| 129 | + * @author Thomas Ball | |
| 130 | + * @author Fred Ecks | |
| 131 | + */ | |
| 132 | +public final class AppContext { | |
| 133 | + private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.AppContext"); | |
| 134 | + | |
| 135 | + /* Since the contents of an AppContext are unique to each Java | |
| 136 | + * session, this class should never be serialized. */ | |
| 137 | + | |
| 138 | + /* | |
| 139 | + * The key to put()/get() the Java EventQueue into/from the AppContext. | |
| 140 | + */ | |
| 141 | + public static final Object EVENT_QUEUE_KEY = new StringBuffer("EventQueue"); | |
| 142 | + | |
| 143 | + /* | |
| 144 | + * The keys to store EventQueue push/pop lock and condition. | |
| 145 | + */ | |
| 146 | + public final static Object EVENT_QUEUE_LOCK_KEY = new StringBuilder("EventQueue.Lock"); | |
| 147 | + public final static Object EVENT_QUEUE_COND_KEY = new StringBuilder("EventQueue.Condition"); | |
| 148 | + | |
| 149 | + /* A map of AppContexts, referenced by ThreadGroup. | |
| 150 | + */ | |
| 151 | + private static final Map<ThreadGroup, AppContext> threadGroup2appContext = | |
| 152 | + Collections.synchronizedMap(new IdentityHashMap<ThreadGroup, AppContext>()); | |
| 153 | + | |
| 154 | + /** | |
| 155 | + * Returns a set containing all <code>AppContext</code>s. | |
| 156 | + */ | |
| 157 | + public static Set<AppContext> getAppContexts() { | |
| 158 | + synchronized (threadGroup2appContext) { | |
| 159 | + return new HashSet<AppContext>(threadGroup2appContext.values()); | |
| 160 | + } | |
| 161 | + } | |
| 162 | + | |
| 163 | + /* The main "system" AppContext, used by everything not otherwise | |
| 164 | + contained in another AppContext. | |
| 165 | + */ | |
| 166 | + private static volatile AppContext mainAppContext = null; | |
| 167 | + | |
| 168 | + /* | |
| 169 | + * The hash map associated with this AppContext. A private delegate | |
| 170 | + * is used instead of subclassing HashMap so as to avoid all of | |
| 171 | + * HashMap's potentially risky methods, such as clear(), elements(), | |
| 172 | + * putAll(), etc. | |
| 173 | + */ | |
| 174 | + private final HashMap table = new HashMap(); | |
| 175 | + | |
| 176 | + private final ThreadGroup threadGroup; | |
| 177 | + | |
| 178 | + /** | |
| 179 | + * If any <code>PropertyChangeListeners</code> have been registered, | |
| 180 | + * the <code>changeSupport</code> field describes them. | |
| 181 | + * | |
| 182 | + * @see #addPropertyChangeListener | |
| 183 | + * @see #removePropertyChangeListener | |
| 184 | + * @see #firePropertyChange | |
| 185 | + */ | |
| 186 | + private PropertyChangeSupport changeSupport = null; | |
| 187 | + | |
| 188 | + public static final String DISPOSED_PROPERTY_NAME = "disposed"; | |
| 189 | + public static final String GUI_DISPOSED = "guidisposed"; | |
| 190 | + | |
| 191 | + private volatile boolean isDisposed = false; // true if AppContext is disposed | |
| 192 | + | |
| 193 | + public boolean isDisposed() { | |
| 194 | + return isDisposed; | |
| 195 | + } | |
| 196 | + | |
| 197 | + static { | |
| 198 | + // On the main Thread, we get the ThreadGroup, make a corresponding | |
| 199 | + // AppContext, and instantiate the Java EventQueue. This way, legacy | |
| 200 | + // code is unaffected by the move to multiple AppContext ability. | |
| 201 | + AccessController.doPrivileged(new PrivilegedAction() { | |
| 202 | + public Object run() { | |
| 203 | + ThreadGroup currentThreadGroup = | |
| 204 | + Thread.currentThread().getThreadGroup(); | |
| 205 | + ThreadGroup parentThreadGroup = currentThreadGroup.getParent(); | |
| 206 | + while (parentThreadGroup != null) { | |
| 207 | + // Find the root ThreadGroup to construct our main AppContext | |
| 208 | + currentThreadGroup = parentThreadGroup; | |
| 209 | + parentThreadGroup = currentThreadGroup.getParent(); | |
| 210 | + } | |
| 211 | + mainAppContext = new AppContext(currentThreadGroup); | |
| 212 | + numAppContexts = 1; | |
| 213 | + return mainAppContext; | |
| 214 | + } | |
| 215 | + }); | |
| 216 | + } | |
| 217 | + | |
| 218 | + /* | |
| 219 | + * The total number of AppContexts, system-wide. This number is | |
| 220 | + * incremented at the beginning of the constructor, and decremented | |
| 221 | + * at the end of dispose(). getAppContext() checks to see if this | |
| 222 | + * number is 1. If so, it returns the sole AppContext without | |
| 223 | + * checking Thread.currentThread(). | |
| 224 | + */ | |
| 225 | + private static volatile int numAppContexts; | |
| 226 | + | |
| 227 | + /* | |
| 228 | + * The context ClassLoader that was used to create this AppContext. | |
| 229 | + */ | |
| 230 | + private final ClassLoader contextClassLoader; | |
| 231 | + | |
| 232 | + /** | |
| 233 | + * Constructor for AppContext. This method is <i>not</i> public, | |
| 234 | + * nor should it ever be used as such. The proper way to construct | |
| 235 | + * an AppContext is through the use of SunToolkit.createNewAppContext. | |
| 236 | + * A ThreadGroup is created for the new AppContext, a Thread is | |
| 237 | + * created within that ThreadGroup, and that Thread calls | |
| 238 | + * SunToolkit.createNewAppContext before calling anything else. | |
| 239 | + * That creates both the new AppContext and its EventQueue. | |
| 240 | + * | |
| 241 | + * @param threadGroup The ThreadGroup for the new AppContext | |
| 242 | + * @see sun.awt.SunToolkit | |
| 243 | + * @since 1.2 | |
| 244 | + */ | |
| 245 | + AppContext(ThreadGroup threadGroup) { | |
| 246 | + numAppContexts++; | |
| 247 | + | |
| 248 | + this.threadGroup = threadGroup; | |
| 249 | + threadGroup2appContext.put(threadGroup, this); | |
| 250 | + | |
| 251 | + this.contextClassLoader = | |
| 252 | + AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() { | |
| 253 | + public ClassLoader run() { | |
| 254 | + return Thread.currentThread().getContextClassLoader(); | |
| 255 | + } | |
| 256 | + }); | |
| 257 | + | |
| 258 | + // Initialize push/pop lock and its condition to be used by all the | |
| 259 | + // EventQueues within this AppContext | |
| 260 | + Lock eventQueuePushPopLock = new ReentrantLock(); | |
| 261 | + put(EVENT_QUEUE_LOCK_KEY, eventQueuePushPopLock); | |
| 262 | + Condition eventQueuePushPopCond = eventQueuePushPopLock.newCondition(); | |
| 263 | + put(EVENT_QUEUE_COND_KEY, eventQueuePushPopCond); | |
| 264 | + } | |
| 265 | + | |
| 266 | + private static final ThreadLocal<AppContext> threadAppContext = | |
| 267 | + new ThreadLocal<AppContext>(); | |
| 268 | + | |
| 269 | + /** | |
| 270 | + * Returns the appropriate AppContext for the caller, | |
| 271 | + * as determined by its ThreadGroup. If the main "system" AppContext | |
| 272 | + * would be returned and there's an AWTSecurityManager installed, it | |
| 273 | + * is called to get the proper AppContext based on the execution | |
| 274 | + * context. | |
| 275 | + * | |
| 276 | + * @return the AppContext for the caller. | |
| 277 | + * @see java.lang.ThreadGroup | |
| 278 | + * @since 1.2 | |
| 279 | + */ | |
| 280 | + public final static AppContext getAppContext() { | |
| 281 | + if (numAppContexts == 1) // If there's only one system-wide, | |
| 282 | + return mainAppContext; // return the main system AppContext. | |
| 283 | + | |
| 284 | + AppContext appContext = threadAppContext.get(); | |
| 285 | + | |
| 286 | + if (null == appContext) { | |
| 287 | + appContext = AccessController.doPrivileged(new PrivilegedAction<AppContext>() | |
| 288 | + { | |
| 289 | + public AppContext run() { | |
| 290 | + // Get the current ThreadGroup, and look for it and its | |
| 291 | + // parents in the hash from ThreadGroup to AppContext -- | |
| 292 | + // it should be found, because we use createNewContext() | |
| 293 | + // when new AppContext objects are created. | |
| 294 | + ThreadGroup currentThreadGroup = Thread.currentThread().getThreadGroup(); | |
| 295 | + ThreadGroup threadGroup = currentThreadGroup; | |
| 296 | + AppContext context = threadGroup2appContext.get(threadGroup); | |
| 297 | + while (context == null) { | |
| 298 | + threadGroup = threadGroup.getParent(); | |
| 299 | + if (threadGroup == null) { | |
| 300 | + // If we get here, we're running under a ThreadGroup that | |
| 301 | + // has no AppContext associated with it. This should never | |
| 302 | + // happen, because createNewContext() should be used by the | |
| 303 | + // toolkit to create the ThreadGroup that everything runs | |
| 304 | + // under. | |
| 305 | + throw new RuntimeException("Invalid ThreadGroup"); | |
| 306 | + } | |
| 307 | + context = threadGroup2appContext.get(threadGroup); | |
| 308 | + } | |
| 309 | + // In case we did anything in the above while loop, we add | |
| 310 | + // all the intermediate ThreadGroups to threadGroup2appContext | |
| 311 | + // so we won't spin again. | |
| 312 | + for (ThreadGroup tg = currentThreadGroup; tg != threadGroup; tg = tg.getParent()) { | |
| 313 | + threadGroup2appContext.put(tg, context); | |
| 314 | + } | |
| 315 | + // Now we're done, so we cache the latest key/value pair. | |
| 316 | + // (we do this before checking with any AWTSecurityManager, so if | |
| 317 | + // this Thread equates with the main AppContext in the cache, it | |
| 318 | + // still will) | |
| 319 | + threadAppContext.set(context); | |
| 320 | + | |
| 321 | + return context; | |
| 322 | + } | |
| 323 | + }); | |
| 324 | + } | |
| 325 | + | |
| 326 | + if (appContext == mainAppContext) { | |
| 327 | + // Before we return the main "system" AppContext, check to | |
| 328 | + // see if there's an AWTSecurityManager installed. If so, | |
| 329 | + // allow it to choose the AppContext to return. | |
| 330 | + SecurityManager securityManager = System.getSecurityManager(); | |
| 331 | + if ((securityManager != null) && | |
| 332 | + (securityManager instanceof AWTSecurityManager)) | |
| 333 | + { | |
| 334 | + AWTSecurityManager awtSecMgr = (AWTSecurityManager)securityManager; | |
| 335 | + AppContext secAppContext = awtSecMgr.getAppContext(); | |
| 336 | + if (secAppContext != null) { | |
| 337 | + appContext = secAppContext; // Return what we're told | |
| 338 | + } | |
| 339 | + } | |
| 340 | + } | |
| 341 | + | |
| 342 | + return appContext; | |
| 343 | + } | |
| 344 | + | |
| 345 | + private long DISPOSAL_TIMEOUT = 5000; // Default to 5-second timeout | |
| 346 | + // for disposal of all Frames | |
| 347 | + // (we wait for this time twice, | |
| 348 | + // once for dispose(), and once | |
| 349 | + // to clear the EventQueue). | |
| 350 | + | |
| 351 | + private long THREAD_INTERRUPT_TIMEOUT = 1000; | |
| 352 | + // Default to 1-second timeout for all | |
| 353 | + // interrupted Threads to exit, and another | |
| 354 | + // 1 second for all stopped Threads to die. | |
| 355 | + | |
| 356 | + /** | |
| 357 | + * Disposes of this AppContext, all of its top-level Frames, and | |
| 358 | + * all Threads and ThreadGroups contained within it. | |
| 359 | + * | |
| 360 | + * This method must be called from a Thread which is not contained | |
| 361 | + * within this AppContext. | |
| 362 | + * | |
| 363 | + * @exception IllegalThreadStateException if the current thread is | |
| 364 | + * contained within this AppContext | |
| 365 | + * @since 1.2 | |
| 366 | + */ | |
| 367 | + public void dispose() throws IllegalThreadStateException { | |
| 368 | + // Check to be sure that the current Thread isn't in this AppContext | |
| 369 | + if (this.threadGroup.parentOf(Thread.currentThread().getThreadGroup())) { | |
| 370 | + throw new IllegalThreadStateException( | |
| 371 | + "Current Thread is contained within AppContext to be disposed." | |
| 372 | + ); | |
| 373 | + } | |
| 374 | + | |
| 375 | + synchronized(this) { | |
| 376 | + if (this.isDisposed) { | |
| 377 | + return; // If already disposed, bail. | |
| 378 | + } | |
| 379 | + this.isDisposed = true; | |
| 380 | + } | |
| 381 | + | |
| 382 | + final PropertyChangeSupport changeSupport = this.changeSupport; | |
| 383 | + if (changeSupport != null) { | |
| 384 | + changeSupport.firePropertyChange(DISPOSED_PROPERTY_NAME, false, true); | |
| 385 | + } | |
| 386 | + | |
| 387 | + // First, we post an InvocationEvent to be run on the | |
| 388 | + // EventDispatchThread which disposes of all top-level Frames and TrayIcons | |
| 389 | + | |
| 390 | + final Object notificationLock = new Object(); | |
| 391 | + | |
| 392 | + Runnable runnable = new Runnable() { | |
| 393 | + public void run() { | |
| 394 | + Window[] windowsToDispose = Window.getOwnerlessWindows(); | |
| 395 | + for (Window w : windowsToDispose) { | |
| 396 | + try { | |
| 397 | + w.dispose(); | |
| 398 | + } catch (Throwable t) { | |
| 399 | + log.finer("exception occured while disposing app context", t); | |
| 400 | + } | |
| 401 | + } | |
| 402 | + AccessController.doPrivileged(new PrivilegedAction() { | |
| 403 | + public Object run() { | |
| 404 | + if (!GraphicsEnvironment.isHeadless() && SystemTray.isSupported()) | |
| 405 | + { | |
| 406 | + SystemTray systemTray = SystemTray.getSystemTray(); | |
| 407 | + TrayIcon[] trayIconsToDispose = systemTray.getTrayIcons(); | |
| 408 | + for (TrayIcon ti : trayIconsToDispose) { | |
| 409 | + systemTray.remove(ti); | |
| 410 | + } | |
| 411 | + } | |
| 412 | + return null; | |
| 413 | + } | |
| 414 | + }); | |
| 415 | + // Alert PropertyChangeListeners that the GUI has been disposed. | |
| 416 | + if (changeSupport != null) { | |
| 417 | + changeSupport.firePropertyChange(GUI_DISPOSED, false, true); | |
| 418 | + } | |
| 419 | + synchronized(notificationLock) { | |
| 420 | + notificationLock.notifyAll(); // Notify caller that we're done | |
| 421 | + } | |
| 422 | + } | |
| 423 | + }; | |
| 424 | + synchronized(notificationLock) { | |
| 425 | + SunToolkit.postEvent(this, | |
| 426 | + new InvocationEvent(Toolkit.getDefaultToolkit(), runnable)); | |
| 427 | + try { | |
| 428 | + notificationLock.wait(DISPOSAL_TIMEOUT); | |
| 429 | + } catch (InterruptedException e) { } | |
| 430 | + } | |
| 431 | + | |
| 432 | + // Next, we post another InvocationEvent to the end of the | |
| 433 | + // EventQueue. When it's executed, we know we've executed all | |
| 434 | + // events in the queue. | |
| 435 | + | |
| 436 | + runnable = new Runnable() { public void run() { | |
| 437 | + synchronized(notificationLock) { | |
| 438 | + notificationLock.notifyAll(); // Notify caller that we're done | |
| 439 | + } | |
| 440 | + } }; | |
| 441 | + synchronized(notificationLock) { | |
| 442 | + SunToolkit.postEvent(this, | |
| 443 | + new InvocationEvent(Toolkit.getDefaultToolkit(), runnable)); | |
| 444 | + try { | |
| 445 | + notificationLock.wait(DISPOSAL_TIMEOUT); | |
| 446 | + } catch (InterruptedException e) { } | |
| 447 | + } | |
| 448 | + | |
| 449 | + // Next, we interrupt all Threads in the ThreadGroup | |
| 450 | + this.threadGroup.interrupt(); | |
| 451 | + // Note, the EventDispatchThread we've interrupted may dump an | |
| 452 | + // InterruptedException to the console here. This needs to be | |
| 453 | + // fixed in the EventDispatchThread, not here. | |
| 454 | + | |
| 455 | + // Next, we sleep 10ms at a time, waiting for all of the active | |
| 456 | + // Threads in the ThreadGroup to exit. | |
| 457 | + | |
| 458 | + long startTime = System.currentTimeMillis(); | |
| 459 | + long endTime = startTime + THREAD_INTERRUPT_TIMEOUT; | |
| 460 | + while ((this.threadGroup.activeCount() > 0) && | |
| 461 | + (System.currentTimeMillis() < endTime)) { | |
| 462 | + try { | |
| 463 | + Thread.sleep(10); | |
| 464 | + } catch (InterruptedException e) { } | |
| 465 | + } | |
| 466 | + | |
| 467 | + // Then, we stop any remaining Threads | |
| 468 | + this.threadGroup.stop(); | |
| 469 | + | |
| 470 | + // Next, we sleep 10ms at a time, waiting for all of the active | |
| 471 | + // Threads in the ThreadGroup to die. | |
| 472 | + | |
| 473 | + startTime = System.currentTimeMillis(); | |
| 474 | + endTime = startTime + THREAD_INTERRUPT_TIMEOUT; | |
| 475 | + while ((this.threadGroup.activeCount() > 0) && | |
| 476 | + (System.currentTimeMillis() < endTime)) { | |
| 477 | + try { | |
| 478 | + Thread.sleep(10); | |
| 479 | + } catch (InterruptedException e) { } | |
| 480 | + } | |
| 481 | + | |
| 482 | + // Next, we remove this and all subThreadGroups from threadGroup2appContext | |
| 483 | + int numSubGroups = this.threadGroup.activeGroupCount(); | |
| 484 | + if (numSubGroups > 0) { | |
| 485 | + ThreadGroup [] subGroups = new ThreadGroup[numSubGroups]; | |
| 486 | + numSubGroups = this.threadGroup.enumerate(subGroups); | |
| 487 | + for (int subGroup = 0; subGroup < numSubGroups; subGroup++) { | |
| 488 | + threadGroup2appContext.remove(subGroups[subGroup]); | |
| 489 | + } | |
| 490 | + } | |
| 491 | + threadGroup2appContext.remove(this.threadGroup); | |
| 492 | + | |
| 493 | + threadAppContext.set(null); | |
| 494 | + | |
| 495 | + // Finally, we destroy the ThreadGroup entirely. | |
| 496 | + try { | |
| 497 | + this.threadGroup.destroy(); | |
| 498 | + } catch (IllegalThreadStateException e) { | |
| 499 | + // Fired if not all the Threads died, ignore it and proceed | |
| 500 | + } | |
| 501 | + | |
| 502 | + synchronized (table) { | |
| 503 | + this.table.clear(); // Clear out the Hashtable to ease garbage collection | |
| 504 | + } | |
| 505 | + | |
| 506 | + numAppContexts--; | |
| 507 | + | |
| 508 | + mostRecentKeyValue = null; | |
| 509 | + } | |
| 510 | + | |
| 511 | + static final class PostShutdownEventRunnable implements Runnable { | |
| 512 | + private final AppContext appContext; | |
| 513 | + | |
| 514 | + public PostShutdownEventRunnable(AppContext ac) { | |
| 515 | + appContext = ac; | |
| 516 | + } | |
| 517 | + | |
| 518 | + public void run() { | |
| 519 | + final EventQueue eq = (EventQueue)appContext.get(EVENT_QUEUE_KEY); | |
| 520 | + if (eq != null) { | |
| 521 | + eq.postEvent(AWTAutoShutdown.getShutdownEvent()); | |
| 522 | + } | |
| 523 | + } | |
| 524 | + } | |
| 525 | + | |
| 526 | + static final class CreateThreadAction implements PrivilegedAction { | |
| 527 | + private final AppContext appContext; | |
| 528 | + private final Runnable runnable; | |
| 529 | + | |
| 530 | + public CreateThreadAction(AppContext ac, Runnable r) { | |
| 531 | + appContext = ac; | |
| 532 | + runnable = r; | |
| 533 | + } | |
| 534 | + | |
| 535 | + public Object run() { | |
| 536 | + Thread t = new Thread(appContext.getThreadGroup(), runnable); | |
| 537 | + t.setContextClassLoader(appContext.getContextClassLoader()); | |
| 538 | + t.setPriority(Thread.NORM_PRIORITY + 1); | |
| 539 | + t.setDaemon(true); | |
| 540 | + return t; | |
| 541 | + } | |
| 542 | + } | |
| 543 | + | |
| 544 | + static void stopEventDispatchThreads() { | |
| 545 | + for (AppContext appContext: getAppContexts()) { | |
| 546 | + if (appContext.isDisposed()) { | |
| 547 | + continue; | |
| 548 | + } | |
| 549 | + Runnable r = new PostShutdownEventRunnable(appContext); | |
| 550 | + // For security reasons EventQueue.postEvent should only be called | |
| 551 | + // on a thread that belongs to the corresponding thread group. | |
| 552 | + if (appContext != AppContext.getAppContext()) { | |
| 553 | + // Create a thread that belongs to the thread group associated | |
| 554 | + // with the AppContext and invokes EventQueue.postEvent. | |
| 555 | + PrivilegedAction action = new CreateThreadAction(appContext, r); | |
| 556 | + Thread thread = (Thread)AccessController.doPrivileged(action); | |
| 557 | + thread.start(); | |
| 558 | + } else { | |
| 559 | + r.run(); | |
| 560 | + } | |
| 561 | + } | |
| 562 | + } | |
| 563 | + | |
| 564 | + private MostRecentKeyValue mostRecentKeyValue = null; | |
| 565 | + private MostRecentKeyValue shadowMostRecentKeyValue = null; | |
| 566 | + | |
| 567 | + /** | |
| 568 | + * Returns the value to which the specified key is mapped in this context. | |
| 569 | + * | |
| 570 | + * @param key a key in the AppContext. | |
| 571 | + * @return the value to which the key is mapped in this AppContext; | |
| 572 | + * <code>null</code> if the key is not mapped to any value. | |
| 573 | + * @see #put(Object, Object) | |
| 574 | + * @since 1.2 | |
| 575 | + */ | |
| 576 | + public Object get(Object key) { | |
| 577 | + /* | |
| 578 | + * The most recent reference should be updated inside a synchronized | |
| 579 | + * block to avoid a race when put() and get() are executed in | |
| 580 | + * parallel on different threads. | |
| 581 | + */ | |
| 582 | + synchronized (table) { | |
| 583 | + // Note: this most recent key/value caching is thread-hot. | |
| 584 | + // A simple test using SwingSet found that 72% of lookups | |
| 585 | + // were matched using the most recent key/value. By instantiating | |
| 586 | + // a simple MostRecentKeyValue object on cache misses, the | |
| 587 | + // cache hits can be processed without synchronization. | |
| 588 | + | |
| 589 | + MostRecentKeyValue recent = mostRecentKeyValue; | |
| 590 | + if ((recent != null) && (recent.key == key)) { | |
| 591 | + return recent.value; | |
| 592 | + } | |
| 593 | + | |
| 594 | + Object value = table.get(key); | |
| 595 | + if(mostRecentKeyValue == null) { | |
| 596 | + mostRecentKeyValue = new MostRecentKeyValue(key, value); | |
| 597 | + shadowMostRecentKeyValue = new MostRecentKeyValue(key, value); | |
| 598 | + } else { | |
| 599 | + MostRecentKeyValue auxKeyValue = mostRecentKeyValue; | |
| 600 | + shadowMostRecentKeyValue.setPair(key, value); | |
| 601 | + mostRecentKeyValue = shadowMostRecentKeyValue; | |
| 602 | + shadowMostRecentKeyValue = auxKeyValue; | |
| 603 | + } | |
| 604 | + return value; | |
| 605 | + } | |
| 606 | + } | |
| 607 | + | |
| 608 | + /** | |
| 609 | + * Maps the specified <code>key</code> to the specified | |
| 610 | + * <code>value</code> in this AppContext. Neither the key nor the | |
| 611 | + * value can be <code>null</code>. | |
| 612 | + * <p> | |
| 613 | + * The value can be retrieved by calling the <code>get</code> method | |
| 614 | + * with a key that is equal to the original key. | |
| 615 | + * | |
| 616 | + * @param key the AppContext key. | |
| 617 | + * @param value the value. | |
| 618 | + * @return the previous value of the specified key in this | |
| 619 | + * AppContext, or <code>null</code> if it did not have one. | |
| 620 | + * @exception NullPointerException if the key or value is | |
| 621 | + * <code>null</code>. | |
| 622 | + * @see #get(Object) | |
| 623 | + * @since 1.2 | |
| 624 | + */ | |
| 625 | + public Object put(Object key, Object value) { | |
| 626 | + synchronized (table) { | |
| 627 | + MostRecentKeyValue recent = mostRecentKeyValue; | |
| 628 | + if ((recent != null) && (recent.key == key)) | |
| 629 | + recent.value = value; | |
| 630 | + return table.put(key, value); | |
| 631 | + } | |
| 632 | + } | |
| 633 | + | |
| 634 | + /** | |
| 635 | + * Removes the key (and its corresponding value) from this | |
| 636 | + * AppContext. This method does nothing if the key is not in the | |
| 637 | + * AppContext. | |
| 638 | + * | |
| 639 | + * @param key the key that needs to be removed. | |
| 640 | + * @return the value to which the key had been mapped in this AppContext, | |
| 641 | + * or <code>null</code> if the key did not have a mapping. | |
| 642 | + * @since 1.2 | |
| 643 | + */ | |
| 644 | + public Object remove(Object key) { | |
| 645 | + synchronized (table) { | |
| 646 | + MostRecentKeyValue recent = mostRecentKeyValue; | |
| 647 | + if ((recent != null) && (recent.key == key)) | |
| 648 | + recent.value = null; | |
| 649 | + return table.remove(key); | |
| 650 | + } | |
| 651 | + } | |
| 652 | + | |
| 653 | + /** | |
| 654 | + * Returns the root ThreadGroup for all Threads contained within | |
| 655 | + * this AppContext. | |
| 656 | + * @since 1.2 | |
| 657 | + */ | |
| 658 | + public ThreadGroup getThreadGroup() { | |
| 659 | + return threadGroup; | |
| 660 | + } | |
| 661 | + | |
| 662 | + /** | |
| 663 | + * Returns the context ClassLoader that was used to create this | |
| 664 | + * AppContext. | |
| 665 | + * | |
| 666 | + * @see java.lang.Thread#getContextClassLoader | |
| 667 | + */ | |
| 668 | + public ClassLoader getContextClassLoader() { | |
| 669 | + return contextClassLoader; | |
| 670 | + } | |
| 671 | + | |
| 672 | + /** | |
| 673 | + * Returns a string representation of this AppContext. | |
| 674 | + * @since 1.2 | |
| 675 | + */ | |
| 676 | + @Override | |
| 677 | + public String toString() { | |
| 678 | + return getClass().getName() + "[threadGroup=" + threadGroup.getName() + "]"; | |
| 679 | + } | |
| 680 | + | |
| 681 | + /** | |
| 682 | + * Returns an array of all the property change listeners | |
| 683 | + * registered on this component. | |
| 684 | + * | |
| 685 | + * @return all of this component's <code>PropertyChangeListener</code>s | |
| 686 | + * or an empty array if no property change | |
| 687 | + * listeners are currently registered | |
| 688 | + * | |
| 689 | + * @see #addPropertyChangeListener | |
| 690 | + * @see #removePropertyChangeListener | |
| 691 | + * @see #getPropertyChangeListeners(java.lang.String) | |
| 692 | + * @see java.beans.PropertyChangeSupport#getPropertyChangeListeners | |
| 693 | + * @since 1.4 | |
| 694 | + */ | |
| 695 | + public synchronized PropertyChangeListener[] getPropertyChangeListeners() { | |
| 696 | + if (changeSupport == null) { | |
| 697 | + return new PropertyChangeListener[0]; | |
| 698 | + } | |
| 699 | + return changeSupport.getPropertyChangeListeners(); | |
| 700 | + } | |
| 701 | + | |
| 702 | + /** | |
| 703 | + * Adds a PropertyChangeListener to the listener list for a specific | |
| 704 | + * property. The specified property may be one of the following: | |
| 705 | + * <ul> | |
| 706 | + * <li>if this AppContext is disposed ("disposed")</li> | |
| 707 | + * </ul> | |
| 708 | + * <ul> | |
| 709 | + * <li>if this AppContext's unowned Windows have been disposed | |
| 710 | + * ("guidisposed"). Code to cleanup after the GUI is disposed | |
| 711 | + * (such as LookAndFeel.uninitialize()) should execute in response to | |
| 712 | + * this property being fired. Notifications for the "guidisposed" | |
| 713 | + * property are sent on the event dispatch thread.</li> | |
| 714 | + * </ul> | |
| 715 | + * <p> | |
| 716 | + * If listener is null, no exception is thrown and no action is performed. | |
| 717 | + * | |
| 718 | + * @param propertyName one of the property names listed above | |
| 719 | + * @param listener the PropertyChangeListener to be added | |
| 720 | + * | |
| 721 | + * @see #removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) | |
| 722 | + * @see #getPropertyChangeListeners(java.lang.String) | |
| 723 | + * @see #addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) | |
| 724 | + */ | |
| 725 | + public synchronized void addPropertyChangeListener( | |
| 726 | + String propertyName, | |
| 727 | + PropertyChangeListener listener) { | |
| 728 | + if (listener == null) { | |
| 729 | + return; | |
| 730 | + } | |
| 731 | + if (changeSupport == null) { | |
| 732 | + changeSupport = new PropertyChangeSupport(this); | |
| 733 | + } | |
| 734 | + changeSupport.addPropertyChangeListener(propertyName, listener); | |
| 735 | + } | |
| 736 | + | |
| 737 | + /** | |
| 738 | + * Removes a PropertyChangeListener from the listener list for a specific | |
| 739 | + * property. This method should be used to remove PropertyChangeListeners | |
| 740 | + * that were registered for a specific bound property. | |
| 741 | + * <p> | |
| 742 | + * If listener is null, no exception is thrown and no action is performed. | |
| 743 | + * | |
| 744 | + * @param propertyName a valid property name | |
| 745 | + * @param listener the PropertyChangeListener to be removed | |
| 746 | + * | |
| 747 | + * @see #addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) | |
| 748 | + * @see #getPropertyChangeListeners(java.lang.String) | |
| 749 | + * @see #removePropertyChangeListener(java.beans.PropertyChangeListener) | |
| 750 | + */ | |
| 751 | + public synchronized void removePropertyChangeListener( | |
| 752 | + String propertyName, | |
| 753 | + PropertyChangeListener listener) { | |
| 754 | + if (listener == null || changeSupport == null) { | |
| 755 | + return; | |
| 756 | + } | |
| 757 | + changeSupport.removePropertyChangeListener(propertyName, listener); | |
| 758 | + } | |
| 759 | + | |
| 760 | + /** | |
| 761 | + * Returns an array of all the listeners which have been associated | |
| 762 | + * with the named property. | |
| 763 | + * | |
| 764 | + * @return all of the <code>PropertyChangeListeners</code> associated with | |
| 765 | + * the named property or an empty array if no listeners have | |
| 766 | + * been added | |
| 767 | + * | |
| 768 | + * @see #addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) | |
| 769 | + * @see #removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) | |
| 770 | + * @see #getPropertyChangeListeners | |
| 771 | + * @since 1.4 | |
| 772 | + */ | |
| 773 | + public synchronized PropertyChangeListener[] getPropertyChangeListeners( | |
| 774 | + String propertyName) { | |
| 775 | + if (changeSupport == null) { | |
| 776 | + return new PropertyChangeListener[0]; | |
| 777 | + } | |
| 778 | + return changeSupport.getPropertyChangeListeners(propertyName); | |
| 779 | + } | |
| 780 | +} | |
| 781 | + | |
| 782 | +final class MostRecentKeyValue { | |
| 783 | + Object key; | |
| 784 | + Object value; | |
| 785 | + MostRecentKeyValue(Object k, Object v) { | |
| 786 | + key = k; | |
| 787 | + value = v; | |
| 788 | + } | |
| 789 | + void setPair(Object k, Object v) { | |
| 790 | + key = k; | |
| 791 | + value = v; | |
| 792 | + } | |
| 793 | +} | |
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1,88 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 2003, 2005, 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 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.awt.event.FocusEvent; | |
| 29 | +import java.awt.Component; | |
| 30 | + | |
| 31 | +/** | |
| 32 | + * This class represents FocusEvents with a known "cause" - reason why this event happened. It can | |
| 33 | + * be mouse press, traversal, activation, and so on - all causes are described as Cause enum. The | |
| 34 | + * event with the cause can be constructed in two ways - explicitly through constructor of | |
| 35 | + * CausedFocusEvent class or implicitly, by calling appropriate requestFocusXXX method with "cause" | |
| 36 | + * parameter. The default cause is UNKNOWN. | |
| 37 | + */ | |
| 38 | +public class CausedFocusEvent extends FocusEvent { | |
| 39 | + public enum Cause { | |
| 40 | + UNKNOWN, | |
| 41 | + MOUSE_EVENT, | |
| 42 | + TRAVERSAL, | |
| 43 | + TRAVERSAL_UP, | |
| 44 | + TRAVERSAL_DOWN, | |
| 45 | + TRAVERSAL_FORWARD, | |
| 46 | + TRAVERSAL_BACKWARD, | |
| 47 | + MANUAL_REQUEST, | |
| 48 | + AUTOMATIC_TRAVERSE, | |
| 49 | + ROLLBACK, | |
| 50 | + NATIVE_SYSTEM, | |
| 51 | + ACTIVATION, | |
| 52 | + CLEAR_GLOBAL_FOCUS_OWNER, | |
| 53 | + RETARGETED | |
| 54 | + }; | |
| 55 | + | |
| 56 | + private final Cause cause; | |
| 57 | + | |
| 58 | + public Cause getCause() { | |
| 59 | + return cause; | |
| 60 | + } | |
| 61 | + | |
| 62 | + public String toString() { | |
| 63 | + return "java.awt.FocusEvent[" + super.paramString() + ",cause=" + cause + "] on " + getSource(); | |
| 64 | + } | |
| 65 | + | |
| 66 | + public CausedFocusEvent(Component source, int id, boolean temporary, | |
| 67 | + Component opposite, Cause cause) { | |
| 68 | + super(source, id, temporary, opposite); | |
| 69 | + if (cause == null) { | |
| 70 | + cause = Cause.UNKNOWN; | |
| 71 | + } | |
| 72 | + this.cause = cause; | |
| 73 | + } | |
| 74 | + | |
| 75 | + /** | |
| 76 | + * Retargets the original focus event to the new target. If the | |
| 77 | + * original focus event is CausedFocusEvent, it remains such and | |
| 78 | + * cause is copied. Otherwise, new CausedFocusEvent is created, | |
| 79 | + * with cause as RETARGETED. | |
| 80 | + * @return retargeted event, or null if e is null | |
| 81 | + */ | |
| 82 | + public static FocusEvent retarget(FocusEvent e, Component newSource) { | |
| 83 | + if (e == null) return null; | |
| 84 | + | |
| 85 | + return new CausedFocusEvent(newSource, e.getID(), e.isTemporary(), e.getOppositeComponent(), | |
| 86 | + (e instanceof CausedFocusEvent) ? ((CausedFocusEvent)e).getCause() : Cause.RETARGETED); | |
| 87 | + } | |
| 88 | +} | |
| @@ -0,0 +1,59 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1996, 1999, 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 | +package sun.awt; | |
| 26 | + | |
| 27 | +public class CharsetString { | |
| 28 | + /** | |
| 29 | + * chars for this string. See also offset, length. | |
| 30 | + */ | |
| 31 | + public char[] charsetChars; | |
| 32 | + | |
| 33 | + /** | |
| 34 | + * Offset within charsetChars of first character | |
| 35 | + **/ | |
| 36 | + public int offset; | |
| 37 | + | |
| 38 | + /** | |
| 39 | + * Length of the string we represent. | |
| 40 | + **/ | |
| 41 | + public int length; | |
| 42 | + | |
| 43 | + /** | |
| 44 | + * This string's FontDescriptor. | |
| 45 | + */ | |
| 46 | + public FontDescriptor fontDescriptor; | |
| 47 | + | |
| 48 | + /** | |
| 49 | + * Creates a new CharsetString | |
| 50 | + */ | |
| 51 | + public CharsetString(char charsetChars[], int offset, int length, | |
| 52 | + FontDescriptor fontDescriptor){ | |
| 53 | + | |
| 54 | + this.charsetChars = charsetChars; | |
| 55 | + this.offset = offset; | |
| 56 | + this.length = length; | |
| 57 | + this.fontDescriptor = fontDescriptor; | |
| 58 | + } | |
| 59 | +} | |
Binary file not shown.
| @@ -0,0 +1,96 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 2000, 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 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.awt.*; | |
| 29 | +import java.awt.dnd.*; | |
| 30 | +import java.awt.dnd.peer.DragSourceContextPeer; | |
| 31 | +import java.awt.peer.*; | |
| 32 | + | |
| 33 | +/** | |
| 34 | + * Interface for component creation support in toolkits | |
| 35 | + */ | |
| 36 | +public interface ComponentFactory { | |
| 37 | + | |
| 38 | + CanvasPeer createCanvas(Canvas target) throws HeadlessException; | |
| 39 | + | |
| 40 | + PanelPeer createPanel(Panel target) throws HeadlessException; | |
| 41 | + | |
| 42 | + WindowPeer createWindow(Window target) throws HeadlessException; | |
| 43 | + | |
| 44 | + FramePeer createFrame(Frame target) throws HeadlessException; | |
| 45 | + | |
| 46 | + DialogPeer createDialog(Dialog target) throws HeadlessException; | |
| 47 | + | |
| 48 | + ButtonPeer createButton(Button target) throws HeadlessException; | |
| 49 | + | |
| 50 | + TextFieldPeer createTextField(TextField target) | |
| 51 | + throws HeadlessException; | |
| 52 | + | |
| 53 | + ChoicePeer createChoice(Choice target) throws HeadlessException; | |
| 54 | + | |
| 55 | + LabelPeer createLabel(Label target) throws HeadlessException; | |
| 56 | + | |
| 57 | + ListPeer createList(List target) throws HeadlessException; | |
| 58 | + | |
| 59 | + CheckboxPeer createCheckbox(Checkbox target) | |
| 60 | + throws HeadlessException; | |
| 61 | + | |
| 62 | + ScrollbarPeer createScrollbar(Scrollbar target) | |
| 63 | + throws HeadlessException; | |
| 64 | + | |
| 65 | + ScrollPanePeer createScrollPane(ScrollPane target) | |
| 66 | + throws HeadlessException; | |
| 67 | + | |
| 68 | + TextAreaPeer createTextArea(TextArea target) | |
| 69 | + throws HeadlessException; | |
| 70 | + | |
| 71 | + FileDialogPeer createFileDialog(FileDialog target) | |
| 72 | + throws HeadlessException; | |
| 73 | + | |
| 74 | + MenuBarPeer createMenuBar(MenuBar target) throws HeadlessException; | |
| 75 | + | |
| 76 | + MenuPeer createMenu(Menu target) throws HeadlessException; | |
| 77 | + | |
| 78 | + PopupMenuPeer createPopupMenu(PopupMenu target) | |
| 79 | + throws HeadlessException; | |
| 80 | + | |
| 81 | + MenuItemPeer createMenuItem(MenuItem target) | |
| 82 | + throws HeadlessException; | |
| 83 | + | |
| 84 | + CheckboxMenuItemPeer createCheckboxMenuItem(CheckboxMenuItem target) | |
| 85 | + throws HeadlessException; | |
| 86 | + | |
| 87 | + DragSourceContextPeer createDragSourceContextPeer( | |
| 88 | + DragGestureEvent dge) | |
| 89 | + throws InvalidDnDOperationException, HeadlessException; | |
| 90 | + | |
| 91 | + FontPeer getFontPeer(String name, int style); | |
| 92 | + | |
| 93 | + RobotPeer createRobot(Robot target, GraphicsDevice screen) | |
| 94 | + throws AWTException, HeadlessException; | |
| 95 | + | |
| 96 | +} | |
Binary file not shown.
| @@ -0,0 +1,52 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1998, 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 | +package sun.awt; | |
| 27 | + | |
| 28 | +/** | |
| 29 | + * This interface can be implemented on a Graphics object to allow | |
| 30 | + * the lightweight component code to permanently install a rectangular | |
| 31 | + * maximum clip that cannot be extended with setClip and which works in | |
| 32 | + * conjunction with the hit() and getTransform() methods of Graphics2D | |
| 33 | + * to make it appear as if there really was a component with these | |
| 34 | + * dimensions. | |
| 35 | + */ | |
| 36 | +public interface ConstrainableGraphics { | |
| 37 | + /** | |
| 38 | + * Constrain this graphics object to have a permanent device space | |
| 39 | + * origin of (x, y) and a permanent maximum clip of (x,y,w,h). | |
| 40 | + * Calling this method is roughly equivalent to: | |
| 41 | + * g.translate(x, y); | |
| 42 | + * g.clipRect(0, 0, w, h); | |
| 43 | + * except that the clip can never be extended outside of these | |
| 44 | + * bounds, even with setClip() and for the fact that the (x,y) | |
| 45 | + * become a new device space coordinate origin. | |
| 46 | + * | |
| 47 | + * These methods are recursive so that you can further restrict | |
| 48 | + * the object by calling the constrain() method more times, but | |
| 49 | + * you can never enlarge its restricted maximum clip. | |
| 50 | + */ | |
| 51 | + public void constrain(int x, int y, int w, int h); | |
| 52 | +} | |
| @@ -0,0 +1,103 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1997, 1999, 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 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.awt.*; | |
| 29 | +import java.awt.image.*; | |
| 30 | + | |
| 31 | +/** | |
| 32 | + * A class to encapsulate a custom image-based cursor. | |
| 33 | + * | |
| 34 | + * @author ThomasBall | |
| 35 | + */ | |
| 36 | +public abstract class CustomCursor extends Cursor { | |
| 37 | + | |
| 38 | + protected Image image; | |
| 39 | + | |
| 40 | + public CustomCursor(Image cursor, Point hotSpot, String name) | |
| 41 | + throws IndexOutOfBoundsException { | |
| 42 | + super(name); | |
| 43 | + image = cursor; | |
| 44 | + Toolkit toolkit = Toolkit.getDefaultToolkit(); | |
| 45 | + | |
| 46 | + // Make sure image is fully loaded. | |
| 47 | + Component c = new Canvas(); // for its imageUpdate method | |
| 48 | + MediaTracker tracker = new MediaTracker(c); | |
| 49 | + tracker.addImage(cursor, 0); | |
| 50 | + try { | |
| 51 | + tracker.waitForAll(); | |
| 52 | + } catch (InterruptedException e) { | |
| 53 | + } | |
| 54 | + int width = cursor.getWidth(c); | |
| 55 | + int height = cursor.getHeight(c); | |
| 56 | + | |
| 57 | + // Fix for bug 4212593 The Toolkit.createCustomCursor does not | |
| 58 | + // check absence of the image of cursor | |
| 59 | + // If the image is invalid, the cursor will be hidden (made completely | |
| 60 | + // transparent). In this case, getBestCursorSize() will adjust negative w and h, | |
| 61 | + // but we need to set the hotspot inside the image here. | |
| 62 | + if (tracker.isErrorAny() || width < 0 || height < 0) { | |
| 63 | + hotSpot.x = hotSpot.y = 0; | |
| 64 | + } | |
| 65 | + | |
| 66 | + // Scale image to nearest supported size. | |
| 67 | + Dimension nativeSize = toolkit.getBestCursorSize(width, height); | |
| 68 | + if (nativeSize.width != width || nativeSize.height != height) { | |
| 69 | + cursor = cursor.getScaledInstance(nativeSize.width, | |
| 70 | + nativeSize.height, | |
| 71 | + Image.SCALE_DEFAULT); | |
| 72 | + width = nativeSize.width; | |
| 73 | + height = nativeSize.height; | |
| 74 | + } | |
| 75 | + | |
| 76 | + // Verify that the hotspot is within cursor bounds. | |
| 77 | + if (hotSpot.x >= width || hotSpot.y >= height || hotSpot.x < 0 || hotSpot.y < 0) { | |
| 78 | + throw new IndexOutOfBoundsException("invalid hotSpot"); | |
| 79 | + } | |
| 80 | + | |
| 81 | + /* Extract ARGB array from image. | |
| 82 | + * | |
| 83 | + * A transparency mask can be created in native code by checking | |
| 84 | + * each pixel's top byte -- a 0 value means the pixel's transparent. | |
| 85 | + * Since each platform's format of the bitmap and mask are likely to | |
| 86 | + * be different, their creation shouldn't be here. | |
| 87 | + */ | |
| 88 | + int[] pixels = new int[width * height]; | |
| 89 | + ImageProducer ip = cursor.getSource(); | |
| 90 | + PixelGrabber pg = new PixelGrabber(ip, 0, 0, width, height, | |
| 91 | + pixels, 0, width); | |
| 92 | + try { | |
| 93 | + pg.grabPixels(); | |
| 94 | + } catch (InterruptedException e) { | |
| 95 | + } | |
| 96 | + | |
| 97 | + createNativeCursor(image, pixels, width, height, hotSpot.x, hotSpot.y); | |
| 98 | + } | |
| 99 | + | |
| 100 | + protected abstract void createNativeCursor(Image im, int[] pixels, | |
| 101 | + int width, int height, | |
| 102 | + int xHotSpot, int yHotSpot); | |
| 103 | +} | |
Binary file not shown.
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1,324 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1999, 2003, 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 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.io.*; | |
| 29 | + | |
| 30 | +import java.util.*; | |
| 31 | +import sun.util.logging.PlatformLogger; | |
| 32 | + | |
| 33 | +/* | |
| 34 | + * Internal class that manages sun.awt.Debug settings. | |
| 35 | + * Settings can be specified on a global, per-package, | |
| 36 | + * or per-class level. | |
| 37 | + * | |
| 38 | + * Properties affecting the behaviour of the Debug class are | |
| 39 | + * loaded from the awtdebug.properties file at class load | |
| 40 | + * time. The properties file is assumed to be in the | |
| 41 | + * user.home directory. A different file can be used | |
| 42 | + * by setting the awtdebug.properties system property. | |
| 43 | + * e.g. java -Dawtdebug.properties=foo.properties | |
| 44 | + * | |
| 45 | + * Only properties beginning with 'awtdebug' have any | |
| 46 | + * meaning-- all other properties are ignored. | |
| 47 | + * | |
| 48 | + * You can override the properties file by specifying | |
| 49 | + * 'awtdebug' props as system properties on the command line. | |
| 50 | + * e.g. java -Dawtdebug.trace=true | |
| 51 | + * Properties specific to a package or a class can be set | |
| 52 | + * by qualifying the property names as follows: | |
| 53 | + * awtdebug.<property name>.<class or package name> | |
| 54 | + * So for example, turning on tracing in the com.acme.Fubar | |
| 55 | + * class would be done as follows: | |
| 56 | + * awtdebug.trace.com.acme.Fubar=true | |
| 57 | + * | |
| 58 | + * Class settings always override package settings, which in | |
| 59 | + * turn override global settings. | |
| 60 | + * | |
| 61 | + * Addition from July, 2007. | |
| 62 | + * | |
| 63 | + * After the fix for 4638447 all the usage of DebugHelper | |
| 64 | + * classes in Java code are replaced with the corresponding | |
| 65 | + * Java Logging API calls. This file is now used only to | |
| 66 | + * control native logging. | |
| 67 | + * | |
| 68 | + * To enable native logging you should set the following | |
| 69 | + * system property to 'true': sun.awt.nativedebug. After | |
| 70 | + * the native logging is enabled, the actual debug settings | |
| 71 | + * are read the same way as described above (as before | |
| 72 | + * the fix for 4638447). | |
| 73 | + */ | |
| 74 | +final class DebugSettings { | |
| 75 | + private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.debug.DebugSettings"); | |
| 76 | + | |
| 77 | + /* standard debug property key names */ | |
| 78 | + static final String PREFIX = "awtdebug"; | |
| 79 | + static final String PROP_FILE = "properties"; | |
| 80 | + | |
| 81 | + /* default property settings */ | |
| 82 | + private static final String DEFAULT_PROPS[] = { | |
| 83 | + "awtdebug.assert=true", | |
| 84 | + "awtdebug.trace=false", | |
| 85 | + "awtdebug.on=true", | |
| 86 | + "awtdebug.ctrace=false" | |
| 87 | + }; | |
| 88 | + | |
| 89 | + /* global instance of the settings object */ | |
| 90 | + private static DebugSettings instance = null; | |
| 91 | + | |
| 92 | + private Properties props = new Properties(); | |
| 93 | + | |
| 94 | + static void init() { | |
| 95 | + if (instance != null) { | |
| 96 | + return; | |
| 97 | + } | |
| 98 | + | |
| 99 | + NativeLibLoader.loadLibraries(); | |
| 100 | + instance = new DebugSettings(); | |
| 101 | + instance.loadNativeSettings(); | |
| 102 | + } | |
| 103 | + | |
| 104 | + private DebugSettings() { | |
| 105 | + new java.security.PrivilegedAction() { | |
| 106 | + public Object run() { | |
| 107 | + loadProperties(); | |
| 108 | + return null; | |
| 109 | + } | |
| 110 | + }.run(); | |
| 111 | + } | |
| 112 | + | |
| 113 | + /* | |
| 114 | + * Load debug properties from file, then override | |
| 115 | + * with any command line specified properties | |
| 116 | + */ | |
| 117 | + private synchronized void loadProperties() { | |
| 118 | + // setup initial properties | |
| 119 | + java.security.AccessController.doPrivileged( | |
| 120 | + new java.security.PrivilegedAction() | |
| 121 | + { | |
| 122 | + public Object run() { | |
| 123 | + loadDefaultProperties(); | |
| 124 | + loadFileProperties(); | |
| 125 | + loadSystemProperties(); | |
| 126 | + return null; | |
| 127 | + } | |
| 128 | + }); | |
| 129 | + | |
| 130 | + // echo the initial property settings to stdout | |
| 131 | + if (log.isLoggable(PlatformLogger.FINE)) { | |
| 132 | + log.fine("DebugSettings:\n{0}" + this); | |
| 133 | + } | |
| 134 | + } | |
| 135 | + | |
| 136 | + public String toString() { | |
| 137 | + Enumeration enum_ = props.propertyNames(); | |
| 138 | + ByteArrayOutputStream bout = new ByteArrayOutputStream(); | |
| 139 | + PrintStream pout = new PrintStream(bout); | |
| 140 | + | |
| 141 | + while (enum_.hasMoreElements()) { | |
| 142 | + String key = (String)enum_.nextElement(); | |
| 143 | + String value = props.getProperty(key, ""); | |
| 144 | + pout.println(key + " = " + value); | |
| 145 | + } | |
| 146 | + return new String(bout.toByteArray()); | |
| 147 | + } | |
| 148 | + | |
| 149 | + /* | |
| 150 | + * Sets up default property values | |
| 151 | + */ | |
| 152 | + private void loadDefaultProperties() { | |
| 153 | + // is there a more inefficient way to setup default properties? | |
| 154 | + // maybe, but this has got to be close to 100% non-optimal | |
| 155 | + try { | |
| 156 | + for ( int nprop = 0; nprop < DEFAULT_PROPS.length; nprop++ ) { | |
| 157 | + StringBufferInputStream in = new StringBufferInputStream(DEFAULT_PROPS[nprop]); | |
| 158 | + props.load(in); | |
| 159 | + in.close(); | |
| 160 | + } | |
| 161 | + } catch(IOException ioe) { | |
| 162 | + } | |
| 163 | + } | |
| 164 | + | |
| 165 | + /* | |
| 166 | + * load properties from file, overriding defaults | |
| 167 | + */ | |
| 168 | + private void loadFileProperties() { | |
| 169 | + String propPath; | |
| 170 | + Properties fileProps; | |
| 171 | + | |
| 172 | + // check if the user specified a particular settings file | |
| 173 | + propPath = System.getProperty(PREFIX + "." + PROP_FILE, ""); | |
| 174 | + if (propPath.equals("")) { | |
| 175 | + // otherwise get it from the user's home directory | |
| 176 | + propPath = System.getProperty("user.home", "") + | |
| 177 | + File.separator + | |
| 178 | + PREFIX + "." + PROP_FILE; | |
| 179 | + } | |
| 180 | + | |
| 181 | + File propFile = new File(propPath); | |
| 182 | + try { | |
| 183 | + println("Reading debug settings from '" + propFile.getCanonicalPath() + "'..."); | |
| 184 | + FileInputStream fin = new FileInputStream(propFile); | |
| 185 | + props.load(fin); | |
| 186 | + fin.close(); | |
| 187 | + } catch ( FileNotFoundException fne ) { | |
| 188 | + println("Did not find settings file."); | |
| 189 | + } catch ( IOException ioe ) { | |
| 190 | + println("Problem reading settings, IOException: " + ioe.getMessage()); | |
| 191 | + } | |
| 192 | + } | |
| 193 | + | |
| 194 | + /* | |
| 195 | + * load properties from system props (command line spec'd usually), | |
| 196 | + * overriding default or file properties | |
| 197 | + */ | |
| 198 | + private void loadSystemProperties() { | |
| 199 | + // override file properties with system properties | |
| 200 | + Properties sysProps = System.getProperties(); | |
| 201 | + Enumeration enum_ = sysProps.propertyNames(); | |
| 202 | + while ( enum_.hasMoreElements() ) { | |
| 203 | + String key = (String)enum_.nextElement(); | |
| 204 | + String value = sysProps.getProperty(key,""); | |
| 205 | + // copy any "awtdebug" properties over | |
| 206 | + if ( key.startsWith(PREFIX) ) { | |
| 207 | + props.setProperty(key, value); | |
| 208 | + } | |
| 209 | + } | |
| 210 | + } | |
| 211 | + | |
| 212 | + /** | |
| 213 | + * Gets named boolean property | |
| 214 | + * @param key Name of property | |
| 215 | + * @param defval Default value if property does not exist | |
| 216 | + * @return boolean value of the named property | |
| 217 | + */ | |
| 218 | + public synchronized boolean getBoolean(String key, boolean defval) { | |
| 219 | + String value = getString(key, String.valueOf(defval)); | |
| 220 | + return value.equalsIgnoreCase("true"); | |
| 221 | + } | |
| 222 | + | |
| 223 | + /** | |
| 224 | + * Gets named integer property | |
| 225 | + * @param key Name of property | |
| 226 | + * @param defval Default value if property does not exist | |
| 227 | + * @return integer value of the named property | |
| 228 | + */ | |
| 229 | + public synchronized int getInt(String key, int defval) { | |
| 230 | + String value = getString(key, String.valueOf(defval)); | |
| 231 | + return Integer.parseInt(value); | |
| 232 | + } | |
| 233 | + | |
| 234 | + /** | |
| 235 | + * Gets named String property | |
| 236 | + * @param key Name of property | |
| 237 | + * @param defval Default value if property does not exist | |
| 238 | + * @return string value of the named property | |
| 239 | + */ | |
| 240 | + public synchronized String getString(String key, String defval) { | |
| 241 | + String actualKeyName = PREFIX + "." + key; | |
| 242 | + String value = props.getProperty(actualKeyName, defval); | |
| 243 | + //println(actualKeyName+"="+value); | |
| 244 | + return value; | |
| 245 | + } | |
| 246 | + | |
| 247 | + public synchronized Enumeration getPropertyNames() { | |
| 248 | + Vector propNames = new Vector(); | |
| 249 | + Enumeration enum_ = props.propertyNames(); | |
| 250 | + | |
| 251 | + // remove global prefix from property names | |
| 252 | + while ( enum_.hasMoreElements() ) { | |
| 253 | + String propName = (String)enum_.nextElement(); | |
| 254 | + propName = propName.substring(PREFIX.length()+1); | |
| 255 | + propNames.addElement(propName); | |
| 256 | + } | |
| 257 | + return propNames.elements(); | |
| 258 | + } | |
| 259 | + | |
| 260 | + private void println(Object object) { | |
| 261 | + if (log.isLoggable(PlatformLogger.FINER)) { | |
| 262 | + log.finer(object.toString()); | |
| 263 | + } | |
| 264 | + } | |
| 265 | + | |
| 266 | + private static final String PROP_CTRACE = "ctrace"; | |
| 267 | + private static final int PROP_CTRACE_LEN = PROP_CTRACE.length(); | |
| 268 | + | |
| 269 | + private native synchronized void setCTracingOn(boolean enabled); | |
| 270 | + private native synchronized void setCTracingOn(boolean enabled, String file); | |
| 271 | + private native synchronized void setCTracingOn(boolean enabled, String file, int line); | |
| 272 | + | |
| 273 | + private void loadNativeSettings() { | |
| 274 | + boolean ctracingOn; | |
| 275 | + | |
| 276 | + ctracingOn = getBoolean(PROP_CTRACE, false); | |
| 277 | + setCTracingOn(ctracingOn); | |
| 278 | + | |
| 279 | + // | |
| 280 | + // Filter out file/line ctrace properties from debug settings | |
| 281 | + // | |
| 282 | + Vector traces = new Vector(); | |
| 283 | + Enumeration enum_ = getPropertyNames(); | |
| 284 | + | |
| 285 | + while ( enum_.hasMoreElements() ) { | |
| 286 | + String key = (String)enum_.nextElement(); | |
| 287 | + if ( key.startsWith(PROP_CTRACE) && key.length() > PROP_CTRACE_LEN ) { | |
| 288 | + traces.addElement(key); | |
| 289 | + } | |
| 290 | + } | |
| 291 | + | |
| 292 | + // sort traces list so file-level traces will be before line-level ones | |
| 293 | + Collections.sort(traces); | |
| 294 | + | |
| 295 | + // | |
| 296 | + // Setup the trace points | |
| 297 | + // | |
| 298 | + Enumeration enumTraces = traces.elements(); | |
| 299 | + | |
| 300 | + while ( enumTraces.hasMoreElements() ) { | |
| 301 | + String key = (String)enumTraces.nextElement(); | |
| 302 | + String trace = key.substring(PROP_CTRACE_LEN+1); | |
| 303 | + String filespec; | |
| 304 | + String linespec; | |
| 305 | + int delim= trace.indexOf('@'); | |
| 306 | + boolean enabled; | |
| 307 | + | |
| 308 | + // parse out the filename and linenumber from the property name | |
| 309 | + filespec = delim != -1 ? trace.substring(0, delim) : trace; | |
| 310 | + linespec = delim != -1 ? trace.substring(delim+1) : ""; | |
| 311 | + enabled = getBoolean(key, false); | |
| 312 | + //System.out.println("Key="+key+", File="+filespec+", Line="+linespec+", Enabled="+enabled); | |
| 313 | + | |
| 314 | + if ( linespec.length() == 0 ) { | |
| 315 | + // set file specific trace setting | |
| 316 | + setCTracingOn(enabled, filespec); | |
| 317 | + } else { | |
| 318 | + // set line specific trace setting | |
| 319 | + int linenum = Integer.parseInt(linespec, 10); | |
| 320 | + setCTracingOn(enabled, filespec, linenum); | |
| 321 | + } | |
| 322 | + } | |
| 323 | + } | |
| 324 | +} | |
Binary file not shown.
| @@ -0,0 +1,44 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 2003, 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 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.awt.Point; | |
| 29 | +import java.awt.Window; | |
| 30 | +import java.awt.peer.MouseInfoPeer; | |
| 31 | + | |
| 32 | +public class DefaultMouseInfoPeer implements MouseInfoPeer { | |
| 33 | + | |
| 34 | + /** | |
| 35 | + * Package-private constructor to prevent instantiation. | |
| 36 | + */ | |
| 37 | + DefaultMouseInfoPeer() { | |
| 38 | + } | |
| 39 | + | |
| 40 | + public native int fillPointWithCoords(Point point); | |
| 41 | + | |
| 42 | + public native boolean isWindowUnderMouse(Window w); | |
| 43 | + | |
| 44 | +} | |
Binary file not shown.
| @@ -0,0 +1,46 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 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 | + */ | |
| 25 | + | |
| 26 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.net.URL; | |
| 29 | + | |
| 30 | +public abstract class DesktopBrowse { | |
| 31 | + private static volatile DesktopBrowse mInstance; | |
| 32 | + | |
| 33 | + public static void setInstance(DesktopBrowse instance) { | |
| 34 | + if (mInstance != null) { | |
| 35 | + throw new IllegalStateException("DesktopBrowse instance has already been set."); | |
| 36 | + } | |
| 37 | + mInstance = instance; | |
| 38 | + } | |
| 39 | + | |
| 40 | + public static DesktopBrowse getInstance() { | |
| 41 | + return mInstance; | |
| 42 | + } | |
| 43 | + | |
| 44 | + | |
| 45 | + public abstract void browse(URL url); | |
| 46 | +} | |
Binary file not shown.
| @@ -0,0 +1,63 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 2000, 2001, 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 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.util.EventListener; | |
| 29 | + | |
| 30 | +/** | |
| 31 | + * The listener interface for receiving display change events. | |
| 32 | + * The class that is interested in processing a display change event | |
| 33 | + * implements this interface (and all the methods it | |
| 34 | + * contains). | |
| 35 | + * | |
| 36 | + * For Motif, this interface is only used for dragging windows between Xinerama | |
| 37 | + * screens. | |
| 38 | + * | |
| 39 | + * For win32, the listener object created from that class is then registered | |
| 40 | + * with the WToolkit object using its <code>addDisplayChangeListener</code> | |
| 41 | + * method. When the display resolution is changed (which occurs, | |
| 42 | + * in Windows, either by the user changing the properties of the | |
| 43 | + * display through the control panel or other utility or by | |
| 44 | + * some other application which has gotten fullscreen-exclusive | |
| 45 | + * control of the display), the listener is notified through its | |
| 46 | + * displayChanged() or paletteChanged() methods. | |
| 47 | + * | |
| 48 | + * @author Chet Haase | |
| 49 | + * @author Brent Christian | |
| 50 | + * @since 1.4 | |
| 51 | + */ | |
| 52 | +public interface DisplayChangedListener extends EventListener { | |
| 53 | + /** | |
| 54 | + * Invoked when the display mode has changed. | |
| 55 | + */ | |
| 56 | + public void displayChanged(); | |
| 57 | + | |
| 58 | + /** | |
| 59 | + * Invoked when the palette has changed. | |
| 60 | + */ | |
| 61 | + public void paletteChanged(); | |
| 62 | + | |
| 63 | +} | |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1,639 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1996, 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 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.awt.*; | |
| 29 | +import java.awt.event.*; | |
| 30 | +import java.awt.image.*; | |
| 31 | +import java.awt.peer.*; | |
| 32 | +import java.security.AccessController; | |
| 33 | +import java.security.PrivilegedAction; | |
| 34 | +import java.lang.reflect.Constructor; | |
| 35 | +import java.lang.reflect.InvocationTargetException; | |
| 36 | +import java.lang.reflect.Modifier; | |
| 37 | +import java.lang.reflect.Field; | |
| 38 | +import java.beans.PropertyChangeListener; | |
| 39 | +import java.beans.PropertyChangeEvent; | |
| 40 | +import java.util.Set; | |
| 41 | +import java.awt.AWTKeyStroke; | |
| 42 | +import java.applet.Applet; | |
| 43 | +import sun.applet.AppletPanel; | |
| 44 | + | |
| 45 | +/** | |
| 46 | + * A generic container used for embedding Java components, usually applets. | |
| 47 | + * An EmbeddedFrame has two related uses: | |
| 48 | + * | |
| 49 | + * . Within a Java-based application, an EmbeddedFrame serves as a sort of | |
| 50 | + * firewall, preventing the contained components or applets from using | |
| 51 | + * getParent() to find parent components, such as menubars. | |
| 52 | + * | |
| 53 | + * . Within a C-based application, an EmbeddedFrame contains a window handle | |
| 54 | + * which was created by the application, which serves as the top-level | |
| 55 | + * Java window. EmbeddedFrames created for this purpose are passed-in a | |
| 56 | + * handle of an existing window created by the application. The window | |
| 57 | + * handle should be of the appropriate native type for a specific | |
| 58 | + * platform, as stored in the pData field of the ComponentPeer. | |
| 59 | + * | |
| 60 | + * @author Thomas Ball | |
| 61 | + */ | |
| 62 | +public abstract class EmbeddedFrame extends Frame | |
| 63 | + implements KeyEventDispatcher, PropertyChangeListener { | |
| 64 | + | |
| 65 | + private boolean isCursorAllowed = true; | |
| 66 | + private static Field fieldPeer; | |
| 67 | + private static Field currentCycleRoot; | |
| 68 | + private boolean supportsXEmbed = false; | |
| 69 | + private KeyboardFocusManager appletKFM; | |
| 70 | + // JDK 1.1 compatibility | |
| 71 | + private static final long serialVersionUID = 2967042741780317130L; | |
| 72 | + | |
| 73 | + /* | |
| 74 | + * The constants define focus traversal directions. | |
| 75 | + * Use them in {@code traverseIn}, {@code traverseOut} methods. | |
| 76 | + */ | |
| 77 | + protected static final boolean FORWARD = true; | |
| 78 | + protected static final boolean BACKWARD = false; | |
| 79 | + | |
| 80 | + public boolean supportsXEmbed() { | |
| 81 | + return supportsXEmbed && SunToolkit.needsXEmbed(); | |
| 82 | + } | |
| 83 | + | |
| 84 | + protected EmbeddedFrame(boolean supportsXEmbed) { | |
| 85 | + this((long)0, supportsXEmbed); | |
| 86 | + } | |
| 87 | + | |
| 88 | + | |
| 89 | + protected EmbeddedFrame() { | |
| 90 | + this((long)0); | |
| 91 | + } | |
| 92 | + | |
| 93 | + /** | |
| 94 | + * @deprecated This constructor will be removed in 1.5 | |
| 95 | + */ | |
| 96 | + @Deprecated | |
| 97 | + protected EmbeddedFrame(int handle) { | |
| 98 | + this((long)handle); | |
| 99 | + } | |
| 100 | + | |
| 101 | + protected EmbeddedFrame(long handle) { | |
| 102 | + this(handle, false); | |
| 103 | + } | |
| 104 | + | |
| 105 | + protected EmbeddedFrame(long handle, boolean supportsXEmbed) { | |
| 106 | + this.supportsXEmbed = supportsXEmbed; | |
| 107 | + registerListeners(); | |
| 108 | + } | |
| 109 | + | |
| 110 | + /** | |
| 111 | + * Block introspection of a parent window by this child. | |
| 112 | + */ | |
| 113 | + public Container getParent() { | |
| 114 | + return null; | |
| 115 | + } | |
| 116 | + | |
| 117 | + /** | |
| 118 | + * Needed to track which KeyboardFocusManager is current. We want to avoid memory | |
| 119 | + * leaks, so when KFM stops being current, we remove ourselves as listeners. | |
| 120 | + */ | |
| 121 | + public void propertyChange(PropertyChangeEvent evt) { | |
| 122 | + // We don't handle any other properties. Skip it. | |
| 123 | + if (!evt.getPropertyName().equals("managingFocus")) { | |
| 124 | + return; | |
| 125 | + } | |
| 126 | + | |
| 127 | + // We only do it if it stops being current. Technically, we should | |
| 128 | + // never get an event about KFM starting being current. | |
| 129 | + if (evt.getNewValue() == Boolean.TRUE) { | |
| 130 | + return; | |
| 131 | + } | |
| 132 | + | |
| 133 | + // should be the same as appletKFM | |
| 134 | + removeTraversingOutListeners((KeyboardFocusManager)evt.getSource()); | |
| 135 | + | |
| 136 | + appletKFM = KeyboardFocusManager.getCurrentKeyboardFocusManager(); | |
| 137 | + if (isVisible()) { | |
| 138 | + addTraversingOutListeners(appletKFM); | |
| 139 | + } | |
| 140 | + } | |
| 141 | + | |
| 142 | + /** | |
| 143 | + * Register us as KeyEventDispatcher and property "managingFocus" listeners. | |
| 144 | + */ | |
| 145 | + private void addTraversingOutListeners(KeyboardFocusManager kfm) { | |
| 146 | + kfm.addKeyEventDispatcher(this); | |
| 147 | + kfm.addPropertyChangeListener("managingFocus", this); | |
| 148 | + } | |
| 149 | + | |
| 150 | + /** | |
| 151 | + * Deregister us as KeyEventDispatcher and property "managingFocus" listeners. | |
| 152 | + */ | |
| 153 | + private void removeTraversingOutListeners(KeyboardFocusManager kfm) { | |
| 154 | + kfm.removeKeyEventDispatcher(this); | |
| 155 | + kfm.removePropertyChangeListener("managingFocus", this); | |
| 156 | + } | |
| 157 | + | |
| 158 | + /** | |
| 159 | + * Because there may be many AppContexts, and we can't be sure where this | |
| 160 | + * EmbeddedFrame is first created or shown, we can't automatically determine | |
| 161 | + * the correct KeyboardFocusManager to attach to as KeyEventDispatcher. | |
| 162 | + * Those who want to use the functionality of traversing out of the EmbeddedFrame | |
| 163 | + * must call this method on the Applet's AppContext. After that, all the changes | |
| 164 | + * can be handled automatically, including possible replacement of | |
| 165 | + * KeyboardFocusManager. | |
| 166 | + */ | |
| 167 | + public void registerListeners() { | |
| 168 | + if (appletKFM != null) { | |
| 169 | + removeTraversingOutListeners(appletKFM); | |
| 170 | + } | |
| 171 | + appletKFM = KeyboardFocusManager.getCurrentKeyboardFocusManager(); | |
| 172 | + if (isVisible()) { | |
| 173 | + addTraversingOutListeners(appletKFM); | |
| 174 | + } | |
| 175 | + } | |
| 176 | + | |
| 177 | + /** | |
| 178 | + * Needed to avoid memory leak: we register this EmbeddedFrame as a listener with | |
| 179 | + * KeyboardFocusManager of applet's AppContext. We don't want the KFM to keep | |
| 180 | + * reference to our EmbeddedFrame forever if the Frame is no longer in use, so we | |
| 181 | + * add listeners in show() and remove them in hide(). | |
| 182 | + */ | |
| 183 | + public void show() { | |
| 184 | + if (appletKFM != null) { | |
| 185 | + addTraversingOutListeners(appletKFM); | |
| 186 | + } | |
| 187 | + super.show(); | |
| 188 | + } | |
| 189 | + | |
| 190 | + /** | |
| 191 | + * Needed to avoid memory leak: we register this EmbeddedFrame as a listener with | |
| 192 | + * KeyboardFocusManager of applet's AppContext. We don't want the KFM to keep | |
| 193 | + * reference to our EmbeddedFrame forever if the Frame is no longer in use, so we | |
| 194 | + * add listeners in show() and remove them in hide(). | |
| 195 | + */ | |
| 196 | + public void hide() { | |
| 197 | + if (appletKFM != null) { | |
| 198 | + removeTraversingOutListeners(appletKFM); | |
| 199 | + } | |
| 200 | + super.hide(); | |
| 201 | + } | |
| 202 | + | |
| 203 | + /** | |
| 204 | + * Need this method to detect when the focus may have chance to leave the | |
| 205 | + * focus cycle root which is EmbeddedFrame. Mostly, the code here is copied | |
| 206 | + * from DefaultKeyboardFocusManager.processKeyEvent with some minor | |
| 207 | + * modifications. | |
| 208 | + */ | |
| 209 | + public boolean dispatchKeyEvent(KeyEvent e) { | |
| 210 | + | |
| 211 | + // We can't guarantee that this is called on the same AppContext as EmbeddedFrame | |
| 212 | + // belongs to. That's why we can't use public methods to find current focus cycle | |
| 213 | + // root. Instead, we access KFM's private field directly. | |
| 214 | + if (currentCycleRoot == null) { | |
| 215 | + currentCycleRoot = (Field)AccessController.doPrivileged(new PrivilegedAction() { | |
| 216 | + public Object run() { | |
| 217 | + try { | |
| 218 | + Field unaccessibleRoot = KeyboardFocusManager.class. | |
| 219 | + getDeclaredField("currentFocusCycleRoot"); | |
| 220 | + if (unaccessibleRoot != null) { | |
| 221 | + unaccessibleRoot.setAccessible(true); | |
| 222 | + } | |
| 223 | + return unaccessibleRoot; | |
| 224 | + } catch (NoSuchFieldException e1) { | |
| 225 | + assert false; | |
| 226 | + } catch (SecurityException e2) { | |
| 227 | + assert false; | |
| 228 | + } | |
| 229 | + return null; | |
| 230 | + } | |
| 231 | + }); | |
| 232 | + } | |
| 233 | + | |
| 234 | + Container currentRoot = null; | |
| 235 | + if (currentCycleRoot != null) { | |
| 236 | + try { | |
| 237 | + // The field is static, so we can pass null to Field.get() as the argument. | |
| 238 | + currentRoot = (Container)currentCycleRoot.get(null); | |
| 239 | + } catch (IllegalAccessException e3) { | |
| 240 | + // This is impossible: currentCycleRoot would be null if setAccessible failed. | |
| 241 | + assert false; | |
| 242 | + } | |
| 243 | + } | |
| 244 | + | |
| 245 | + // if we are not in EmbeddedFrame's cycle, we should not try to leave. | |
| 246 | + if (this != currentRoot) { | |
| 247 | + return false; | |
| 248 | + } | |
| 249 | + | |
| 250 | + // KEY_TYPED events cannot be focus traversal keys | |
| 251 | + if (e.getID() == KeyEvent.KEY_TYPED) { | |
| 252 | + return false; | |
| 253 | + } | |
| 254 | + | |
| 255 | + if (!getFocusTraversalKeysEnabled() || e.isConsumed()) { | |
| 256 | + return false; | |
| 257 | + } | |
| 258 | + | |
| 259 | + AWTKeyStroke stroke = AWTKeyStroke.getAWTKeyStrokeForEvent(e); | |
| 260 | + Set toTest; | |
| 261 | + Component currentFocused = e.getComponent(); | |
| 262 | + | |
| 263 | + toTest = getFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS); | |
| 264 | + if (toTest.contains(stroke)) { | |
| 265 | + // 6581899: performance improvement for SortingFocusTraversalPolicy | |
| 266 | + Component last = getFocusTraversalPolicy().getLastComponent(this); | |
| 267 | + if (currentFocused == last || last == null) { | |
| 268 | + if (traverseOut(FORWARD)) { | |
| 269 | + e.consume(); | |
| 270 | + return true; | |
| 271 | + } | |
| 272 | + } | |
| 273 | + } | |
| 274 | + | |
| 275 | + toTest = getFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS); | |
| 276 | + if (toTest.contains(stroke)) { | |
| 277 | + // 6581899: performance improvement for SortingFocusTraversalPolicy | |
| 278 | + Component first = getFocusTraversalPolicy().getFirstComponent(this); | |
| 279 | + if (currentFocused == first || first == null) { | |
| 280 | + if (traverseOut(BACKWARD)) { | |
| 281 | + e.consume(); | |
| 282 | + return true; | |
| 283 | + } | |
| 284 | + } | |
| 285 | + } | |
| 286 | + return false; | |
| 287 | + } | |
| 288 | + | |
| 289 | + /** | |
| 290 | + * This method is called by the embedder when we should receive focus as element | |
| 291 | + * of the traversal chain. The method requests focus on: | |
| 292 | + * 1. the first Component of this EmbeddedFrame if user moves focus forward | |
| 293 | + * in the focus traversal cycle. | |
| 294 | + * 2. the last Component of this EmbeddedFrame if user moves focus backward | |
| 295 | + * in the focus traversal cycle. | |
| 296 | + * | |
| 297 | + * The direction parameter specifies which of the two mentioned cases is | |
| 298 | + * happening. Use FORWARD and BACKWARD constants defined in the EmbeddedFrame class | |
| 299 | + * to avoid confusing boolean values. | |
| 300 | + * | |
| 301 | + * A concrete implementation of this method is defined in the platform-dependent | |
| 302 | + * subclasses. | |
| 303 | + * | |
| 304 | + * @param direction FORWARD or BACKWARD | |
| 305 | + * @return true, if the EmbeddedFrame wants to get focus, false otherwise. | |
| 306 | + */ | |
| 307 | + public boolean traverseIn(boolean direction) { | |
| 308 | + Component comp = null; | |
| 309 | + | |
| 310 | + if (direction == FORWARD) { | |
| 311 | + comp = getFocusTraversalPolicy().getFirstComponent(this); | |
| 312 | + } else { | |
| 313 | + comp = getFocusTraversalPolicy().getLastComponent(this); | |
| 314 | + } | |
| 315 | + if (comp != null) { | |
| 316 | + // comp.requestFocus(); - Leads to a hung. | |
| 317 | + | |
| 318 | + AWTAccessor.getKeyboardFocusManagerAccessor().setMostRecentFocusOwner(this, comp); | |
| 319 | + synthesizeWindowActivation(true); | |
| 320 | + } | |
| 321 | + return (null != comp); | |
| 322 | + } | |
| 323 | + | |
| 324 | + /** | |
| 325 | + * This method is called from dispatchKeyEvent in the following two cases: | |
| 326 | + * 1. The focus is on the first Component of this EmbeddedFrame and we are | |
| 327 | + * about to transfer the focus backward. | |
| 328 | + * 2. The focus in on the last Component of this EmbeddedFrame and we are | |
| 329 | + * about to transfer the focus forward. | |
| 330 | + * This is needed to give the opportuity for keyboard focus to leave the | |
| 331 | + * EmbeddedFrame. Override this method, initiate focus transfer in it and | |
| 332 | + * return true if you want the focus to leave EmbeddedFrame's cycle. | |
| 333 | + * The direction parameter specifies which of the two mentioned cases is | |
| 334 | + * happening. Use FORWARD and BACKWARD constants defined in EmbeddedFrame | |
| 335 | + * to avoid confusing boolean values. | |
| 336 | + * | |
| 337 | + * @param direction FORWARD or BACKWARD | |
| 338 | + * @return true, if EmbeddedFrame wants the focus to leave it, | |
| 339 | + * false otherwise. | |
| 340 | + */ | |
| 341 | + protected boolean traverseOut(boolean direction) { | |
| 342 | + return false; | |
| 343 | + } | |
| 344 | + | |
| 345 | + /** | |
| 346 | + * Block modifying any frame attributes, since they aren't applicable | |
| 347 | + * for EmbeddedFrames. | |
| 348 | + */ | |
| 349 | + public void setTitle(String title) {} | |
| 350 | + public void setIconImage(Image image) {} | |
| 351 | + public void setIconImages(java.util.List<? extends Image> icons) {} | |
| 352 | + public void setMenuBar(MenuBar mb) {} | |
| 353 | + public void setResizable(boolean resizable) {} | |
| 354 | + public void remove(MenuComponent m) {} | |
| 355 | + | |
| 356 | + public boolean isResizable() { | |
| 357 | + return true; | |
| 358 | + } | |
| 359 | + | |
| 360 | + public void addNotify() { | |
| 361 | + synchronized (getTreeLock()) { | |
| 362 | + if (getPeer() == null) { | |
| 363 | + setPeer(new NullEmbeddedFramePeer()); | |
| 364 | + } | |
| 365 | + super.addNotify(); | |
| 366 | + } | |
| 367 | + } | |
| 368 | + | |
| 369 | + // These three functions consitute RFE 4100710. Do not remove. | |
| 370 | + public void setCursorAllowed(boolean isCursorAllowed) { | |
| 371 | + this.isCursorAllowed = isCursorAllowed; | |
| 372 | + getPeer().updateCursorImmediately(); | |
| 373 | + } | |
| 374 | + public boolean isCursorAllowed() { | |
| 375 | + return isCursorAllowed; | |
| 376 | + } | |
| 377 | + public Cursor getCursor() { | |
| 378 | + return (isCursorAllowed) | |
| 379 | + ? super.getCursor() | |
| 380 | + : Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR); | |
| 381 | + } | |
| 382 | + | |
| 383 | + protected void setPeer(final ComponentPeer p){ | |
| 384 | + if (fieldPeer == null) { | |
| 385 | + fieldPeer = (Field)AccessController.doPrivileged(new PrivilegedAction() { | |
| 386 | + public Object run() { | |
| 387 | + try { | |
| 388 | + Field lnkPeer = Component.class.getDeclaredField("peer"); | |
| 389 | + if (lnkPeer != null) { | |
| 390 | + lnkPeer.setAccessible(true); | |
| 391 | + } | |
| 392 | + return lnkPeer; | |
| 393 | + } catch (NoSuchFieldException e) { | |
| 394 | + assert false; | |
| 395 | + } catch (SecurityException e) { | |
| 396 | + assert false; | |
| 397 | + } | |
| 398 | + return null; | |
| 399 | + }//run | |
| 400 | + }); | |
| 401 | + } | |
| 402 | + try{ | |
| 403 | + if (fieldPeer !=null){ | |
| 404 | + fieldPeer.set(EmbeddedFrame.this, p); | |
| 405 | + } | |
| 406 | + } catch (IllegalAccessException e) { | |
| 407 | + assert false; | |
| 408 | + } | |
| 409 | + }; //setPeer method ends | |
| 410 | + | |
| 411 | + /** | |
| 412 | + * Synthesize native message to activate or deactivate EmbeddedFrame window | |
| 413 | + * depending on the value of parameter <code>b</code>. | |
| 414 | + * Peers should override this method if they are to implement | |
| 415 | + * this functionality. | |
| 416 | + * @param doActivate if <code>true</code>, activates the window; | |
| 417 | + * otherwise, deactivates the window | |
| 418 | + */ | |
| 419 | + public void synthesizeWindowActivation(boolean doActivate) {} | |
| 420 | + | |
| 421 | + /** | |
| 422 | + * Moves this embedded frame to a new location. The top-left corner of | |
| 423 | + * the new location is specified by the <code>x</code> and <code>y</code> | |
| 424 | + * parameters relative to the native parent component. | |
| 425 | + * <p> | |
| 426 | + * setLocation() and setBounds() for EmbeddedFrame really don't move it | |
| 427 | + * within the native parent. These methods always put embedded frame to | |
| 428 | + * (0, 0) for backward compatibility. To allow moving embedded frame | |
| 429 | + * setLocationPrivate() and setBoundsPrivate() were introduced, and they | |
| 430 | + * work just the same way as setLocation() and setBounds() for usual, | |
| 431 | + * non-embedded components. | |
| 432 | + * </p> | |
| 433 | + * <p> | |
| 434 | + * Using usual get/setLocation() and get/setBounds() together with new | |
| 435 | + * get/setLocationPrivate() and get/setBoundsPrivate() is not recommended. | |
| 436 | + * For example, calling getBoundsPrivate() after setLocation() works fine, | |
| 437 | + * but getBounds() after setBoundsPrivate() may return unpredictable value. | |
| 438 | + * </p> | |
| 439 | + * @param x the new <i>x</i>-coordinate relative to the parent component | |
| 440 | + * @param y the new <i>y</i>-coordinate relative to the parent component | |
| 441 | + * @see java.awt.Component#setLocation | |
| 442 | + * @see #getLocationPrivate | |
| 443 | + * @see #setBoundsPrivate | |
| 444 | + * @see #getBoundsPrivate | |
| 445 | + * @since 1.5 | |
| 446 | + */ | |
| 447 | + protected void setLocationPrivate(int x, int y) { | |
| 448 | + Dimension size = getSize(); | |
| 449 | + setBoundsPrivate(x, y, size.width, size.height); | |
| 450 | + } | |
| 451 | + | |
| 452 | + /** | |
| 453 | + * Gets the location of this embedded frame as a point specifying the | |
| 454 | + * top-left corner relative to parent component. | |
| 455 | + * <p> | |
| 456 | + * setLocation() and setBounds() for EmbeddedFrame really don't move it | |
| 457 | + * within the native parent. These methods always put embedded frame to | |
| 458 | + * (0, 0) for backward compatibility. To allow getting location and size | |
| 459 | + * of embedded frame getLocationPrivate() and getBoundsPrivate() were | |
| 460 | + * introduced, and they work just the same way as getLocation() and getBounds() | |
| 461 | + * for ususal, non-embedded components. | |
| 462 | + * </p> | |
| 463 | + * <p> | |
| 464 | + * Using usual get/setLocation() and get/setBounds() together with new | |
| 465 | + * get/setLocationPrivate() and get/setBoundsPrivate() is not recommended. | |
| 466 | + * For example, calling getBoundsPrivate() after setLocation() works fine, | |
| 467 | + * but getBounds() after setBoundsPrivate() may return unpredictable value. | |
| 468 | + * </p> | |
| 469 | + * @return a point indicating this embedded frame's top-left corner | |
| 470 | + * @see java.awt.Component#getLocation | |
| 471 | + * @see #setLocationPrivate | |
| 472 | + * @see #setBoundsPrivate | |
| 473 | + * @see #getBoundsPrivate | |
| 474 | + * @since 1.6 | |
| 475 | + */ | |
| 476 | + protected Point getLocationPrivate() { | |
| 477 | + Rectangle bounds = getBoundsPrivate(); | |
| 478 | + return new Point(bounds.x, bounds.y); | |
| 479 | + } | |
| 480 | + | |
| 481 | + /** | |
| 482 | + * Moves and resizes this embedded frame. The new location of the top-left | |
| 483 | + * corner is specified by <code>x</code> and <code>y</code> parameters | |
| 484 | + * relative to the native parent component. The new size is specified by | |
| 485 | + * <code>width</code> and <code>height</code>. | |
| 486 | + * <p> | |
| 487 | + * setLocation() and setBounds() for EmbeddedFrame really don't move it | |
| 488 | + * within the native parent. These methods always put embedded frame to | |
| 489 | + * (0, 0) for backward compatibility. To allow moving embedded frames | |
| 490 | + * setLocationPrivate() and setBoundsPrivate() were introduced, and they | |
| 491 | + * work just the same way as setLocation() and setBounds() for usual, | |
| 492 | + * non-embedded components. | |
| 493 | + * </p> | |
| 494 | + * <p> | |
| 495 | + * Using usual get/setLocation() and get/setBounds() together with new | |
| 496 | + * get/setLocationPrivate() and get/setBoundsPrivate() is not recommended. | |
| 497 | + * For example, calling getBoundsPrivate() after setLocation() works fine, | |
| 498 | + * but getBounds() after setBoundsPrivate() may return unpredictable value. | |
| 499 | + * </p> | |
| 500 | + * @param x the new <i>x</i>-coordinate relative to the parent component | |
| 501 | + * @param y the new <i>y</i>-coordinate relative to the parent component | |
| 502 | + * @param width the new <code>width</code> of this embedded frame | |
| 503 | + * @param height the new <code>height</code> of this embedded frame | |
| 504 | + * @see java.awt.Component#setBounds | |
| 505 | + * @see #setLocationPrivate | |
| 506 | + * @see #getLocationPrivate | |
| 507 | + * @see #getBoundsPrivate | |
| 508 | + * @since 1.5 | |
| 509 | + */ | |
| 510 | + protected void setBoundsPrivate(int x, int y, int width, int height) { | |
| 511 | + final FramePeer peer = (FramePeer)getPeer(); | |
| 512 | + if (peer != null) { | |
| 513 | + peer.setBoundsPrivate(x, y, width, height); | |
| 514 | + } | |
| 515 | + } | |
| 516 | + | |
| 517 | + /** | |
| 518 | + * Gets the bounds of this embedded frame as a rectangle specifying the | |
| 519 | + * width, height and location relative to the native parent component. | |
| 520 | + * <p> | |
| 521 | + * setLocation() and setBounds() for EmbeddedFrame really don't move it | |
| 522 | + * within the native parent. These methods always put embedded frame to | |
| 523 | + * (0, 0) for backward compatibility. To allow getting location and size | |
| 524 | + * of embedded frames getLocationPrivate() and getBoundsPrivate() were | |
| 525 | + * introduced, and they work just the same way as getLocation() and getBounds() | |
| 526 | + * for ususal, non-embedded components. | |
| 527 | + * </p> | |
| 528 | + * <p> | |
| 529 | + * Using usual get/setLocation() and get/setBounds() together with new | |
| 530 | + * get/setLocationPrivate() and get/setBoundsPrivate() is not recommended. | |
| 531 | + * For example, calling getBoundsPrivate() after setLocation() works fine, | |
| 532 | + * but getBounds() after setBoundsPrivate() may return unpredictable value. | |
| 533 | + * </p> | |
| 534 | + * @return a rectangle indicating this embedded frame's bounds | |
| 535 | + * @see java.awt.Component#getBounds | |
| 536 | + * @see #setLocationPrivate | |
| 537 | + * @see #getLocationPrivate | |
| 538 | + * @see #setBoundsPrivate | |
| 539 | + * @since 1.6 | |
| 540 | + */ | |
| 541 | + protected Rectangle getBoundsPrivate() { | |
| 542 | + final FramePeer peer = (FramePeer)getPeer(); | |
| 543 | + if (peer != null) { | |
| 544 | + return peer.getBoundsPrivate(); | |
| 545 | + } | |
| 546 | + else { | |
| 547 | + return getBounds(); | |
| 548 | + } | |
| 549 | + } | |
| 550 | + | |
| 551 | + public void toFront() {} | |
| 552 | + public void toBack() {} | |
| 553 | + | |
| 554 | + public abstract void registerAccelerator(AWTKeyStroke stroke); | |
| 555 | + public abstract void unregisterAccelerator(AWTKeyStroke stroke); | |
| 556 | + | |
| 557 | + /** | |
| 558 | + * Checks if the component is in an EmbeddedFrame. If so, | |
| 559 | + * returns the applet found in the hierarchy or null if | |
| 560 | + * not found. | |
| 561 | + * @return the parent applet or {@ null} | |
| 562 | + * @since 1.6 | |
| 563 | + */ | |
| 564 | + public static Applet getAppletIfAncestorOf(Component comp) { | |
| 565 | + Container parent = comp.getParent(); | |
| 566 | + Applet applet = null; | |
| 567 | + while (parent != null && !(parent instanceof EmbeddedFrame)) { | |
| 568 | + if (parent instanceof Applet) { | |
| 569 | + applet = (Applet)parent; | |
| 570 | + } | |
| 571 | + parent = parent.getParent(); | |
| 572 | + } | |
| 573 | + return parent == null ? null : applet; | |
| 574 | + } | |
| 575 | + | |
| 576 | + /** | |
| 577 | + * This method should be overriden in subclasses. It is | |
| 578 | + * called when window this frame is within should be blocked | |
| 579 | + * by some modal dialog. | |
| 580 | + */ | |
| 581 | + public void notifyModalBlocked(Dialog blocker, boolean blocked) { | |
| 582 | + } | |
| 583 | + | |
| 584 | + private static class NullEmbeddedFramePeer | |
| 585 | + extends NullComponentPeer implements FramePeer { | |
| 586 | + public void setTitle(String title) {} | |
| 587 | + public void setIconImage(Image im) {} | |
| 588 | + public void updateIconImages() {} | |
| 589 | + public void setMenuBar(MenuBar mb) {} | |
| 590 | + public void setResizable(boolean resizeable) {} | |
| 591 | + public void setState(int state) {} | |
| 592 | + public int getState() { return Frame.NORMAL; } | |
| 593 | + public void setMaximizedBounds(Rectangle b) {} | |
| 594 | + public void toFront() {} | |
| 595 | + public void toBack() {} | |
| 596 | + public void updateFocusableWindowState() {} | |
| 597 | + public void updateAlwaysOnTop() {} | |
| 598 | + public void setAlwaysOnTop(boolean alwaysOnTop) {} | |
| 599 | + public Component getGlobalHeavyweightFocusOwner() { return null; } | |
| 600 | + public void setBoundsPrivate(int x, int y, int width, int height) { | |
| 601 | + setBounds(x, y, width, height, SET_BOUNDS); | |
| 602 | + } | |
| 603 | + public Rectangle getBoundsPrivate() { | |
| 604 | + return getBounds(); | |
| 605 | + } | |
| 606 | + public void setModalBlocked(Dialog blocker, boolean blocked) {} | |
| 607 | + | |
| 608 | + /** | |
| 609 | + * @see java.awt.peer.ContainerPeer#restack | |
| 610 | + */ | |
| 611 | + public void restack() { | |
| 612 | + throw new UnsupportedOperationException(); | |
| 613 | + } | |
| 614 | + | |
| 615 | + /** | |
| 616 | + * @see java.awt.peer.ContainerPeer#isRestackSupported | |
| 617 | + */ | |
| 618 | + public boolean isRestackSupported() { | |
| 619 | + return false; | |
| 620 | + } | |
| 621 | + public boolean requestWindowFocus() { | |
| 622 | + return false; | |
| 623 | + } | |
| 624 | + public void updateMinimumSize() { | |
| 625 | + } | |
| 626 | + | |
| 627 | + public void setOpacity(float opacity) { | |
| 628 | + } | |
| 629 | + | |
| 630 | + public void setOpaque(boolean isOpaque) { | |
| 631 | + } | |
| 632 | + | |
| 633 | + public void updateWindow() { | |
| 634 | + } | |
| 635 | + | |
| 636 | + public void repositionSecurityWarning() { | |
| 637 | + } | |
| 638 | + } | |
| 639 | +} // class EmbeddedFrame | |
Binary file not shown.
| @@ -0,0 +1,180 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 2003, 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 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.lang.reflect.Array; | |
| 29 | +import java.util.EventListener; | |
| 30 | + | |
| 31 | + | |
| 32 | +/** | |
| 33 | + * A class that assists in managing {@link java.util.EventListener}s of | |
| 34 | + * the specified type. Its instance holds an array of listeners of the same | |
| 35 | + * type and allows to perform the typical operations on the listeners. | |
| 36 | + * This class is thread-safe. | |
| 37 | + * | |
| 38 | + * @author Alexander Gerasimov | |
| 39 | + * | |
| 40 | + * @since 1.5 | |
| 41 | + */ | |
| 42 | +public class EventListenerAggregate { | |
| 43 | + | |
| 44 | + private EventListener[] listenerList; | |
| 45 | + | |
| 46 | + /** | |
| 47 | + * Constructs an <code>EventListenerAggregate</code> object. | |
| 48 | + * | |
| 49 | + * @param listenerClass the type of the listeners to be managed by this object | |
| 50 | + * | |
| 51 | + * @throws NullPointerException if <code>listenerClass</code> is | |
| 52 | + * <code>null</code> | |
| 53 | + * @throws ClassCastException if <code>listenerClass</code> is not | |
| 54 | + * assignable to <code>java.util.EventListener</code> | |
| 55 | + */ | |
| 56 | + public EventListenerAggregate(Class listenerClass) { | |
| 57 | + if (listenerClass == null) { | |
| 58 | + throw new NullPointerException("listener class is null"); | |
| 59 | + } | |
| 60 | + | |
| 61 | + if (!EventListener.class.isAssignableFrom(listenerClass)) { | |
| 62 | + throw new ClassCastException("listener class " + listenerClass + | |
| 63 | + " is not assignable to EventListener"); | |
| 64 | + } | |
| 65 | + | |
| 66 | + listenerList = (EventListener[])Array.newInstance(listenerClass, 0); | |
| 67 | + } | |
| 68 | + | |
| 69 | + private Class getListenerClass() { | |
| 70 | + return listenerList.getClass().getComponentType(); | |
| 71 | + } | |
| 72 | + | |
| 73 | + /** | |
| 74 | + * Adds the listener to this aggregate. | |
| 75 | + * | |
| 76 | + * @param listener the listener to be added | |
| 77 | + * | |
| 78 | + * @throws ClassCastException if <code>listener</code> is not | |
| 79 | + * an instatce of <code>listenerClass</code> specified | |
| 80 | + * in the constructor | |
| 81 | + */ | |
| 82 | + public synchronized void add(EventListener listener) { | |
| 83 | + Class listenerClass = getListenerClass(); | |
| 84 | + | |
| 85 | + if (!listenerClass.isInstance(listener)) { // null is not an instance of any class | |
| 86 | + throw new ClassCastException("listener " + listener + " is not " + | |
| 87 | + "an instance of listener class " + listenerClass); | |
| 88 | + } | |
| 89 | + | |
| 90 | + EventListener[] tmp = (EventListener[])Array.newInstance(listenerClass, listenerList.length + 1); | |
| 91 | + System.arraycopy(listenerList, 0, tmp, 0, listenerList.length); | |
| 92 | + tmp[listenerList.length] = listener; | |
| 93 | + listenerList = tmp; | |
| 94 | + } | |
| 95 | + | |
| 96 | + /** | |
| 97 | + * Removes a listener that is equal to the given one from this aggregate. | |
| 98 | + * <code>equals()</code> method is used to compare listeners. | |
| 99 | + * | |
| 100 | + * @param listener the listener to be removed | |
| 101 | + * | |
| 102 | + * @return <code>true</code> if this aggregate contained the specified | |
| 103 | + * <code>listener</code>; <code>false</code> otherwise | |
| 104 | + * | |
| 105 | + * @throws ClassCastException if <code>listener</code> is not | |
| 106 | + * an instatce of <code>listenerClass</code> specified | |
| 107 | + * in the constructor | |
| 108 | + */ | |
| 109 | + public synchronized boolean remove(EventListener listener) { | |
| 110 | + Class listenerClass = getListenerClass(); | |
| 111 | + | |
| 112 | + if (!listenerClass.isInstance(listener)) { // null is not an instance of any class | |
| 113 | + throw new ClassCastException("listener " + listener + " is not " + | |
| 114 | + "an instance of listener class " + listenerClass); | |
| 115 | + } | |
| 116 | + | |
| 117 | + for (int i = 0; i < listenerList.length; i++) { | |
| 118 | + if (listenerList[i].equals(listener)) { | |
| 119 | + EventListener[] tmp = (EventListener[])Array.newInstance(listenerClass, | |
| 120 | + listenerList.length - 1); | |
| 121 | + System.arraycopy(listenerList, 0, tmp, 0, i); | |
| 122 | + System.arraycopy(listenerList, i + 1, tmp, i, listenerList.length - i - 1); | |
| 123 | + listenerList = tmp; | |
| 124 | + | |
| 125 | + return true; | |
| 126 | + } | |
| 127 | + } | |
| 128 | + | |
| 129 | + return false; | |
| 130 | + } | |
| 131 | + | |
| 132 | + /** | |
| 133 | + * Returns an array of all the listeners contained in this aggregate. | |
| 134 | + * The array is the data structure in which listeners are stored internally. | |
| 135 | + * The runtime type of the returned array is "array of <code>listenerClass</code>" | |
| 136 | + * (<code>listenerClass</code> has been specified as a parameter to | |
| 137 | + * the constructor of this class). | |
| 138 | + * | |
| 139 | + * @return all the listeners contained in this aggregate (an empty | |
| 140 | + * array if there are no listeners) | |
| 141 | + */ | |
| 142 | + public synchronized EventListener[] getListenersInternal() { | |
| 143 | + return listenerList; | |
| 144 | + } | |
| 145 | + | |
| 146 | + /** | |
| 147 | + * Returns an array of all the listeners contained in this aggregate. | |
| 148 | + * The array is a copy of the data structure in which listeners are stored | |
| 149 | + * internally. | |
| 150 | + * The runtime type of the returned array is "array of <code>listenerClass</code>" | |
| 151 | + * (<code>listenerClass</code> has been specified as a parameter to | |
| 152 | + * the constructor of this class). | |
| 153 | + * | |
| 154 | + * @return a copy of all the listeners contained in this aggregate (an empty | |
| 155 | + * array if there are no listeners) | |
| 156 | + */ | |
| 157 | + public synchronized EventListener[] getListenersCopy() { | |
| 158 | + return (listenerList.length == 0) ? listenerList : (EventListener[])listenerList.clone(); | |
| 159 | + } | |
| 160 | + | |
| 161 | + /** | |
| 162 | + * Returns the number of lisetners in this aggregate. | |
| 163 | + * | |
| 164 | + * @return the number of lisetners in this aggregate | |
| 165 | + */ | |
| 166 | + public synchronized int size() { | |
| 167 | + return listenerList.length; | |
| 168 | + } | |
| 169 | + | |
| 170 | + /** | |
| 171 | + * Returns <code>true</code> if this aggregate contains no listeners, | |
| 172 | + * <code>false</code> otherwise. | |
| 173 | + * | |
| 174 | + * @return <code>true</code> if this aggregate contains no listeners, | |
| 175 | + * <code>false</code> otherwise | |
| 176 | + */ | |
| 177 | + public synchronized boolean isEmpty() { | |
| 178 | + return listenerList.length == 0; | |
| 179 | + } | |
| 180 | +} | |
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1,71 @@ | ||
| 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 | + */ | |
| 25 | + | |
| 26 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.awt.AWTEvent; | |
| 29 | +import java.awt.EventQueue; | |
| 30 | + | |
| 31 | + | |
| 32 | +public class EventQueueDelegate { | |
| 33 | + private static final Object EVENT_QUEUE_DELEGATE_KEY = | |
| 34 | + new StringBuilder("EventQueueDelegate.Delegate"); | |
| 35 | + | |
| 36 | + public static void setDelegate(Delegate delegate) { | |
| 37 | + AppContext.getAppContext().put(EVENT_QUEUE_DELEGATE_KEY, delegate); | |
| 38 | + } | |
| 39 | + public static Delegate getDelegate() { | |
| 40 | + return | |
| 41 | + (Delegate) AppContext.getAppContext().get(EVENT_QUEUE_DELEGATE_KEY); | |
| 42 | + } | |
| 43 | + public interface Delegate { | |
| 44 | + /** | |
| 45 | + * This method allows for changing {@code EventQueue} events order. | |
| 46 | + * | |
| 47 | + * @param eventQueue current {@code EventQueue} | |
| 48 | + * @return next {@code event} for the {@code EventDispatchThread} | |
| 49 | + */ | |
| 50 | + | |
| 51 | + public AWTEvent getNextEvent(EventQueue eventQueue) throws InterruptedException; | |
| 52 | + | |
| 53 | + /** | |
| 54 | + * Notifies delegate before EventQueue.dispatch method. | |
| 55 | + * | |
| 56 | + * Note: this method may mutate the event | |
| 57 | + * | |
| 58 | + * @param event to be dispatched by {@code dispatch} method | |
| 59 | + * @return handle to be passed to {@code afterDispatch} method | |
| 60 | + */ | |
| 61 | + public Object beforeDispatch(AWTEvent event) throws InterruptedException; | |
| 62 | + | |
| 63 | + /** | |
| 64 | + * Notifies delegate after EventQueue.dispatch method. | |
| 65 | + * | |
| 66 | + * @param event {@code event} dispatched by the {@code dispatch} method | |
| 67 | + * @param handle object which came from {@code beforeDispatch} method | |
| 68 | + */ | |
| 69 | + public void afterDispatch(AWTEvent event, Object handle) throws InterruptedException; | |
| 70 | + } | |
| 71 | +} | |
Binary file not shown.
| @@ -0,0 +1,37 @@ | ||
| 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 | + */ | |
| 25 | + | |
| 26 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.awt.AWTEvent; | |
| 29 | + | |
| 30 | +public class EventQueueItem { | |
| 31 | + public AWTEvent event; | |
| 32 | + public EventQueueItem next; | |
| 33 | + | |
| 34 | + public EventQueueItem(AWTEvent evt) { | |
| 35 | + event = evt; | |
| 36 | + } | |
| 37 | +} | |
Binary file not shown.
| @@ -0,0 +1,644 @@ | ||
| 1 | +package sun.awt; | |
| 2 | + | |
| 3 | +import java.util.Collections; | |
| 4 | +import java.util.HashMap; | |
| 5 | +import java.util.HashSet; | |
| 6 | +import java.awt.event.KeyEvent; | |
| 7 | + | |
| 8 | +public class ExtendedKeyCodes { | |
| 9 | + /** | |
| 10 | + * ATTN: These are the readonly hashes with load factor == 1; | |
| 11 | + * adding a value, please set the inital capacity to exact number of items | |
| 12 | + * or higher. | |
| 13 | + */ | |
| 14 | + // Keycodes declared in KeyEvent.java with corresponding Unicode values. | |
| 15 | + private final static HashMap<Integer, Integer> regularKeyCodesMap = | |
| 16 | + new HashMap<Integer,Integer>(98, 1.0f); | |
| 17 | + | |
| 18 | + // Keycodes derived from Unicode values. Here should be collected codes | |
| 19 | + // for characters appearing on the primary layer of at least one | |
| 20 | + // known keyboard layout. For instance, sterling sign is on the primary layer | |
| 21 | + // of the Mac Italian layout. | |
| 22 | + private final static HashSet<Integer> extendedKeyCodesSet = | |
| 23 | + new HashSet<Integer>(501, 1.0f); | |
| 24 | + final public static int getExtendedKeyCodeForChar( int c ) { | |
| 25 | + int uc = Character.toUpperCase( c ); | |
| 26 | + int lc = Character.toLowerCase( c ); | |
| 27 | + if (regularKeyCodesMap.containsKey( c )) { | |
| 28 | + if(regularKeyCodesMap.containsKey(uc)) { | |
| 29 | + return regularKeyCodesMap.get( uc ); | |
| 30 | + } | |
| 31 | + return regularKeyCodesMap.get( c ); | |
| 32 | + } | |
| 33 | + uc += 0x01000000; | |
| 34 | + lc += 0x01000000; | |
| 35 | + if (extendedKeyCodesSet.contains( uc )) { | |
| 36 | + return uc; | |
| 37 | + }else if (extendedKeyCodesSet.contains( lc )) { | |
| 38 | + return lc; | |
| 39 | + } | |
| 40 | + return KeyEvent.VK_UNDEFINED; | |
| 41 | + } | |
| 42 | + static { | |
| 43 | + regularKeyCodesMap.put(0x08, KeyEvent.VK_BACK_SPACE); | |
| 44 | + regularKeyCodesMap.put(0x09, KeyEvent.VK_TAB); | |
| 45 | + regularKeyCodesMap.put(0x0a, KeyEvent.VK_ENTER); | |
| 46 | + regularKeyCodesMap.put(0x1B, KeyEvent.VK_ESCAPE); | |
| 47 | + regularKeyCodesMap.put(0x20AC, KeyEvent.VK_EURO_SIGN); | |
| 48 | + regularKeyCodesMap.put(0x20, KeyEvent.VK_SPACE); | |
| 49 | + regularKeyCodesMap.put(0x21, KeyEvent.VK_EXCLAMATION_MARK); | |
| 50 | + regularKeyCodesMap.put(0x22, KeyEvent.VK_QUOTEDBL); | |
| 51 | + regularKeyCodesMap.put(0x23, KeyEvent.VK_NUMBER_SIGN); | |
| 52 | + regularKeyCodesMap.put(0x24, KeyEvent.VK_DOLLAR); | |
| 53 | + regularKeyCodesMap.put(0x26, KeyEvent.VK_AMPERSAND); | |
| 54 | + regularKeyCodesMap.put(0x27, KeyEvent.VK_QUOTE); | |
| 55 | + regularKeyCodesMap.put(0x28, KeyEvent.VK_LEFT_PARENTHESIS); | |
| 56 | + regularKeyCodesMap.put(0x29, KeyEvent.VK_RIGHT_PARENTHESIS); | |
| 57 | + regularKeyCodesMap.put(0x2A, KeyEvent.VK_ASTERISK); | |
| 58 | + regularKeyCodesMap.put(0x2B, KeyEvent.VK_PLUS); | |
| 59 | + regularKeyCodesMap.put(0x2C, KeyEvent.VK_COMMA); | |
| 60 | + regularKeyCodesMap.put(0x2D, KeyEvent.VK_MINUS); | |
| 61 | + regularKeyCodesMap.put(0x2E, KeyEvent.VK_PERIOD); | |
| 62 | + regularKeyCodesMap.put(0x2F, KeyEvent.VK_SLASH); | |
| 63 | + regularKeyCodesMap.put(0x30, KeyEvent.VK_0); | |
| 64 | + regularKeyCodesMap.put(0x31, KeyEvent.VK_1); | |
| 65 | + regularKeyCodesMap.put(0x32, KeyEvent.VK_2); | |
| 66 | + regularKeyCodesMap.put(0x33, KeyEvent.VK_3); | |
| 67 | + regularKeyCodesMap.put(0x34, KeyEvent.VK_4); | |
| 68 | + regularKeyCodesMap.put(0x35, KeyEvent.VK_5); | |
| 69 | + regularKeyCodesMap.put(0x36, KeyEvent.VK_6); | |
| 70 | + regularKeyCodesMap.put(0x37, KeyEvent.VK_7); | |
| 71 | + regularKeyCodesMap.put(0x38, KeyEvent.VK_8); | |
| 72 | + regularKeyCodesMap.put(0x39, KeyEvent.VK_9); | |
| 73 | + regularKeyCodesMap.put(0x3A, KeyEvent.VK_COLON); | |
| 74 | + regularKeyCodesMap.put(0x3B, KeyEvent.VK_SEMICOLON); | |
| 75 | + regularKeyCodesMap.put(0x3C, KeyEvent.VK_LESS); | |
| 76 | + regularKeyCodesMap.put(0x3D, KeyEvent.VK_EQUALS); | |
| 77 | + regularKeyCodesMap.put(0x3E, KeyEvent.VK_GREATER); | |
| 78 | + regularKeyCodesMap.put(0x40, KeyEvent.VK_AT); | |
| 79 | + regularKeyCodesMap.put(0x41, KeyEvent.VK_A); | |
| 80 | + regularKeyCodesMap.put(0x42, KeyEvent.VK_B); | |
| 81 | + regularKeyCodesMap.put(0x43, KeyEvent.VK_C); | |
| 82 | + regularKeyCodesMap.put(0x44, KeyEvent.VK_D); | |
| 83 | + regularKeyCodesMap.put(0x45, KeyEvent.VK_E); | |
| 84 | + regularKeyCodesMap.put(0x46, KeyEvent.VK_F); | |
| 85 | + regularKeyCodesMap.put(0x47, KeyEvent.VK_G); | |
| 86 | + regularKeyCodesMap.put(0x48, KeyEvent.VK_H); | |
| 87 | + regularKeyCodesMap.put(0x49, KeyEvent.VK_I); | |
| 88 | + regularKeyCodesMap.put(0x4A, KeyEvent.VK_J); | |
| 89 | + regularKeyCodesMap.put(0x4B, KeyEvent.VK_K); | |
| 90 | + regularKeyCodesMap.put(0x4C, KeyEvent.VK_L); | |
| 91 | + regularKeyCodesMap.put(0x4D, KeyEvent.VK_M); | |
| 92 | + regularKeyCodesMap.put(0x4E, KeyEvent.VK_N); | |
| 93 | + regularKeyCodesMap.put(0x4F, KeyEvent.VK_O); | |
| 94 | + regularKeyCodesMap.put(0x50, KeyEvent.VK_P); | |
| 95 | + regularKeyCodesMap.put(0x51, KeyEvent.VK_Q); | |
| 96 | + regularKeyCodesMap.put(0x52, KeyEvent.VK_R); | |
| 97 | + regularKeyCodesMap.put(0x53, KeyEvent.VK_S); | |
| 98 | + regularKeyCodesMap.put(0x54, KeyEvent.VK_T); | |
| 99 | + regularKeyCodesMap.put(0x55, KeyEvent.VK_U); | |
| 100 | + regularKeyCodesMap.put(0x56, KeyEvent.VK_V); | |
| 101 | + regularKeyCodesMap.put(0x57, KeyEvent.VK_W); | |
| 102 | + regularKeyCodesMap.put(0x58, KeyEvent.VK_X); | |
| 103 | + regularKeyCodesMap.put(0x59, KeyEvent.VK_Y); | |
| 104 | + regularKeyCodesMap.put(0x5A, KeyEvent.VK_Z); | |
| 105 | + regularKeyCodesMap.put(0x5B, KeyEvent.VK_OPEN_BRACKET); | |
| 106 | + regularKeyCodesMap.put(0x5C, KeyEvent.VK_BACK_SLASH); | |
| 107 | + regularKeyCodesMap.put(0x5D, KeyEvent.VK_CLOSE_BRACKET); | |
| 108 | + regularKeyCodesMap.put(0x5E, KeyEvent.VK_CIRCUMFLEX); | |
| 109 | + regularKeyCodesMap.put(0x5F, KeyEvent.VK_UNDERSCORE); | |
| 110 | + regularKeyCodesMap.put(0x60, KeyEvent.VK_BACK_QUOTE); | |
| 111 | + regularKeyCodesMap.put(0x61, KeyEvent.VK_A); | |
| 112 | + regularKeyCodesMap.put(0x62, KeyEvent.VK_B); | |
| 113 | + regularKeyCodesMap.put(0x63, KeyEvent.VK_C); | |
| 114 | + regularKeyCodesMap.put(0x64, KeyEvent.VK_D); | |
| 115 | + regularKeyCodesMap.put(0x65, KeyEvent.VK_E); | |
| 116 | + regularKeyCodesMap.put(0x66, KeyEvent.VK_F); | |
| 117 | + regularKeyCodesMap.put(0x67, KeyEvent.VK_G); | |
| 118 | + regularKeyCodesMap.put(0x68, KeyEvent.VK_H); | |
| 119 | + regularKeyCodesMap.put(0x69, KeyEvent.VK_I); | |
| 120 | + regularKeyCodesMap.put(0x6A, KeyEvent.VK_J); | |
| 121 | + regularKeyCodesMap.put(0x6B, KeyEvent.VK_K); | |
| 122 | + regularKeyCodesMap.put(0x6C, KeyEvent.VK_L); | |
| 123 | + regularKeyCodesMap.put(0x6D, KeyEvent.VK_M); | |
| 124 | + regularKeyCodesMap.put(0x6E, KeyEvent.VK_N); | |
| 125 | + regularKeyCodesMap.put(0x6F, KeyEvent.VK_O); | |
| 126 | + regularKeyCodesMap.put(0x70, KeyEvent.VK_P); | |
| 127 | + regularKeyCodesMap.put(0x71, KeyEvent.VK_Q); | |
| 128 | + regularKeyCodesMap.put(0x72, KeyEvent.VK_R); | |
| 129 | + regularKeyCodesMap.put(0x73, KeyEvent.VK_S); | |
| 130 | + regularKeyCodesMap.put(0x74, KeyEvent.VK_T); | |
| 131 | + regularKeyCodesMap.put(0x75, KeyEvent.VK_U); | |
| 132 | + regularKeyCodesMap.put(0x76, KeyEvent.VK_V); | |
| 133 | + regularKeyCodesMap.put(0x77, KeyEvent.VK_W); | |
| 134 | + regularKeyCodesMap.put(0x78, KeyEvent.VK_X); | |
| 135 | + regularKeyCodesMap.put(0x79, KeyEvent.VK_Y); | |
| 136 | + regularKeyCodesMap.put(0x7A, KeyEvent.VK_Z); | |
| 137 | + regularKeyCodesMap.put(0x7B, KeyEvent.VK_BRACELEFT); | |
| 138 | + regularKeyCodesMap.put(0x7D, KeyEvent.VK_BRACERIGHT); | |
| 139 | + regularKeyCodesMap.put(0x7F, KeyEvent.VK_DELETE); | |
| 140 | + regularKeyCodesMap.put(0xA1, KeyEvent.VK_INVERTED_EXCLAMATION_MARK); | |
| 141 | + | |
| 142 | + extendedKeyCodesSet.add(0x01000000+0x0060); | |
| 143 | + extendedKeyCodesSet.add(0x01000000+0x007C); | |
| 144 | + extendedKeyCodesSet.add(0x01000000+0x007E); | |
| 145 | + extendedKeyCodesSet.add(0x01000000+0x00A2); | |
| 146 | + extendedKeyCodesSet.add(0x01000000+0x00A3); | |
| 147 | + extendedKeyCodesSet.add(0x01000000+0x00A5); | |
| 148 | + extendedKeyCodesSet.add(0x01000000+0x00A7); | |
| 149 | + extendedKeyCodesSet.add(0x01000000+0x00A8); | |
| 150 | + extendedKeyCodesSet.add(0x01000000+0x00AB); | |
| 151 | + extendedKeyCodesSet.add(0x01000000+0x00B0); | |
| 152 | + extendedKeyCodesSet.add(0x01000000+0x00B1); | |
| 153 | + extendedKeyCodesSet.add(0x01000000+0x00B2); | |
| 154 | + extendedKeyCodesSet.add(0x01000000+0x00B3); | |
| 155 | + extendedKeyCodesSet.add(0x01000000+0x00B4); | |
| 156 | + extendedKeyCodesSet.add(0x01000000+0x00B5); | |
| 157 | + extendedKeyCodesSet.add(0x01000000+0x00B6); | |
| 158 | + extendedKeyCodesSet.add(0x01000000+0x00B7); | |
| 159 | + extendedKeyCodesSet.add(0x01000000+0x00B9); | |
| 160 | + extendedKeyCodesSet.add(0x01000000+0x00BA); | |
| 161 | + extendedKeyCodesSet.add(0x01000000+0x00BB); | |
| 162 | + extendedKeyCodesSet.add(0x01000000+0x00BC); | |
| 163 | + extendedKeyCodesSet.add(0x01000000+0x00BD); | |
| 164 | + extendedKeyCodesSet.add(0x01000000+0x00BE); | |
| 165 | + extendedKeyCodesSet.add(0x01000000+0x00BF); | |
| 166 | + extendedKeyCodesSet.add(0x01000000+0x00C4); | |
| 167 | + extendedKeyCodesSet.add(0x01000000+0x00C5); | |
| 168 | + extendedKeyCodesSet.add(0x01000000+0x00C6); | |
| 169 | + extendedKeyCodesSet.add(0x01000000+0x00C7); | |
| 170 | + extendedKeyCodesSet.add(0x01000000+0x00D1); | |
| 171 | + extendedKeyCodesSet.add(0x01000000+0x00D6); | |
| 172 | + extendedKeyCodesSet.add(0x01000000+0x00D7); | |
| 173 | + extendedKeyCodesSet.add(0x01000000+0x00D8); | |
| 174 | + extendedKeyCodesSet.add(0x01000000+0x00DF); | |
| 175 | + extendedKeyCodesSet.add(0x01000000+0x00E0); | |
| 176 | + extendedKeyCodesSet.add(0x01000000+0x00E1); | |
| 177 | + extendedKeyCodesSet.add(0x01000000+0x00E2); | |
| 178 | + extendedKeyCodesSet.add(0x01000000+0x00E4); | |
| 179 | + extendedKeyCodesSet.add(0x01000000+0x00E5); | |
| 180 | + extendedKeyCodesSet.add(0x01000000+0x00E6); | |
| 181 | + extendedKeyCodesSet.add(0x01000000+0x00E7); | |
| 182 | + extendedKeyCodesSet.add(0x01000000+0x00E8); | |
| 183 | + extendedKeyCodesSet.add(0x01000000+0x00E9); | |
| 184 | + extendedKeyCodesSet.add(0x01000000+0x00EA); | |
| 185 | + extendedKeyCodesSet.add(0x01000000+0x00EB); | |
| 186 | + extendedKeyCodesSet.add(0x01000000+0x00EC); | |
| 187 | + extendedKeyCodesSet.add(0x01000000+0x00ED); | |
| 188 | + extendedKeyCodesSet.add(0x01000000+0x00EE); | |
| 189 | + extendedKeyCodesSet.add(0x01000000+0x00F0); | |
| 190 | + extendedKeyCodesSet.add(0x01000000+0x00F1); | |
| 191 | + extendedKeyCodesSet.add(0x01000000+0x00F2); | |
| 192 | + extendedKeyCodesSet.add(0x01000000+0x00F3); | |
| 193 | + extendedKeyCodesSet.add(0x01000000+0x00F4); | |
| 194 | + extendedKeyCodesSet.add(0x01000000+0x00F5); | |
| 195 | + extendedKeyCodesSet.add(0x01000000+0x00F6); | |
| 196 | + extendedKeyCodesSet.add(0x01000000+0x00F7); | |
| 197 | + extendedKeyCodesSet.add(0x01000000+0x00F8); | |
| 198 | + extendedKeyCodesSet.add(0x01000000+0x00F9); | |
| 199 | + extendedKeyCodesSet.add(0x01000000+0x00FA); | |
| 200 | + extendedKeyCodesSet.add(0x01000000+0x00FB); | |
| 201 | + extendedKeyCodesSet.add(0x01000000+0x00FC); | |
| 202 | + extendedKeyCodesSet.add(0x01000000+0x00FD); | |
| 203 | + extendedKeyCodesSet.add(0x01000000+0x00FE); | |
| 204 | + extendedKeyCodesSet.add(0x01000000+0x0105); | |
| 205 | + extendedKeyCodesSet.add(0x01000000+0x02DB); | |
| 206 | + extendedKeyCodesSet.add(0x01000000+0x0142); | |
| 207 | + extendedKeyCodesSet.add(0x01000000+0x013E); | |
| 208 | + extendedKeyCodesSet.add(0x01000000+0x015B); | |
| 209 | + extendedKeyCodesSet.add(0x01000000+0x0161); | |
| 210 | + extendedKeyCodesSet.add(0x01000000+0x015F); | |
| 211 | + extendedKeyCodesSet.add(0x01000000+0x0165); | |
| 212 | + extendedKeyCodesSet.add(0x01000000+0x017E); | |
| 213 | + extendedKeyCodesSet.add(0x01000000+0x017C); | |
| 214 | + extendedKeyCodesSet.add(0x01000000+0x0103); | |
| 215 | + extendedKeyCodesSet.add(0x01000000+0x0107); | |
| 216 | + extendedKeyCodesSet.add(0x01000000+0x010D); | |
| 217 | + extendedKeyCodesSet.add(0x01000000+0x0119); | |
| 218 | + extendedKeyCodesSet.add(0x01000000+0x011B); | |
| 219 | + extendedKeyCodesSet.add(0x01000000+0x0111); | |
| 220 | + extendedKeyCodesSet.add(0x01000000+0x0148); | |
| 221 | + extendedKeyCodesSet.add(0x01000000+0x0151); | |
| 222 | + extendedKeyCodesSet.add(0x01000000+0x0171); | |
| 223 | + extendedKeyCodesSet.add(0x01000000+0x0159); | |
| 224 | + extendedKeyCodesSet.add(0x01000000+0x016F); | |
| 225 | + extendedKeyCodesSet.add(0x01000000+0x0163); | |
| 226 | + extendedKeyCodesSet.add(0x01000000+0x02D9); | |
| 227 | + extendedKeyCodesSet.add(0x01000000+0x0130); | |
| 228 | + extendedKeyCodesSet.add(0x01000000+0x0127); | |
| 229 | + extendedKeyCodesSet.add(0x01000000+0x0125); | |
| 230 | + extendedKeyCodesSet.add(0x01000000+0x0131); | |
| 231 | + extendedKeyCodesSet.add(0x01000000+0x011F); | |
| 232 | + extendedKeyCodesSet.add(0x01000000+0x0135); | |
| 233 | + extendedKeyCodesSet.add(0x01000000+0x010B); | |
| 234 | + extendedKeyCodesSet.add(0x01000000+0x0109); | |
| 235 | + extendedKeyCodesSet.add(0x01000000+0x0121); | |
| 236 | + extendedKeyCodesSet.add(0x01000000+0x011D); | |
| 237 | + extendedKeyCodesSet.add(0x01000000+0x016D); | |
| 238 | + extendedKeyCodesSet.add(0x01000000+0x015D); | |
| 239 | + extendedKeyCodesSet.add(0x01000000+0x0138); | |
| 240 | + extendedKeyCodesSet.add(0x01000000+0x0157); | |
| 241 | + extendedKeyCodesSet.add(0x01000000+0x013C); | |
| 242 | + extendedKeyCodesSet.add(0x01000000+0x0113); | |
| 243 | + extendedKeyCodesSet.add(0x01000000+0x0123); | |
| 244 | + extendedKeyCodesSet.add(0x01000000+0x0167); | |
| 245 | + extendedKeyCodesSet.add(0x01000000+0x014B); | |
| 246 | + extendedKeyCodesSet.add(0x01000000+0x0101); | |
| 247 | + extendedKeyCodesSet.add(0x01000000+0x012F); | |
| 248 | + extendedKeyCodesSet.add(0x01000000+0x0117); | |
| 249 | + extendedKeyCodesSet.add(0x01000000+0x012B); | |
| 250 | + extendedKeyCodesSet.add(0x01000000+0x0146); | |
| 251 | + extendedKeyCodesSet.add(0x01000000+0x014D); | |
| 252 | + extendedKeyCodesSet.add(0x01000000+0x0137); | |
| 253 | + extendedKeyCodesSet.add(0x01000000+0x0173); | |
| 254 | + extendedKeyCodesSet.add(0x01000000+0x016B); | |
| 255 | + extendedKeyCodesSet.add(0x01000000+0x0153); | |
| 256 | + extendedKeyCodesSet.add(0x01000000+0x30FC); | |
| 257 | + extendedKeyCodesSet.add(0x01000000+0x30A2); | |
| 258 | + extendedKeyCodesSet.add(0x01000000+0x30A4); | |
| 259 | + extendedKeyCodesSet.add(0x01000000+0x30A6); | |
| 260 | + extendedKeyCodesSet.add(0x01000000+0x30A8); | |
| 261 | + extendedKeyCodesSet.add(0x01000000+0x30AA); | |
| 262 | + extendedKeyCodesSet.add(0x01000000+0x30AB); | |
| 263 | + extendedKeyCodesSet.add(0x01000000+0x30AD); | |
| 264 | + extendedKeyCodesSet.add(0x01000000+0x30AF); | |
| 265 | + extendedKeyCodesSet.add(0x01000000+0x30B1); | |
| 266 | + extendedKeyCodesSet.add(0x01000000+0x30B3); | |
| 267 | + extendedKeyCodesSet.add(0x01000000+0x30B5); | |
| 268 | + extendedKeyCodesSet.add(0x01000000+0x30B7); | |
| 269 | + extendedKeyCodesSet.add(0x01000000+0x30B9); | |
| 270 | + extendedKeyCodesSet.add(0x01000000+0x30BB); | |
| 271 | + extendedKeyCodesSet.add(0x01000000+0x30BD); | |
| 272 | + extendedKeyCodesSet.add(0x01000000+0x30BF); | |
| 273 | + extendedKeyCodesSet.add(0x01000000+0x30C1); | |
| 274 | + extendedKeyCodesSet.add(0x01000000+0x30C4); | |
| 275 | + extendedKeyCodesSet.add(0x01000000+0x30C6); | |
| 276 | + extendedKeyCodesSet.add(0x01000000+0x30C8); | |
| 277 | + extendedKeyCodesSet.add(0x01000000+0x30CA); | |
| 278 | + extendedKeyCodesSet.add(0x01000000+0x30CB); | |
| 279 | + extendedKeyCodesSet.add(0x01000000+0x30CC); | |
| 280 | + extendedKeyCodesSet.add(0x01000000+0x30CD); | |
| 281 | + extendedKeyCodesSet.add(0x01000000+0x30CE); | |
| 282 | + extendedKeyCodesSet.add(0x01000000+0x30CF); | |
| 283 | + extendedKeyCodesSet.add(0x01000000+0x30D2); | |
| 284 | + extendedKeyCodesSet.add(0x01000000+0x30D5); | |
| 285 | + extendedKeyCodesSet.add(0x01000000+0x30D8); | |
| 286 | + extendedKeyCodesSet.add(0x01000000+0x30DB); | |
| 287 | + extendedKeyCodesSet.add(0x01000000+0x30DE); | |
| 288 | + extendedKeyCodesSet.add(0x01000000+0x30DF); | |
| 289 | + extendedKeyCodesSet.add(0x01000000+0x30E0); | |
| 290 | + extendedKeyCodesSet.add(0x01000000+0x30E1); | |
| 291 | + extendedKeyCodesSet.add(0x01000000+0x30E2); | |
| 292 | + extendedKeyCodesSet.add(0x01000000+0x30E4); | |
| 293 | + extendedKeyCodesSet.add(0x01000000+0x30E6); | |
| 294 | + extendedKeyCodesSet.add(0x01000000+0x30E8); | |
| 295 | + extendedKeyCodesSet.add(0x01000000+0x30E9); | |
| 296 | + extendedKeyCodesSet.add(0x01000000+0x30EA); | |
| 297 | + extendedKeyCodesSet.add(0x01000000+0x30EB); | |
| 298 | + extendedKeyCodesSet.add(0x01000000+0x30EC); | |
| 299 | + extendedKeyCodesSet.add(0x01000000+0x30ED); | |
| 300 | + extendedKeyCodesSet.add(0x01000000+0x30EF); | |
| 301 | + extendedKeyCodesSet.add(0x01000000+0x30F3); | |
| 302 | + extendedKeyCodesSet.add(0x01000000+0x309B); | |
| 303 | + extendedKeyCodesSet.add(0x01000000+0x309C); | |
| 304 | + extendedKeyCodesSet.add(0x01000000+0x06F0); | |
| 305 | + extendedKeyCodesSet.add(0x01000000+0x06F1); | |
| 306 | + extendedKeyCodesSet.add(0x01000000+0x06F2); | |
| 307 | + extendedKeyCodesSet.add(0x01000000+0x06F3); | |
| 308 | + extendedKeyCodesSet.add(0x01000000+0x06F4); | |
| 309 | + extendedKeyCodesSet.add(0x01000000+0x06F5); | |
| 310 | + extendedKeyCodesSet.add(0x01000000+0x06F6); | |
| 311 | + extendedKeyCodesSet.add(0x01000000+0x06F7); | |
| 312 | + extendedKeyCodesSet.add(0x01000000+0x06F8); | |
| 313 | + extendedKeyCodesSet.add(0x01000000+0x06F9); | |
| 314 | + extendedKeyCodesSet.add(0x01000000+0x0670); | |
| 315 | + extendedKeyCodesSet.add(0x01000000+0x067E); | |
| 316 | + extendedKeyCodesSet.add(0x01000000+0x0686); | |
| 317 | + extendedKeyCodesSet.add(0x01000000+0x060C); | |
| 318 | + extendedKeyCodesSet.add(0x01000000+0x06D4); | |
| 319 | + extendedKeyCodesSet.add(0x01000000+0x0660); | |
| 320 | + extendedKeyCodesSet.add(0x01000000+0x0661); | |
| 321 | + extendedKeyCodesSet.add(0x01000000+0x0662); | |
| 322 | + extendedKeyCodesSet.add(0x01000000+0x0663); | |
| 323 | + extendedKeyCodesSet.add(0x01000000+0x0664); | |
| 324 | + extendedKeyCodesSet.add(0x01000000+0x0665); | |
| 325 | + extendedKeyCodesSet.add(0x01000000+0x0666); | |
| 326 | + extendedKeyCodesSet.add(0x01000000+0x0667); | |
| 327 | + extendedKeyCodesSet.add(0x01000000+0x0668); | |
| 328 | + extendedKeyCodesSet.add(0x01000000+0x0669); | |
| 329 | + extendedKeyCodesSet.add(0x01000000+0x061B); | |
| 330 | + extendedKeyCodesSet.add(0x01000000+0x0621); | |
| 331 | + extendedKeyCodesSet.add(0x01000000+0x0624); | |
| 332 | + extendedKeyCodesSet.add(0x01000000+0x0626); | |
| 333 | + extendedKeyCodesSet.add(0x01000000+0x0627); | |
| 334 | + extendedKeyCodesSet.add(0x01000000+0x0628); | |
| 335 | + extendedKeyCodesSet.add(0x01000000+0x0629); | |
| 336 | + extendedKeyCodesSet.add(0x01000000+0x062A); | |
| 337 | + extendedKeyCodesSet.add(0x01000000+0x062B); | |
| 338 | + extendedKeyCodesSet.add(0x01000000+0x062C); | |
| 339 | + extendedKeyCodesSet.add(0x01000000+0x062D); | |
| 340 | + extendedKeyCodesSet.add(0x01000000+0x062E); | |
| 341 | + extendedKeyCodesSet.add(0x01000000+0x062F); | |
| 342 | + extendedKeyCodesSet.add(0x01000000+0x0630); | |
| 343 | + extendedKeyCodesSet.add(0x01000000+0x0631); | |
| 344 | + extendedKeyCodesSet.add(0x01000000+0x0632); | |
| 345 | + extendedKeyCodesSet.add(0x01000000+0x0633); | |
| 346 | + extendedKeyCodesSet.add(0x01000000+0x0634); | |
| 347 | + extendedKeyCodesSet.add(0x01000000+0x0635); | |
| 348 | + extendedKeyCodesSet.add(0x01000000+0x0636); | |
| 349 | + extendedKeyCodesSet.add(0x01000000+0x0637); | |
| 350 | + extendedKeyCodesSet.add(0x01000000+0x0638); | |
| 351 | + extendedKeyCodesSet.add(0x01000000+0x0639); | |
| 352 | + extendedKeyCodesSet.add(0x01000000+0x063A); | |
| 353 | + extendedKeyCodesSet.add(0x01000000+0x0641); | |
| 354 | + extendedKeyCodesSet.add(0x01000000+0x0642); | |
| 355 | + extendedKeyCodesSet.add(0x01000000+0x0643); | |
| 356 | + extendedKeyCodesSet.add(0x01000000+0x0644); | |
| 357 | + extendedKeyCodesSet.add(0x01000000+0x0645); | |
| 358 | + extendedKeyCodesSet.add(0x01000000+0x0646); | |
| 359 | + extendedKeyCodesSet.add(0x01000000+0x0647); | |
| 360 | + extendedKeyCodesSet.add(0x01000000+0x0648); | |
| 361 | + extendedKeyCodesSet.add(0x01000000+0x0649); | |
| 362 | + extendedKeyCodesSet.add(0x01000000+0x064A); | |
| 363 | + extendedKeyCodesSet.add(0x01000000+0x064E); | |
| 364 | + extendedKeyCodesSet.add(0x01000000+0x064F); | |
| 365 | + extendedKeyCodesSet.add(0x01000000+0x0650); | |
| 366 | + extendedKeyCodesSet.add(0x01000000+0x0652); | |
| 367 | + extendedKeyCodesSet.add(0x01000000+0x0698); | |
| 368 | + extendedKeyCodesSet.add(0x01000000+0x06A4); | |
| 369 | + extendedKeyCodesSet.add(0x01000000+0x06A9); | |
| 370 | + extendedKeyCodesSet.add(0x01000000+0x06AF); | |
| 371 | + extendedKeyCodesSet.add(0x01000000+0x06BE); | |
| 372 | + extendedKeyCodesSet.add(0x01000000+0x06CC); | |
| 373 | + extendedKeyCodesSet.add(0x01000000+0x06CC); | |
| 374 | + extendedKeyCodesSet.add(0x01000000+0x06D2); | |
| 375 | + extendedKeyCodesSet.add(0x01000000+0x0493); | |
| 376 | + extendedKeyCodesSet.add(0x01000000+0x0497); | |
| 377 | + extendedKeyCodesSet.add(0x01000000+0x049B); | |
| 378 | + extendedKeyCodesSet.add(0x01000000+0x049D); | |
| 379 | + extendedKeyCodesSet.add(0x01000000+0x04A3); | |
| 380 | + extendedKeyCodesSet.add(0x01000000+0x04AF); | |
| 381 | + extendedKeyCodesSet.add(0x01000000+0x04B1); | |
| 382 | + extendedKeyCodesSet.add(0x01000000+0x04B3); | |
| 383 | + extendedKeyCodesSet.add(0x01000000+0x04B9); | |
| 384 | + extendedKeyCodesSet.add(0x01000000+0x04BB); | |
| 385 | + extendedKeyCodesSet.add(0x01000000+0x04D9); | |
| 386 | + extendedKeyCodesSet.add(0x01000000+0x04E9); | |
| 387 | + extendedKeyCodesSet.add(0x01000000+0x0452); | |
| 388 | + extendedKeyCodesSet.add(0x01000000+0x0453); | |
| 389 | + extendedKeyCodesSet.add(0x01000000+0x0451); | |
| 390 | + extendedKeyCodesSet.add(0x01000000+0x0454); | |
| 391 | + extendedKeyCodesSet.add(0x01000000+0x0455); | |
| 392 | + extendedKeyCodesSet.add(0x01000000+0x0456); | |
| 393 | + extendedKeyCodesSet.add(0x01000000+0x0457); | |
| 394 | + extendedKeyCodesSet.add(0x01000000+0x0458); | |
| 395 | + extendedKeyCodesSet.add(0x01000000+0x0459); | |
| 396 | + extendedKeyCodesSet.add(0x01000000+0x045A); | |
| 397 | + extendedKeyCodesSet.add(0x01000000+0x045B); | |
| 398 | + extendedKeyCodesSet.add(0x01000000+0x045C); | |
| 399 | + extendedKeyCodesSet.add(0x01000000+0x0491); | |
| 400 | + extendedKeyCodesSet.add(0x01000000+0x045E); | |
| 401 | + extendedKeyCodesSet.add(0x01000000+0x045F); | |
| 402 | + extendedKeyCodesSet.add(0x01000000+0x2116); | |
| 403 | + extendedKeyCodesSet.add(0x01000000+0x044E); | |
| 404 | + extendedKeyCodesSet.add(0x01000000+0x0430); | |
| 405 | + extendedKeyCodesSet.add(0x01000000+0x0431); | |
| 406 | + extendedKeyCodesSet.add(0x01000000+0x0446); | |
| 407 | + extendedKeyCodesSet.add(0x01000000+0x0434); | |
| 408 | + extendedKeyCodesSet.add(0x01000000+0x0435); | |
| 409 | + extendedKeyCodesSet.add(0x01000000+0x0444); | |
| 410 | + extendedKeyCodesSet.add(0x01000000+0x0433); | |
| 411 | + extendedKeyCodesSet.add(0x01000000+0x0445); | |
| 412 | + extendedKeyCodesSet.add(0x01000000+0x0438); | |
| 413 | + extendedKeyCodesSet.add(0x01000000+0x0439); | |
| 414 | + extendedKeyCodesSet.add(0x01000000+0x043A); | |
| 415 | + extendedKeyCodesSet.add(0x01000000+0x043B); | |
| 416 | + extendedKeyCodesSet.add(0x01000000+0x043C); | |
| 417 | + extendedKeyCodesSet.add(0x01000000+0x043D); | |
| 418 | + extendedKeyCodesSet.add(0x01000000+0x043E); | |
| 419 | + extendedKeyCodesSet.add(0x01000000+0x043F); | |
| 420 | + extendedKeyCodesSet.add(0x01000000+0x044F); | |
| 421 | + extendedKeyCodesSet.add(0x01000000+0x0440); | |
| 422 | + extendedKeyCodesSet.add(0x01000000+0x0441); | |
| 423 | + extendedKeyCodesSet.add(0x01000000+0x0442); | |
| 424 | + extendedKeyCodesSet.add(0x01000000+0x0443); | |
| 425 | + extendedKeyCodesSet.add(0x01000000+0x0436); | |
| 426 | + extendedKeyCodesSet.add(0x01000000+0x0432); | |
| 427 | + extendedKeyCodesSet.add(0x01000000+0x044C); | |
| 428 | + extendedKeyCodesSet.add(0x01000000+0x044B); | |
| 429 | + extendedKeyCodesSet.add(0x01000000+0x0437); | |
| 430 | + extendedKeyCodesSet.add(0x01000000+0x0448); | |
| 431 | + extendedKeyCodesSet.add(0x01000000+0x044D); | |
| 432 | + extendedKeyCodesSet.add(0x01000000+0x0449); | |
| 433 | + extendedKeyCodesSet.add(0x01000000+0x0447); | |
| 434 | + extendedKeyCodesSet.add(0x01000000+0x044A); | |
| 435 | + extendedKeyCodesSet.add(0x01000000+0x2015); | |
| 436 | + extendedKeyCodesSet.add(0x01000000+0x03B1); | |
| 437 | + extendedKeyCodesSet.add(0x01000000+0x03B2); | |
| 438 | + extendedKeyCodesSet.add(0x01000000+0x03B3); | |
| 439 | + extendedKeyCodesSet.add(0x01000000+0x03B4); | |
| 440 | + extendedKeyCodesSet.add(0x01000000+0x03B5); | |
| 441 | + extendedKeyCodesSet.add(0x01000000+0x03B6); | |
| 442 | + extendedKeyCodesSet.add(0x01000000+0x03B7); | |
| 443 | + extendedKeyCodesSet.add(0x01000000+0x03B8); | |
| 444 | + extendedKeyCodesSet.add(0x01000000+0x03B9); | |
| 445 | + extendedKeyCodesSet.add(0x01000000+0x03BA); | |
| 446 | + extendedKeyCodesSet.add(0x01000000+0x03BB); | |
| 447 | + extendedKeyCodesSet.add(0x01000000+0x03BC); | |
| 448 | + extendedKeyCodesSet.add(0x01000000+0x03BD); | |
| 449 | + extendedKeyCodesSet.add(0x01000000+0x03BE); | |
| 450 | + extendedKeyCodesSet.add(0x01000000+0x03BF); | |
| 451 | + extendedKeyCodesSet.add(0x01000000+0x03C0); | |
| 452 | + extendedKeyCodesSet.add(0x01000000+0x03C1); | |
| 453 | + extendedKeyCodesSet.add(0x01000000+0x03C3); | |
| 454 | + extendedKeyCodesSet.add(0x01000000+0x03C2); | |
| 455 | + extendedKeyCodesSet.add(0x01000000+0x03C4); | |
| 456 | + extendedKeyCodesSet.add(0x01000000+0x03C5); | |
| 457 | + extendedKeyCodesSet.add(0x01000000+0x03C6); | |
| 458 | + extendedKeyCodesSet.add(0x01000000+0x03C7); | |
| 459 | + extendedKeyCodesSet.add(0x01000000+0x03C8); | |
| 460 | + extendedKeyCodesSet.add(0x01000000+0x03C9); | |
| 461 | + extendedKeyCodesSet.add(0x01000000+0x2190); | |
| 462 | + extendedKeyCodesSet.add(0x01000000+0x2192); | |
| 463 | + extendedKeyCodesSet.add(0x01000000+0x2193); | |
| 464 | + extendedKeyCodesSet.add(0x01000000+0x2013); | |
| 465 | + extendedKeyCodesSet.add(0x01000000+0x201C); | |
| 466 | + extendedKeyCodesSet.add(0x01000000+0x201D); | |
| 467 | + extendedKeyCodesSet.add(0x01000000+0x201E); | |
| 468 | + extendedKeyCodesSet.add(0x01000000+0x05D0); | |
| 469 | + extendedKeyCodesSet.add(0x01000000+0x05D1); | |
| 470 | + extendedKeyCodesSet.add(0x01000000+0x05D2); | |
| 471 | + extendedKeyCodesSet.add(0x01000000+0x05D3); | |
| 472 | + extendedKeyCodesSet.add(0x01000000+0x05D4); | |
| 473 | + extendedKeyCodesSet.add(0x01000000+0x05D5); | |
| 474 | + extendedKeyCodesSet.add(0x01000000+0x05D6); | |
| 475 | + extendedKeyCodesSet.add(0x01000000+0x05D7); | |
| 476 | + extendedKeyCodesSet.add(0x01000000+0x05D8); | |
| 477 | + extendedKeyCodesSet.add(0x01000000+0x05D9); | |
| 478 | + extendedKeyCodesSet.add(0x01000000+0x05DA); | |
| 479 | + extendedKeyCodesSet.add(0x01000000+0x05DB); | |
| 480 | + extendedKeyCodesSet.add(0x01000000+0x05DC); | |
| 481 | + extendedKeyCodesSet.add(0x01000000+0x05DD); | |
| 482 | + extendedKeyCodesSet.add(0x01000000+0x05DE); | |
| 483 | + extendedKeyCodesSet.add(0x01000000+0x05DF); | |
| 484 | + extendedKeyCodesSet.add(0x01000000+0x05E0); | |
| 485 | + extendedKeyCodesSet.add(0x01000000+0x05E1); | |
| 486 | + extendedKeyCodesSet.add(0x01000000+0x05E2); | |
| 487 | + extendedKeyCodesSet.add(0x01000000+0x05E3); | |
| 488 | + extendedKeyCodesSet.add(0x01000000+0x05E4); | |
| 489 | + extendedKeyCodesSet.add(0x01000000+0x05E5); | |
| 490 | + extendedKeyCodesSet.add(0x01000000+0x05E6); | |
| 491 | + extendedKeyCodesSet.add(0x01000000+0x05E7); | |
| 492 | + extendedKeyCodesSet.add(0x01000000+0x05E8); | |
| 493 | + extendedKeyCodesSet.add(0x01000000+0x05E9); | |
| 494 | + extendedKeyCodesSet.add(0x01000000+0x05EA); | |
| 495 | + extendedKeyCodesSet.add(0x01000000+0x0E01); | |
| 496 | + extendedKeyCodesSet.add(0x01000000+0x0E02); | |
| 497 | + extendedKeyCodesSet.add(0x01000000+0x0E03); | |
| 498 | + extendedKeyCodesSet.add(0x01000000+0x0E04); | |
| 499 | + extendedKeyCodesSet.add(0x01000000+0x0E05); | |
| 500 | + extendedKeyCodesSet.add(0x01000000+0x0E07); | |
| 501 | + extendedKeyCodesSet.add(0x01000000+0x0E08); | |
| 502 | + extendedKeyCodesSet.add(0x01000000+0x0E0A); | |
| 503 | + extendedKeyCodesSet.add(0x01000000+0x0E0C); | |
| 504 | + extendedKeyCodesSet.add(0x01000000+0x0E14); | |
| 505 | + extendedKeyCodesSet.add(0x01000000+0x0E15); | |
| 506 | + extendedKeyCodesSet.add(0x01000000+0x0E16); | |
| 507 | + extendedKeyCodesSet.add(0x01000000+0x0E17); | |
| 508 | + extendedKeyCodesSet.add(0x01000000+0x0E19); | |
| 509 | + extendedKeyCodesSet.add(0x01000000+0x0E1A); | |
| 510 | + extendedKeyCodesSet.add(0x01000000+0x0E1B); | |
| 511 | + extendedKeyCodesSet.add(0x01000000+0x0E1C); | |
| 512 | + extendedKeyCodesSet.add(0x01000000+0x0E1D); | |
| 513 | + extendedKeyCodesSet.add(0x01000000+0x0E1E); | |
| 514 | + extendedKeyCodesSet.add(0x01000000+0x0E1F); | |
| 515 | + extendedKeyCodesSet.add(0x01000000+0x0E20); | |
| 516 | + extendedKeyCodesSet.add(0x01000000+0x0E21); | |
| 517 | + extendedKeyCodesSet.add(0x01000000+0x0E22); | |
| 518 | + extendedKeyCodesSet.add(0x01000000+0x0E23); | |
| 519 | + extendedKeyCodesSet.add(0x01000000+0x0E25); | |
| 520 | + extendedKeyCodesSet.add(0x01000000+0x0E27); | |
| 521 | + extendedKeyCodesSet.add(0x01000000+0x0E2A); | |
| 522 | + extendedKeyCodesSet.add(0x01000000+0x0E2B); | |
| 523 | + extendedKeyCodesSet.add(0x01000000+0x0E2D); | |
| 524 | + extendedKeyCodesSet.add(0x01000000+0x0E30); | |
| 525 | + extendedKeyCodesSet.add(0x01000000+0x0E31); | |
| 526 | + extendedKeyCodesSet.add(0x01000000+0x0E32); | |
| 527 | + extendedKeyCodesSet.add(0x01000000+0x0E33); | |
| 528 | + extendedKeyCodesSet.add(0x01000000+0x0E34); | |
| 529 | + extendedKeyCodesSet.add(0x01000000+0x0E35); | |
| 530 | + extendedKeyCodesSet.add(0x01000000+0x0E36); | |
| 531 | + extendedKeyCodesSet.add(0x01000000+0x0E37); | |
| 532 | + extendedKeyCodesSet.add(0x01000000+0x0E38); | |
| 533 | + extendedKeyCodesSet.add(0x01000000+0x0E39); | |
| 534 | + extendedKeyCodesSet.add(0x01000000+0x0E3F); | |
| 535 | + extendedKeyCodesSet.add(0x01000000+0x0E40); | |
| 536 | + extendedKeyCodesSet.add(0x01000000+0x0E41); | |
| 537 | + extendedKeyCodesSet.add(0x01000000+0x0E43); | |
| 538 | + extendedKeyCodesSet.add(0x01000000+0x0E44); | |
| 539 | + extendedKeyCodesSet.add(0x01000000+0x0E45); | |
| 540 | + extendedKeyCodesSet.add(0x01000000+0x0E46); | |
| 541 | + extendedKeyCodesSet.add(0x01000000+0x0E47); | |
| 542 | + extendedKeyCodesSet.add(0x01000000+0x0E48); | |
| 543 | + extendedKeyCodesSet.add(0x01000000+0x0E49); | |
| 544 | + extendedKeyCodesSet.add(0x01000000+0x0E50); | |
| 545 | + extendedKeyCodesSet.add(0x01000000+0x0E51); | |
| 546 | + extendedKeyCodesSet.add(0x01000000+0x0E52); | |
| 547 | + extendedKeyCodesSet.add(0x01000000+0x0E53); | |
| 548 | + extendedKeyCodesSet.add(0x01000000+0x0E54); | |
| 549 | + extendedKeyCodesSet.add(0x01000000+0x0E55); | |
| 550 | + extendedKeyCodesSet.add(0x01000000+0x0E56); | |
| 551 | + extendedKeyCodesSet.add(0x01000000+0x0E57); | |
| 552 | + extendedKeyCodesSet.add(0x01000000+0x0E58); | |
| 553 | + extendedKeyCodesSet.add(0x01000000+0x0E59); | |
| 554 | + extendedKeyCodesSet.add(0x01000000+0x0587); | |
| 555 | + extendedKeyCodesSet.add(0x01000000+0x0589); | |
| 556 | + extendedKeyCodesSet.add(0x01000000+0x0589); | |
| 557 | + extendedKeyCodesSet.add(0x01000000+0x055D); | |
| 558 | + extendedKeyCodesSet.add(0x01000000+0x055D); | |
| 559 | + extendedKeyCodesSet.add(0x01000000+0x055B); | |
| 560 | + extendedKeyCodesSet.add(0x01000000+0x055B); | |
| 561 | + extendedKeyCodesSet.add(0x01000000+0x055E); | |
| 562 | + extendedKeyCodesSet.add(0x01000000+0x055E); | |
| 563 | + extendedKeyCodesSet.add(0x01000000+0x0561); | |
| 564 | + extendedKeyCodesSet.add(0x01000000+0x0562); | |
| 565 | + extendedKeyCodesSet.add(0x01000000+0x0563); | |
| 566 | + extendedKeyCodesSet.add(0x01000000+0x0564); | |
| 567 | + extendedKeyCodesSet.add(0x01000000+0x0565); | |
| 568 | + extendedKeyCodesSet.add(0x01000000+0x0566); | |
| 569 | + extendedKeyCodesSet.add(0x01000000+0x0567); | |
| 570 | + extendedKeyCodesSet.add(0x01000000+0x0568); | |
| 571 | + extendedKeyCodesSet.add(0x01000000+0x0569); | |
| 572 | + extendedKeyCodesSet.add(0x01000000+0x056A); | |
| 573 | + extendedKeyCodesSet.add(0x01000000+0x056B); | |
| 574 | + extendedKeyCodesSet.add(0x01000000+0x056C); | |
| 575 | + extendedKeyCodesSet.add(0x01000000+0x056D); | |
| 576 | + extendedKeyCodesSet.add(0x01000000+0x056E); | |
| 577 | + extendedKeyCodesSet.add(0x01000000+0x056F); | |
| 578 | + extendedKeyCodesSet.add(0x01000000+0x0570); | |
| 579 | + extendedKeyCodesSet.add(0x01000000+0x0571); | |
| 580 | + extendedKeyCodesSet.add(0x01000000+0x0572); | |
| 581 | + extendedKeyCodesSet.add(0x01000000+0x0573); | |
| 582 | + extendedKeyCodesSet.add(0x01000000+0x0574); | |
| 583 | + extendedKeyCodesSet.add(0x01000000+0x0575); | |
| 584 | + extendedKeyCodesSet.add(0x01000000+0x0576); | |
| 585 | + extendedKeyCodesSet.add(0x01000000+0x0577); | |
| 586 | + extendedKeyCodesSet.add(0x01000000+0x0578); | |
| 587 | + extendedKeyCodesSet.add(0x01000000+0x0579); | |
| 588 | + extendedKeyCodesSet.add(0x01000000+0x057A); | |
| 589 | + extendedKeyCodesSet.add(0x01000000+0x057B); | |
| 590 | + extendedKeyCodesSet.add(0x01000000+0x057C); | |
| 591 | + extendedKeyCodesSet.add(0x01000000+0x057D); | |
| 592 | + extendedKeyCodesSet.add(0x01000000+0x057E); | |
| 593 | + extendedKeyCodesSet.add(0x01000000+0x057F); | |
| 594 | + extendedKeyCodesSet.add(0x01000000+0x0580); | |
| 595 | + extendedKeyCodesSet.add(0x01000000+0x0581); | |
| 596 | + extendedKeyCodesSet.add(0x01000000+0x0582); | |
| 597 | + extendedKeyCodesSet.add(0x01000000+0x0583); | |
| 598 | + extendedKeyCodesSet.add(0x01000000+0x0584); | |
| 599 | + extendedKeyCodesSet.add(0x01000000+0x0585); | |
| 600 | + extendedKeyCodesSet.add(0x01000000+0x0586); | |
| 601 | + extendedKeyCodesSet.add(0x01000000+0x10D0); | |
| 602 | + extendedKeyCodesSet.add(0x01000000+0x10D1); | |
| 603 | + extendedKeyCodesSet.add(0x01000000+0x10D2); | |
| 604 | + extendedKeyCodesSet.add(0x01000000+0x10D3); | |
| 605 | + extendedKeyCodesSet.add(0x01000000+0x10D4); | |
| 606 | + extendedKeyCodesSet.add(0x01000000+0x10D5); | |
| 607 | + extendedKeyCodesSet.add(0x01000000+0x10D6); | |
| 608 | + extendedKeyCodesSet.add(0x01000000+0x10D7); | |
| 609 | + extendedKeyCodesSet.add(0x01000000+0x10D8); | |
| 610 | + extendedKeyCodesSet.add(0x01000000+0x10D9); | |
| 611 | + extendedKeyCodesSet.add(0x01000000+0x10DA); | |
| 612 | + extendedKeyCodesSet.add(0x01000000+0x10DB); | |
| 613 | + extendedKeyCodesSet.add(0x01000000+0x10DC); | |
| 614 | + extendedKeyCodesSet.add(0x01000000+0x10DD); | |
| 615 | + extendedKeyCodesSet.add(0x01000000+0x10DE); | |
| 616 | + extendedKeyCodesSet.add(0x01000000+0x10DF); | |
| 617 | + extendedKeyCodesSet.add(0x01000000+0x10E0); | |
| 618 | + extendedKeyCodesSet.add(0x01000000+0x10E1); | |
| 619 | + extendedKeyCodesSet.add(0x01000000+0x10E2); | |
| 620 | + extendedKeyCodesSet.add(0x01000000+0x10E3); | |
| 621 | + extendedKeyCodesSet.add(0x01000000+0x10E4); | |
| 622 | + extendedKeyCodesSet.add(0x01000000+0x10E5); | |
| 623 | + extendedKeyCodesSet.add(0x01000000+0x10E6); | |
| 624 | + extendedKeyCodesSet.add(0x01000000+0x10E7); | |
| 625 | + extendedKeyCodesSet.add(0x01000000+0x10E8); | |
| 626 | + extendedKeyCodesSet.add(0x01000000+0x10E9); | |
| 627 | + extendedKeyCodesSet.add(0x01000000+0x10EA); | |
| 628 | + extendedKeyCodesSet.add(0x01000000+0x10EB); | |
| 629 | + extendedKeyCodesSet.add(0x01000000+0x10EC); | |
| 630 | + extendedKeyCodesSet.add(0x01000000+0x10ED); | |
| 631 | + extendedKeyCodesSet.add(0x01000000+0x10EE); | |
| 632 | + extendedKeyCodesSet.add(0x01000000+0x10EF); | |
| 633 | + extendedKeyCodesSet.add(0x01000000+0x10F0); | |
| 634 | + extendedKeyCodesSet.add(0x01000000+0x01E7); | |
| 635 | + extendedKeyCodesSet.add(0x01000000+0x0259); | |
| 636 | + extendedKeyCodesSet.add(0x01000000+0x1EB9); | |
| 637 | + extendedKeyCodesSet.add(0x01000000+0x1ECB); | |
| 638 | + extendedKeyCodesSet.add(0x01000000+0x1ECD); | |
| 639 | + extendedKeyCodesSet.add(0x01000000+0x1EE5); | |
| 640 | + extendedKeyCodesSet.add(0x01000000+0x01A1); | |
| 641 | + extendedKeyCodesSet.add(0x01000000+0x01B0); | |
| 642 | + extendedKeyCodesSet.add(0x01000000+0x20AB); | |
| 643 | + } | |
| 644 | +} | |
| @@ -0,0 +1,109 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1995, 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 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.awt.*; | |
| 29 | + | |
| 30 | +/** | |
| 31 | + * FocusingTextField: a subclass of java.awt.TextField that handles moving the | |
| 32 | + * input focus from field to field, as when the user hits 'return.' | |
| 33 | + * | |
| 34 | + * @author Herb Jellinek | |
| 35 | + */ | |
| 36 | + | |
| 37 | +public class FocusingTextField extends TextField { | |
| 38 | + | |
| 39 | + /** The field to move to on 'return' - can be null. */ | |
| 40 | + TextField next; | |
| 41 | + | |
| 42 | + /** If true, select the contents of the field when it gets the focus. */ | |
| 43 | + boolean willSelect; | |
| 44 | + | |
| 45 | + /** | |
| 46 | + * Create a FocusingTextField. | |
| 47 | + * @param cols number of columns of text. | |
| 48 | + */ | |
| 49 | + public FocusingTextField(int cols) { | |
| 50 | + super("", cols); | |
| 51 | + } | |
| 52 | + | |
| 53 | + /** | |
| 54 | + * Create a FocusingTextField. | |
| 55 | + * @param cols number of columns of text. | |
| 56 | + * @param willSelect if true, will select all contents of field when | |
| 57 | + * focus is gained. | |
| 58 | + */ | |
| 59 | + public FocusingTextField(int cols, boolean willSelect) { | |
| 60 | + this(cols); | |
| 61 | + this.willSelect = willSelect; | |
| 62 | + } | |
| 63 | + | |
| 64 | + public void setWillSelect(boolean will) { | |
| 65 | + willSelect = will; | |
| 66 | + } | |
| 67 | + | |
| 68 | + public boolean getWillSelect() { | |
| 69 | + return willSelect; | |
| 70 | + } | |
| 71 | + | |
| 72 | + /** | |
| 73 | + * Call this to set the next field to receive the input focus. | |
| 74 | + * @param next the next TextField in order - can be null. | |
| 75 | + */ | |
| 76 | + public void setNextField(TextField next) { | |
| 77 | + this.next = next; | |
| 78 | + } | |
| 79 | + | |
| 80 | + /** | |
| 81 | + * We got the focus. If willSelect is true, select everything. | |
| 82 | + */ | |
| 83 | + public boolean gotFocus(Event e, Object arg) { | |
| 84 | + if (willSelect) { | |
| 85 | + select(0, getText().length()); | |
| 86 | + } | |
| 87 | + return true; | |
| 88 | + } | |
| 89 | + | |
| 90 | + /** | |
| 91 | + * We lost the focus. If willSelect is true, deselect everything. | |
| 92 | + */ | |
| 93 | + public boolean lostFocus(Event e, Object arg) { | |
| 94 | + if (willSelect) { | |
| 95 | + select(0, 0); | |
| 96 | + } | |
| 97 | + return true; | |
| 98 | + } | |
| 99 | + | |
| 100 | + /** | |
| 101 | + * Pass the focus to the next guy, if any. | |
| 102 | + */ | |
| 103 | + public void nextFocus() { | |
| 104 | + if (next != null) { | |
| 105 | + next.requestFocus(); | |
| 106 | + } | |
| 107 | + super.nextFocus(); | |
| 108 | + } | |
| 109 | +} | |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1,2272 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 2000, 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 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.awt.Font; | |
| 29 | +import java.io.DataInputStream; | |
| 30 | +import java.io.DataOutputStream; | |
| 31 | +import java.io.File; | |
| 32 | +import java.io.FileInputStream; | |
| 33 | +import java.io.InputStream; | |
| 34 | +import java.io.IOException; | |
| 35 | +import java.io.OutputStream; | |
| 36 | +import java.nio.charset.Charset; | |
| 37 | +import java.nio.charset.CharsetEncoder; | |
| 38 | +import java.security.AccessController; | |
| 39 | +import java.security.PrivilegedAction; | |
| 40 | +import java.util.Arrays; | |
| 41 | +import java.util.HashMap; | |
| 42 | +import java.util.HashSet; | |
| 43 | +import java.util.Hashtable; | |
| 44 | +import java.util.Locale; | |
| 45 | +import java.util.Map.Entry; | |
| 46 | +import java.util.Properties; | |
| 47 | +import java.util.Set; | |
| 48 | +import java.util.Vector; | |
| 49 | +import sun.font.CompositeFontDescriptor; | |
| 50 | +import sun.font.SunFontManager; | |
| 51 | +import sun.font.FontManagerFactory; | |
| 52 | +import sun.font.FontUtilities; | |
| 53 | +import sun.util.logging.PlatformLogger; | |
| 54 | + | |
| 55 | +/** | |
| 56 | + * Provides the definitions of the five logical fonts: Serif, SansSerif, | |
| 57 | + * Monospaced, Dialog, and DialogInput. The necessary information | |
| 58 | + * is obtained from fontconfig files. | |
| 59 | + */ | |
| 60 | +public abstract class FontConfiguration { | |
| 61 | + | |
| 62 | + //static global runtime env | |
| 63 | + protected static String osVersion; | |
| 64 | + protected static String osName; | |
| 65 | + protected static String encoding; // canonical name of default nio charset | |
| 66 | + protected static Locale startupLocale = null; | |
| 67 | + protected static Hashtable localeMap = null; | |
| 68 | + private static FontConfiguration fontConfig; | |
| 69 | + private static PlatformLogger logger; | |
| 70 | + protected static boolean isProperties = true; | |
| 71 | + | |
| 72 | + protected SunFontManager fontManager; | |
| 73 | + protected boolean preferLocaleFonts; | |
| 74 | + protected boolean preferPropFonts; | |
| 75 | + | |
| 76 | + private File fontConfigFile; | |
| 77 | + private boolean foundOsSpecificFile; | |
| 78 | + private boolean inited; | |
| 79 | + private String javaLib; | |
| 80 | + | |
| 81 | + /* A default FontConfiguration must be created before an alternate | |
| 82 | + * one to ensure proper static initialisation takes place. | |
| 83 | + */ | |
| 84 | + public FontConfiguration(SunFontManager fm) { | |
| 85 | + if (FontUtilities.debugFonts()) { | |
| 86 | + FontUtilities.getLogger() | |
| 87 | + .info("Creating standard Font Configuration"); | |
| 88 | + } | |
| 89 | + if (FontUtilities.debugFonts() && logger == null) { | |
| 90 | + logger = PlatformLogger.getLogger("sun.awt.FontConfiguration"); | |
| 91 | + } | |
| 92 | + fontManager = fm; | |
| 93 | + setOsNameAndVersion(); /* static initialization */ | |
| 94 | + setEncoding(); /* static initialization */ | |
| 95 | + /* Separating out the file location from the rest of the | |
| 96 | + * initialisation, so the caller has the option of doing | |
| 97 | + * something else if a suitable file isn't found. | |
| 98 | + */ | |
| 99 | + findFontConfigFile(); | |
| 100 | + } | |
| 101 | + | |
| 102 | + public synchronized boolean init() { | |
| 103 | + if (!inited) { | |
| 104 | + this.preferLocaleFonts = false; | |
| 105 | + this.preferPropFonts = false; | |
| 106 | + setFontConfiguration(); | |
| 107 | + readFontConfigFile(fontConfigFile); | |
| 108 | + initFontConfig(); | |
| 109 | + inited = true; | |
| 110 | + } | |
| 111 | + return true; | |
| 112 | + } | |
| 113 | + | |
| 114 | + public FontConfiguration(SunFontManager fm, | |
| 115 | + boolean preferLocaleFonts, | |
| 116 | + boolean preferPropFonts) { | |
| 117 | + fontManager = fm; | |
| 118 | + if (FontUtilities.debugFonts()) { | |
| 119 | + FontUtilities.getLogger() | |
| 120 | + .info("Creating alternate Font Configuration"); | |
| 121 | + } | |
| 122 | + this.preferLocaleFonts = preferLocaleFonts; | |
| 123 | + this.preferPropFonts = preferPropFonts; | |
| 124 | + /* fontConfig should be initialised by default constructor, and | |
| 125 | + * its data tables can be shared, since readFontConfigFile doesn't | |
| 126 | + * update any other state. Also avoid a doPrivileged block. | |
| 127 | + */ | |
| 128 | + initFontConfig(); | |
| 129 | + } | |
| 130 | + | |
| 131 | + /** | |
| 132 | + * Fills in this instance's osVersion and osName members. By | |
| 133 | + * default uses the system properties os.name and os.version; | |
| 134 | + * subclasses may override. | |
| 135 | + */ | |
| 136 | + protected void setOsNameAndVersion() { | |
| 137 | + osName = System.getProperty("os.name"); | |
| 138 | + osVersion = System.getProperty("os.version"); | |
| 139 | + } | |
| 140 | + | |
| 141 | + private void setEncoding() { | |
| 142 | + encoding = Charset.defaultCharset().name(); | |
| 143 | + startupLocale = SunToolkit.getStartupLocale(); | |
| 144 | + } | |
| 145 | + | |
| 146 | + ///////////////////////////////////////////////////////////////////// | |
| 147 | + // methods for loading the FontConfig file // | |
| 148 | + ///////////////////////////////////////////////////////////////////// | |
| 149 | + | |
| 150 | + public boolean foundOsSpecificFile() { | |
| 151 | + return foundOsSpecificFile; | |
| 152 | + } | |
| 153 | + | |
| 154 | + /* Smoke test to see if we can trust this configuration by testing if | |
| 155 | + * the first slot of a composite font maps to an installed file. | |
| 156 | + */ | |
| 157 | + public boolean fontFilesArePresent() { | |
| 158 | + init(); | |
| 159 | + short fontNameID = compFontNameIDs[0][0][0]; | |
| 160 | + short fileNameID = getComponentFileID(fontNameID); | |
| 161 | + final String fileName = mapFileName(getComponentFileName(fileNameID)); | |
| 162 | + Boolean exists = (Boolean)java.security.AccessController.doPrivileged( | |
| 163 | + new java.security.PrivilegedAction() { | |
| 164 | + public Object run() { | |
| 165 | + try { | |
| 166 | + File f = new File(fileName); | |
| 167 | + return Boolean.valueOf(f.exists()); | |
| 168 | + } | |
| 169 | + catch (Exception e) { | |
| 170 | + return false; | |
| 171 | + } | |
| 172 | + } | |
| 173 | + }); | |
| 174 | + return exists.booleanValue(); | |
| 175 | + } | |
| 176 | + | |
| 177 | + private void findFontConfigFile() { | |
| 178 | + | |
| 179 | + foundOsSpecificFile = true; // default assumption. | |
| 180 | + String javaHome = System.getProperty("java.home"); | |
| 181 | + if (javaHome == null) { | |
| 182 | + throw new Error("java.home property not set"); | |
| 183 | + } | |
| 184 | + javaLib = javaHome + File.separator + "lib"; | |
| 185 | + String userConfigFile = System.getProperty("sun.awt.fontconfig"); | |
| 186 | + if (userConfigFile != null) { | |
| 187 | + fontConfigFile = new File(userConfigFile); | |
| 188 | + } else { | |
| 189 | + fontConfigFile = findFontConfigFile(javaLib); | |
| 190 | + } | |
| 191 | + } | |
| 192 | + | |
| 193 | + private void readFontConfigFile(File f) { | |
| 194 | + /* This is invoked here as readFontConfigFile is only invoked | |
| 195 | + * once per VM, and always in a privileged context, thus the | |
| 196 | + * directory containing installed fall back fonts is accessed | |
| 197 | + * from this context | |
| 198 | + */ | |
| 199 | + getInstalledFallbackFonts(javaLib); | |
| 200 | + | |
| 201 | + if (f != null) { | |
| 202 | + try { | |
| 203 | + FileInputStream in = new FileInputStream(f.getPath()); | |
| 204 | + if (isProperties) { | |
| 205 | + loadProperties(in); | |
| 206 | + } else { | |
| 207 | + loadBinary(in); | |
| 208 | + } | |
| 209 | + in.close(); | |
| 210 | + if (FontUtilities.debugFonts()) { | |
| 211 | + logger.config("Read logical font configuration from " + f); | |
| 212 | + } | |
| 213 | + } catch (IOException e) { | |
| 214 | + if (FontUtilities.debugFonts()) { | |
| 215 | + logger.config("Failed to read logical font configuration from " + f); | |
| 216 | + } | |
| 217 | + } | |
| 218 | + } | |
| 219 | + String version = getVersion(); | |
| 220 | + if (!"1".equals(version) && FontUtilities.debugFonts()) { | |
| 221 | + logger.config("Unsupported fontconfig version: " + version); | |
| 222 | + } | |
| 223 | + } | |
| 224 | + | |
| 225 | + protected void getInstalledFallbackFonts(String javaLib) { | |
| 226 | + String fallbackDirName = javaLib + File.separator + | |
| 227 | + "fonts" + File.separator + "fallback"; | |
| 228 | + | |
| 229 | + File fallbackDir = new File(fallbackDirName); | |
| 230 | + if (fallbackDir.exists() && fallbackDir.isDirectory()) { | |
| 231 | + String[] ttfs = fallbackDir.list(fontManager.getTrueTypeFilter()); | |
| 232 | + String[] t1s = fallbackDir.list(fontManager.getType1Filter()); | |
| 233 | + int numTTFs = (ttfs == null) ? 0 : ttfs.length; | |
| 234 | + int numT1s = (t1s == null) ? 0 : t1s.length; | |
| 235 | + int len = numTTFs + numT1s; | |
| 236 | + if (numTTFs + numT1s == 0) { | |
| 237 | + return; | |
| 238 | + } | |
| 239 | + installedFallbackFontFiles = new String[len]; | |
| 240 | + for (int i=0; i<numTTFs; i++) { | |
| 241 | + installedFallbackFontFiles[i] = | |
| 242 | + fallbackDir + File.separator + ttfs[i]; | |
| 243 | + } | |
| 244 | + for (int i=0; i<numT1s; i++) { | |
| 245 | + installedFallbackFontFiles[i+numTTFs] = | |
| 246 | + fallbackDir + File.separator + t1s[i]; | |
| 247 | + } | |
| 248 | + fontManager.registerFontsInDir(fallbackDirName); | |
| 249 | + } | |
| 250 | + } | |
| 251 | + | |
| 252 | + private File findImpl(String fname) { | |
| 253 | + File f = new File(fname + ".properties"); | |
| 254 | + if (f.canRead()) { | |
| 255 | + isProperties = true; | |
| 256 | + return f; | |
| 257 | + } | |
| 258 | + f = new File(fname + ".bfc"); | |
| 259 | + if (f.canRead()) { | |
| 260 | + isProperties = false; | |
| 261 | + return f; | |
| 262 | + } | |
| 263 | + return null; | |
| 264 | + } | |
| 265 | + | |
| 266 | + private File findFontConfigFile(String javaLib) { | |
| 267 | + String baseName = javaLib + File.separator + "fontconfig"; | |
| 268 | + File configFile; | |
| 269 | + if (osVersion != null && osName != null) { | |
| 270 | + configFile = findImpl(baseName + "." + osName + "." + osVersion); | |
| 271 | + if (configFile != null) { | |
| 272 | + return configFile; | |
| 273 | + } | |
| 274 | + } | |
| 275 | + if (osName != null) { | |
| 276 | + configFile = findImpl(baseName + "." + osName); | |
| 277 | + if (configFile != null) { | |
| 278 | + return configFile; | |
| 279 | + } | |
| 280 | + } | |
| 281 | + if (osVersion != null) { | |
| 282 | + configFile = findImpl(baseName + "." + osVersion); | |
| 283 | + if (configFile != null) { | |
| 284 | + return configFile; | |
| 285 | + } | |
| 286 | + } | |
| 287 | + foundOsSpecificFile = false; | |
| 288 | + | |
| 289 | + configFile = findImpl(baseName); | |
| 290 | + if (configFile != null) { | |
| 291 | + return configFile; | |
| 292 | + } | |
| 293 | + return null; | |
| 294 | + } | |
| 295 | + | |
| 296 | + /* Initialize the internal data tables from binary format font | |
| 297 | + * configuration file. | |
| 298 | + */ | |
| 299 | + public static void loadBinary(InputStream inStream) throws IOException { | |
| 300 | + DataInputStream in = new DataInputStream(inStream); | |
| 301 | + head = readShortTable(in, HEAD_LENGTH); | |
| 302 | + int[] tableSizes = new int[INDEX_TABLEEND]; | |
| 303 | + for (int i = 0; i < INDEX_TABLEEND; i++) { | |
| 304 | + tableSizes[i] = head[i + 1] - head[i]; | |
| 305 | + } | |
| 306 | + table_scriptIDs = readShortTable(in, tableSizes[INDEX_scriptIDs]); | |
| 307 | + table_scriptFonts = readShortTable(in, tableSizes[INDEX_scriptFonts]); | |
| 308 | + table_elcIDs = readShortTable(in, tableSizes[INDEX_elcIDs]); | |
| 309 | + table_sequences = readShortTable(in, tableSizes[INDEX_sequences]); | |
| 310 | + table_fontfileNameIDs = readShortTable(in, tableSizes[INDEX_fontfileNameIDs]); | |
| 311 | + table_componentFontNameIDs = readShortTable(in, tableSizes[INDEX_componentFontNameIDs]); | |
| 312 | + table_filenames = readShortTable(in, tableSizes[INDEX_filenames]); | |
| 313 | + table_awtfontpaths = readShortTable(in, tableSizes[INDEX_awtfontpaths]); | |
| 314 | + table_exclusions = readShortTable(in, tableSizes[INDEX_exclusions]); | |
| 315 | + table_proportionals = readShortTable(in, tableSizes[INDEX_proportionals]); | |
| 316 | + table_scriptFontsMotif = readShortTable(in, tableSizes[INDEX_scriptFontsMotif]); | |
| 317 | + table_alphabeticSuffix = readShortTable(in, tableSizes[INDEX_alphabeticSuffix]); | |
| 318 | + table_stringIDs = readShortTable(in, tableSizes[INDEX_stringIDs]); | |
| 319 | + | |
| 320 | + //StringTable cache | |
| 321 | + stringCache = new String[table_stringIDs.length + 1]; | |
| 322 | + | |
| 323 | + int len = tableSizes[INDEX_stringTable]; | |
| 324 | + byte[] bb = new byte[len * 2]; | |
| 325 | + table_stringTable = new char[len]; | |
| 326 | + in.read(bb); | |
| 327 | + int i = 0, j = 0; | |
| 328 | + while (i < len) { | |
| 329 | + table_stringTable[i++] = (char)(bb[j++] << 8 | (bb[j++] & 0xff)); | |
| 330 | + } | |
| 331 | + if (verbose) { | |
| 332 | + dump(); | |
| 333 | + } | |
| 334 | + } | |
| 335 | + | |
| 336 | + /* Generate a binary format font configuration from internal data | |
| 337 | + * tables. | |
| 338 | + */ | |
| 339 | + public static void saveBinary(OutputStream out) throws IOException { | |
| 340 | + sanityCheck(); | |
| 341 | + | |
| 342 | + DataOutputStream dataOut = new DataOutputStream(out); | |
| 343 | + writeShortTable(dataOut, head); | |
| 344 | + writeShortTable(dataOut, table_scriptIDs); | |
| 345 | + writeShortTable(dataOut, table_scriptFonts); | |
| 346 | + writeShortTable(dataOut, table_elcIDs); | |
| 347 | + writeShortTable(dataOut, table_sequences); | |
| 348 | + writeShortTable(dataOut, table_fontfileNameIDs); | |
| 349 | + writeShortTable(dataOut, table_componentFontNameIDs); | |
| 350 | + writeShortTable(dataOut, table_filenames); | |
| 351 | + writeShortTable(dataOut, table_awtfontpaths); | |
| 352 | + writeShortTable(dataOut, table_exclusions); | |
| 353 | + writeShortTable(dataOut, table_proportionals); | |
| 354 | + writeShortTable(dataOut, table_scriptFontsMotif); | |
| 355 | + writeShortTable(dataOut, table_alphabeticSuffix); | |
| 356 | + writeShortTable(dataOut, table_stringIDs); | |
| 357 | + //stringTable | |
| 358 | + dataOut.writeChars(new String(table_stringTable)); | |
| 359 | + out.close(); | |
| 360 | + if (verbose) { | |
| 361 | + dump(); | |
| 362 | + } | |
| 363 | + } | |
| 364 | + | |
| 365 | + //private static boolean loadingProperties; | |
| 366 | + private static short stringIDNum; | |
| 367 | + private static short[] stringIDs; | |
| 368 | + private static StringBuilder stringTable; | |
| 369 | + | |
| 370 | + public static void loadProperties(InputStream in) throws IOException { | |
| 371 | + //loadingProperties = true; | |
| 372 | + //StringID starts from "1", "0" is reserved for "not defined" | |
| 373 | + stringIDNum = 1; | |
| 374 | + stringIDs = new short[1000]; | |
| 375 | + stringTable = new StringBuilder(4096); | |
| 376 | + | |
| 377 | + if (verbose && logger == null) { | |
| 378 | + logger = PlatformLogger.getLogger("sun.awt.FontConfiguration"); | |
| 379 | + } | |
| 380 | + new PropertiesHandler().load(in); | |
| 381 | + | |
| 382 | + //loadingProperties = false; | |
| 383 | + stringIDs = null; | |
| 384 | + stringTable = null; | |
| 385 | + } | |
| 386 | + | |
| 387 | + | |
| 388 | + ///////////////////////////////////////////////////////////////////// | |
| 389 | + // methods for initializing the FontConfig // | |
| 390 | + ///////////////////////////////////////////////////////////////////// | |
| 391 | + | |
| 392 | + /** | |
| 393 | + * set initLocale, initEncoding and initELC for this FontConfig object | |
| 394 | + * currently we just simply use the startup locale and encoding | |
| 395 | + */ | |
| 396 | + private void initFontConfig() { | |
| 397 | + initLocale = startupLocale; | |
| 398 | + initEncoding = encoding; | |
| 399 | + if (preferLocaleFonts && !willReorderForStartupLocale()) { | |
| 400 | + preferLocaleFonts = false; | |
| 401 | + } | |
| 402 | + initELC = getInitELC(); | |
| 403 | + initAllComponentFonts(); | |
| 404 | + } | |
| 405 | + | |
| 406 | + //"ELC" stands for "Encoding.Language.Country". This method returns | |
| 407 | + //the ID of the matched elc setting of "initLocale" in elcIDs table. | |
| 408 | + //If no match is found, it returns the default ID, which is | |
| 409 | + //"NULL.NULL.NULL" in elcIDs table. | |
| 410 | + private short getInitELC() { | |
| 411 | + if (initELC != -1) { | |
| 412 | + return initELC; | |
| 413 | + } | |
| 414 | + HashMap <String, Integer> elcIDs = new HashMap<String, Integer>(); | |
| 415 | + for (int i = 0; i < table_elcIDs.length; i++) { | |
| 416 | + elcIDs.put(getString(table_elcIDs[i]), i); | |
| 417 | + } | |
| 418 | + String language = initLocale.getLanguage(); | |
| 419 | + String country = initLocale.getCountry(); | |
| 420 | + String elc; | |
| 421 | + if (elcIDs.containsKey(elc=initEncoding + "." + language + "." + country) | |
| 422 | + || elcIDs.containsKey(elc=initEncoding + "." + language) | |
| 423 | + || elcIDs.containsKey(elc=initEncoding)) { | |
| 424 | + initELC = elcIDs.get(elc).shortValue(); | |
| 425 | + } else { | |
| 426 | + initELC = elcIDs.get("NULL.NULL.NULL").shortValue(); | |
| 427 | + } | |
| 428 | + int i = 0; | |
| 429 | + while (i < table_alphabeticSuffix.length) { | |
| 430 | + if (initELC == table_alphabeticSuffix[i]) { | |
| 431 | + alphabeticSuffix = getString(table_alphabeticSuffix[i + 1]); | |
| 432 | + return initELC; | |
| 433 | + } | |
| 434 | + i += 2; | |
| 435 | + } | |
| 436 | + return initELC; | |
| 437 | + } | |
| 438 | + | |
| 439 | + public static boolean verbose; | |
| 440 | + private short initELC = -1; | |
| 441 | + private Locale initLocale; | |
| 442 | + private String initEncoding; | |
| 443 | + private String alphabeticSuffix; | |
| 444 | + | |
| 445 | + private short[][][] compFontNameIDs = new short[NUM_FONTS][NUM_STYLES][]; | |
| 446 | + private int[][][] compExclusions = new int[NUM_FONTS][][]; | |
| 447 | + private int[] compCoreNum = new int[NUM_FONTS]; | |
| 448 | + | |
| 449 | + private Set<Short> coreFontNameIDs = new HashSet<Short>(); | |
| 450 | + private Set<Short> fallbackFontNameIDs = new HashSet<Short>(); | |
| 451 | + | |
| 452 | + private void initAllComponentFonts() { | |
| 453 | + short[] fallbackScripts = getFallbackScripts(); | |
| 454 | + for (int fontIndex = 0; fontIndex < NUM_FONTS; fontIndex++) { | |
| 455 | + short[] coreScripts = getCoreScripts(fontIndex); | |
| 456 | + compCoreNum[fontIndex] = coreScripts.length; | |
| 457 | + /* | |
| 458 | + System.out.println("coreScriptID=" + table_sequences[initELC * 5 + fontIndex]); | |
| 459 | + for (int i = 0; i < coreScripts.length; i++) { | |
| 460 | + System.out.println(" " + i + " :" + getString(table_scriptIDs[coreScripts[i]])); | |
| 461 | + } | |
| 462 | + */ | |
| 463 | + //init exclusionRanges | |
| 464 | + int[][] exclusions = new int[coreScripts.length][]; | |
| 465 | + for (int i = 0; i < coreScripts.length; i++) { | |
| 466 | + exclusions[i] = getExclusionRanges(coreScripts[i]); | |
| 467 | + } | |
| 468 | + compExclusions[fontIndex] = exclusions; | |
| 469 | + //init componentFontNames | |
| 470 | + for (int styleIndex = 0; styleIndex < NUM_STYLES; styleIndex++) { | |
| 471 | + int index; | |
| 472 | + short[] nameIDs = new short[coreScripts.length + fallbackScripts.length]; | |
| 473 | + //core | |
| 474 | + for (index = 0; index < coreScripts.length; index++) { | |
| 475 | + nameIDs[index] = getComponentFontID(coreScripts[index], | |
| 476 | + fontIndex, styleIndex); | |
| 477 | + if (preferLocaleFonts && localeMap != null && | |
| 478 | + fontManager.usingAlternateFontforJALocales()) { | |
| 479 | + nameIDs[index] = remapLocaleMap(fontIndex, styleIndex, | |
| 480 | + coreScripts[index], nameIDs[index]); | |
| 481 | + } | |
| 482 | + if (preferPropFonts) { | |
| 483 | + nameIDs[index] = remapProportional(fontIndex, nameIDs[index]); | |
| 484 | + } | |
| 485 | + //System.out.println("nameid=" + nameIDs[index]); | |
| 486 | + coreFontNameIDs.add(nameIDs[index]); | |
| 487 | + } | |
| 488 | + //fallback | |
| 489 | + for (int i = 0; i < fallbackScripts.length; i++) { | |
| 490 | + short id = getComponentFontID(fallbackScripts[i], | |
| 491 | + fontIndex, styleIndex); | |
| 492 | + if (preferLocaleFonts && localeMap != null && | |
| 493 | + fontManager.usingAlternateFontforJALocales()) { | |
| 494 | + id = remapLocaleMap(fontIndex, styleIndex, fallbackScripts[i], id); | |
| 495 | + } | |
| 496 | + if (preferPropFonts) { | |
| 497 | + id = remapProportional(fontIndex, id); | |
| 498 | + } | |
| 499 | + if (contains(nameIDs, id, index)) { | |
| 500 | + continue; | |
| 501 | + } | |
| 502 | + /* | |
| 503 | + System.out.println("fontIndex=" + fontIndex + ", styleIndex=" + styleIndex | |
| 504 | + + ", fbIndex=" + i + ",fbS=" + fallbackScripts[i] + ", id=" + id); | |
| 505 | + */ | |
| 506 | + fallbackFontNameIDs.add(id); | |
| 507 | + nameIDs[index++] = id; | |
| 508 | + } | |
| 509 | + if (index < nameIDs.length) { | |
| 510 | + short[] newNameIDs = new short[index]; | |
| 511 | + System.arraycopy(nameIDs, 0, newNameIDs, 0, index); | |
| 512 | + nameIDs = newNameIDs; | |
| 513 | + } | |
| 514 | + compFontNameIDs[fontIndex][styleIndex] = nameIDs; | |
| 515 | + } | |
| 516 | + } | |
| 517 | + } | |
| 518 | + | |
| 519 | + private short remapLocaleMap(int fontIndex, int styleIndex, short scriptID, short fontID) { | |
| 520 | + String scriptName = getString(table_scriptIDs[scriptID]); | |
| 521 | + | |
| 522 | + String value = (String)localeMap.get(scriptName); | |
| 523 | + if (value == null) { | |
| 524 | + String fontName = fontNames[fontIndex]; | |
| 525 | + String styleName = styleNames[styleIndex]; | |
| 526 | + value = (String)localeMap.get(fontName + "." + styleName + "." + scriptName); | |
| 527 | + } | |
| 528 | + if (value == null) { | |
| 529 | + return fontID; | |
| 530 | + } | |
| 531 | + | |
| 532 | + for (int i = 0; i < table_componentFontNameIDs.length; i++) { | |
| 533 | + String name = getString(table_componentFontNameIDs[i]); | |
| 534 | + if (value.equalsIgnoreCase(name)) { | |
| 535 | + fontID = (short)i; | |
| 536 | + break; | |
| 537 | + } | |
| 538 | + } | |
| 539 | + return fontID; | |
| 540 | + } | |
| 541 | + | |
| 542 | + public static boolean hasMonoToPropMap() { | |
| 543 | + return table_proportionals != null && table_proportionals.length != 0; | |
| 544 | + } | |
| 545 | + | |
| 546 | + private short remapProportional(int fontIndex, short id) { | |
| 547 | + if (preferPropFonts && | |
| 548 | + table_proportionals.length != 0 && | |
| 549 | + fontIndex != 2 && //"monospaced" | |
| 550 | + fontIndex != 4) { //"dialoginput" | |
| 551 | + int i = 0; | |
| 552 | + while (i < table_proportionals.length) { | |
| 553 | + if (table_proportionals[i] == id) { | |
| 554 | + return table_proportionals[i + 1]; | |
| 555 | + } | |
| 556 | + i += 2; | |
| 557 | + } | |
| 558 | + } | |
| 559 | + return id; | |
| 560 | + } | |
| 561 | + | |
| 562 | + ///////////////////////////////////////////////////////////////////// | |
| 563 | + // Methods for handling font and style names // | |
| 564 | + ///////////////////////////////////////////////////////////////////// | |
| 565 | + protected static final int NUM_FONTS = 5; | |
| 566 | + protected static final int NUM_STYLES = 4; | |
| 567 | + protected static final String[] fontNames | |
| 568 | + = {"serif", "sansserif", "monospaced", "dialog", "dialoginput"}; | |
| 569 | + protected static final String[] publicFontNames | |
| 570 | + = {Font.SERIF, Font.SANS_SERIF, Font.MONOSPACED, Font.DIALOG, | |
| 571 | + Font.DIALOG_INPUT}; | |
| 572 | + protected static final String[] styleNames | |
| 573 | + = {"plain", "bold", "italic", "bolditalic"}; | |
| 574 | + | |
| 575 | + /** | |
| 576 | + * Checks whether the given font family name is a valid logical font name. | |
| 577 | + * The check is case insensitive. | |
| 578 | + */ | |
| 579 | + public static boolean isLogicalFontFamilyName(String fontName) { | |
| 580 | + return isLogicalFontFamilyNameLC(fontName.toLowerCase(Locale.ENGLISH)); | |
| 581 | + } | |
| 582 | + | |
| 583 | + /** | |
| 584 | + * Checks whether the given font family name is a valid logical font name. | |
| 585 | + * The check is case sensitive. | |
| 586 | + */ | |
| 587 | + public static boolean isLogicalFontFamilyNameLC(String fontName) { | |
| 588 | + for (int i = 0; i < fontNames.length; i++) { | |
| 589 | + if (fontName.equals(fontNames[i])) { | |
| 590 | + return true; | |
| 591 | + } | |
| 592 | + } | |
| 593 | + return false; | |
| 594 | + } | |
| 595 | + | |
| 596 | + /** | |
| 597 | + * Checks whether the given style name is a valid logical font style name. | |
| 598 | + */ | |
| 599 | + private static boolean isLogicalFontStyleName(String styleName) { | |
| 600 | + for (int i = 0; i < styleNames.length; i++) { | |
| 601 | + if (styleName.equals(styleNames[i])) { | |
| 602 | + return true; | |
| 603 | + } | |
| 604 | + } | |
| 605 | + return false; | |
| 606 | + } | |
| 607 | + | |
| 608 | + /** | |
| 609 | + * Checks whether the given font face name is a valid logical font name. | |
| 610 | + * The check is case insensitive. | |
| 611 | + */ | |
| 612 | + public static boolean isLogicalFontFaceName(String fontName) { | |
| 613 | + return isLogicalFontFaceNameLC(fontName.toLowerCase(Locale.ENGLISH)); | |
| 614 | + } | |
| 615 | + | |
| 616 | + /** | |
| 617 | + * Checks whether the given font face name is a valid logical font name. | |
| 618 | + * The check is case sensitive. | |
| 619 | + */ | |
| 620 | + public static boolean isLogicalFontFaceNameLC(String fontName) { | |
| 621 | + int period = fontName.indexOf('.'); | |
| 622 | + if (period >= 0) { | |
| 623 | + String familyName = fontName.substring(0, period); | |
| 624 | + String styleName = fontName.substring(period + 1); | |
| 625 | + return isLogicalFontFamilyName(familyName) && | |
| 626 | + isLogicalFontStyleName(styleName); | |
| 627 | + } else { | |
| 628 | + return isLogicalFontFamilyName(fontName); | |
| 629 | + } | |
| 630 | + } | |
| 631 | + | |
| 632 | + protected static int getFontIndex(String fontName) { | |
| 633 | + return getArrayIndex(fontNames, fontName); | |
| 634 | + } | |
| 635 | + | |
| 636 | + protected static int getStyleIndex(String styleName) { | |
| 637 | + return getArrayIndex(styleNames, styleName); | |
| 638 | + } | |
| 639 | + | |
| 640 | + private static int getArrayIndex(String[] names, String name) { | |
| 641 | + for (int i = 0; i < names.length; i++) { | |
| 642 | + if (name.equals(names[i])) { | |
| 643 | + return i; | |
| 644 | + } | |
| 645 | + } | |
| 646 | + assert false; | |
| 647 | + return 0; | |
| 648 | + } | |
| 649 | + | |
| 650 | + protected static int getStyleIndex(int style) { | |
| 651 | + switch (style) { | |
| 652 | + case Font.PLAIN: | |
| 653 | + return 0; | |
| 654 | + case Font.BOLD: | |
| 655 | + return 1; | |
| 656 | + case Font.ITALIC: | |
| 657 | + return 2; | |
| 658 | + case Font.BOLD | Font.ITALIC: | |
| 659 | + return 3; | |
| 660 | + default: | |
| 661 | + return 0; | |
| 662 | + } | |
| 663 | + } | |
| 664 | + | |
| 665 | + protected static String getFontName(int fontIndex) { | |
| 666 | + return fontNames[fontIndex]; | |
| 667 | + } | |
| 668 | + | |
| 669 | + protected static String getStyleName(int styleIndex) { | |
| 670 | + return styleNames[styleIndex]; | |
| 671 | + } | |
| 672 | + | |
| 673 | + /** | |
| 674 | + * Returns the font face name for the given logical font | |
| 675 | + * family name and style. | |
| 676 | + * The style argument is interpreted as in java.awt.Font.Font. | |
| 677 | + */ | |
| 678 | + public static String getLogicalFontFaceName(String familyName, int style) { | |
| 679 | + assert isLogicalFontFamilyName(familyName); | |
| 680 | + return familyName.toLowerCase(Locale.ENGLISH) + "." + getStyleString(style); | |
| 681 | + } | |
| 682 | + | |
| 683 | + /** | |
| 684 | + * Returns the string typically used in properties files | |
| 685 | + * for the given style. | |
| 686 | + * The style argument is interpreted as in java.awt.Font.Font. | |
| 687 | + */ | |
| 688 | + public static String getStyleString(int style) { | |
| 689 | + return getStyleName(getStyleIndex(style)); | |
| 690 | + } | |
| 691 | + | |
| 692 | + /** | |
| 693 | + * Returns a fallback name for the given font name. For a few known | |
| 694 | + * font names, matching logical font names are returned. For all | |
| 695 | + * other font names, defaultFallback is returned. | |
| 696 | + * defaultFallback differs between AWT and 2D. | |
| 697 | + */ | |
| 698 | + public abstract String getFallbackFamilyName(String fontName, String defaultFallback); | |
| 699 | + | |
| 700 | + /** | |
| 701 | + * Returns the 1.1 equivalent for some old 1.0 font family names for | |
| 702 | + * which we need to maintain compatibility in some configurations. | |
| 703 | + * Returns null for other font names. | |
| 704 | + */ | |
| 705 | + protected String getCompatibilityFamilyName(String fontName) { | |
| 706 | + fontName = fontName.toLowerCase(Locale.ENGLISH); | |
| 707 | + if (fontName.equals("timesroman")) { | |
| 708 | + return "serif"; | |
| 709 | + } else if (fontName.equals("helvetica")) { | |
| 710 | + return "sansserif"; | |
| 711 | + } else if (fontName.equals("courier")) { | |
| 712 | + return "monospaced"; | |
| 713 | + } | |
| 714 | + return null; | |
| 715 | + } | |
| 716 | + | |
| 717 | + protected static String[] installedFallbackFontFiles = null; | |
| 718 | + | |
| 719 | + /** | |
| 720 | + * Maps a file name given in the font configuration file | |
| 721 | + * to a format appropriate for the platform. | |
| 722 | + */ | |
| 723 | + protected String mapFileName(String fileName) { | |
| 724 | + return fileName; | |
| 725 | + } | |
| 726 | + | |
| 727 | + ////////////////////////////////////////////////////////////////////// | |
| 728 | + // reordering // | |
| 729 | + ////////////////////////////////////////////////////////////////////// | |
| 730 | + | |
| 731 | + /* Mappings from file encoding to font config name for font supporting | |
| 732 | + * the corresponding language. This is filled in by initReorderMap() | |
| 733 | + */ | |
| 734 | + protected HashMap reorderMap = null; | |
| 735 | + | |
| 736 | + /* Platform-specific mappings */ | |
| 737 | + protected abstract void initReorderMap(); | |
| 738 | + | |
| 739 | + /* Move item at index "src" to "dst", shuffling all values in | |
| 740 | + * between down | |
| 741 | + */ | |
| 742 | + private void shuffle(String[] seq, int src, int dst) { | |
| 743 | + if (dst >= src) { | |
| 744 | + return; | |
| 745 | + } | |
| 746 | + String tmp = seq[src]; | |
| 747 | + for (int i=src; i>dst; i--) { | |
| 748 | + seq[i] = seq[i-1]; | |
| 749 | + } | |
| 750 | + seq[dst] = tmp; | |
| 751 | + } | |
| 752 | + | |
| 753 | + /* Called to determine if there's a re-order sequence for this locale/ | |
| 754 | + * encoding. If there's none then the caller can "bail" and avoid | |
| 755 | + * unnecessary work | |
| 756 | + */ | |
| 757 | + public static boolean willReorderForStartupLocale() { | |
| 758 | + return getReorderSequence() != null; | |
| 759 | + } | |
| 760 | + | |
| 761 | + private static Object getReorderSequence() { | |
| 762 | + if (fontConfig.reorderMap == null) { | |
| 763 | + fontConfig.initReorderMap(); | |
| 764 | + } | |
| 765 | + HashMap reorderMap = fontConfig.reorderMap; | |
| 766 | + | |
| 767 | + /* Find the most specific mapping */ | |
| 768 | + String language = startupLocale.getLanguage(); | |
| 769 | + String country = startupLocale.getCountry(); | |
| 770 | + Object val = reorderMap.get(encoding + "." + language + "." + country); | |
| 771 | + if (val == null) { | |
| 772 | + val = reorderMap.get(encoding + "." + language); | |
| 773 | + } | |
| 774 | + if (val == null) { | |
| 775 | + val = reorderMap.get(encoding); | |
| 776 | + } | |
| 777 | + return val; | |
| 778 | + } | |
| 779 | + | |
| 780 | + /* This method reorders the sequence such that the matches for the | |
| 781 | + * file encoding are moved ahead of other elements. | |
| 782 | + * If an encoding uses more than one font, they are all moved up. | |
| 783 | + */ | |
| 784 | + private void reorderSequenceForLocale(String[] seq) { | |
| 785 | + Object val = getReorderSequence(); | |
| 786 | + if (val instanceof String) { | |
| 787 | + for (int i=0; i< seq.length; i++) { | |
| 788 | + if (seq[i].equals(val)) { | |
| 789 | + shuffle(seq, i, 0); | |
| 790 | + return; | |
| 791 | + } | |
| 792 | + } | |
| 793 | + } else if (val instanceof String[]) { | |
| 794 | + String[] fontLangs = (String[])val; | |
| 795 | + for (int l=0; l<fontLangs.length;l++) { | |
| 796 | + for (int i=0; i<seq.length;i++) { | |
| 797 | + if (seq[i].equals(fontLangs[l])) { | |
| 798 | + shuffle(seq, i, l); | |
| 799 | + } | |
| 800 | + } | |
| 801 | + } | |
| 802 | + } | |
| 803 | + } | |
| 804 | + | |
| 805 | + private static Vector splitSequence(String sequence) { | |
| 806 | + //String.split would be more convenient, but incurs big performance penalty | |
| 807 | + Vector parts = new Vector(); | |
| 808 | + int start = 0; | |
| 809 | + int end; | |
| 810 | + while ((end = sequence.indexOf(',', start)) >= 0) { | |
| 811 | + parts.add(sequence.substring(start, end)); | |
| 812 | + start = end + 1; | |
| 813 | + } | |
| 814 | + if (sequence.length() > start) { | |
| 815 | + parts.add(sequence.substring(start, sequence.length())); | |
| 816 | + } | |
| 817 | + return parts; | |
| 818 | + } | |
| 819 | + | |
| 820 | + protected String[] split(String sequence) { | |
| 821 | + Vector v = splitSequence(sequence); | |
| 822 | + return (String[])v.toArray(new String[0]); | |
| 823 | + } | |
| 824 | + | |
| 825 | + //////////////////////////////////////////////////////////////////////// | |
| 826 | + // Methods for extracting information from the fontconfig data for AWT// | |
| 827 | + //////////////////////////////////////////////////////////////////////// | |
| 828 | + private Hashtable charsetRegistry = new Hashtable(5); | |
| 829 | + | |
| 830 | + /** | |
| 831 | + * Returns FontDescriptors describing the physical fonts used for the | |
| 832 | + * given logical font name and style. The font name is interpreted | |
| 833 | + * in a case insensitive way. | |
| 834 | + * The style argument is interpreted as in java.awt.Font.Font. | |
| 835 | + */ | |
| 836 | + public FontDescriptor[] getFontDescriptors(String fontName, int style) { | |
| 837 | + assert isLogicalFontFamilyName(fontName); | |
| 838 | + fontName = fontName.toLowerCase(Locale.ENGLISH); | |
| 839 | + int fontIndex = getFontIndex(fontName); | |
| 840 | + int styleIndex = getStyleIndex(style); | |
| 841 | + return getFontDescriptors(fontIndex, styleIndex); | |
| 842 | + } | |
| 843 | + private FontDescriptor[][][] fontDescriptors = | |
| 844 | + new FontDescriptor[NUM_FONTS][NUM_STYLES][]; | |
| 845 | + | |
| 846 | + private FontDescriptor[] getFontDescriptors(int fontIndex, int styleIndex) { | |
| 847 | + FontDescriptor[] descriptors = fontDescriptors[fontIndex][styleIndex]; | |
| 848 | + if (descriptors == null) { | |
| 849 | + descriptors = buildFontDescriptors(fontIndex, styleIndex); | |
| 850 | + fontDescriptors[fontIndex][styleIndex] = descriptors; | |
| 851 | + } | |
| 852 | + return descriptors; | |
| 853 | + } | |
| 854 | + | |
| 855 | + private FontDescriptor[] buildFontDescriptors(int fontIndex, int styleIndex) { | |
| 856 | + String fontName = fontNames[fontIndex]; | |
| 857 | + String styleName = styleNames[styleIndex]; | |
| 858 | + | |
| 859 | + short[] scriptIDs = getCoreScripts(fontIndex); | |
| 860 | + short[] nameIDs = compFontNameIDs[fontIndex][styleIndex]; | |
| 861 | + String[] sequence = new String[scriptIDs.length]; | |
| 862 | + String[] names = new String[scriptIDs.length]; | |
| 863 | + for (int i = 0; i < sequence.length; i++) { | |
| 864 | + names[i] = getComponentFontName(nameIDs[i]); | |
| 865 | + sequence[i] = getScriptName(scriptIDs[i]); | |
| 866 | + if (alphabeticSuffix != null && "alphabetic".equals(sequence[i])) { | |
| 867 | + sequence[i] = sequence[i] + "/" + alphabeticSuffix; | |
| 868 | + } | |
| 869 | + } | |
| 870 | + int[][] fontExclusionRanges = compExclusions[fontIndex]; | |
| 871 | + | |
| 872 | + FontDescriptor[] descriptors = new FontDescriptor[names.length]; | |
| 873 | + | |
| 874 | + for (int i = 0; i < names.length; i++) { | |
| 875 | + String awtFontName; | |
| 876 | + String encoding; | |
| 877 | + | |
| 878 | + awtFontName = makeAWTFontName(names[i], sequence[i]); | |
| 879 | + | |
| 880 | + // look up character encoding | |
| 881 | + encoding = getEncoding(names[i], sequence[i]); | |
| 882 | + if (encoding == null) { | |
| 883 | + encoding = "default"; | |
| 884 | + } | |
| 885 | + CharsetEncoder enc | |
| 886 | + = getFontCharsetEncoder(encoding.trim(), awtFontName); | |
| 887 | + | |
| 888 | + // we already have the exclusion ranges | |
| 889 | + int[] exclusionRanges = fontExclusionRanges[i]; | |
| 890 | + | |
| 891 | + // create descriptor | |
| 892 | + descriptors[i] = new FontDescriptor(awtFontName, enc, exclusionRanges); | |
| 893 | + } | |
| 894 | + return descriptors; | |
| 895 | + } | |
| 896 | + | |
| 897 | + /** | |
| 898 | + * Returns the AWT font name for the given platform font name and | |
| 899 | + * character subset. | |
| 900 | + */ | |
| 901 | + protected String makeAWTFontName(String platformFontName, | |
| 902 | + String characterSubsetName) { | |
| 903 | + return platformFontName; | |
| 904 | + } | |
| 905 | + | |
| 906 | + /** | |
| 907 | + * Returns the java.io name of the platform character encoding for the | |
| 908 | + * given AWT font name and character subset. May return "default" | |
| 909 | + * to indicate that getDefaultFontCharset should be called to obtain | |
| 910 | + * a charset encoder. | |
| 911 | + */ | |
| 912 | + protected abstract String getEncoding(String awtFontName, | |
| 913 | + String characterSubsetName); | |
| 914 | + | |
| 915 | + private CharsetEncoder getFontCharsetEncoder(final String charsetName, | |
| 916 | + String fontName) { | |
| 917 | + | |
| 918 | + Charset fc = null; | |
| 919 | + if (charsetName.equals("default")) { | |
| 920 | + fc = (Charset) charsetRegistry.get(fontName); | |
| 921 | + } else { | |
| 922 | + fc = (Charset) charsetRegistry.get(charsetName); | |
| 923 | + } | |
| 924 | + if (fc != null) { | |
| 925 | + return fc.newEncoder(); | |
| 926 | + } | |
| 927 | + | |
| 928 | + if (!charsetName.startsWith("sun.awt.") && !charsetName.equals("default")) { | |
| 929 | + fc = Charset.forName(charsetName); | |
| 930 | + } else { | |
| 931 | + Class fcc = (Class) AccessController.doPrivileged(new PrivilegedAction() { | |
| 932 | + public Object run() { | |
| 933 | + try { | |
| 934 | + return Class.forName(charsetName, true, | |
| 935 | + Thread.currentThread().getContextClassLoader()); | |
| 936 | + } catch (ClassNotFoundException e) { | |
| 937 | + } | |
| 938 | + return null; | |
| 939 | + } | |
| 940 | + }); | |
| 941 | + | |
| 942 | + if (fcc != null) { | |
| 943 | + try { | |
| 944 | + fc = (Charset) fcc.newInstance(); | |
| 945 | + } catch (Exception e) { | |
| 946 | + } | |
| 947 | + } | |
| 948 | + } | |
| 949 | + if (fc == null) { | |
| 950 | + fc = getDefaultFontCharset(fontName); | |
| 951 | + } | |
| 952 | + | |
| 953 | + if (charsetName.equals("default")){ | |
| 954 | + charsetRegistry.put(fontName, fc); | |
| 955 | + } else { | |
| 956 | + charsetRegistry.put(charsetName, fc); | |
| 957 | + } | |
| 958 | + return fc.newEncoder(); | |
| 959 | + } | |
| 960 | + | |
| 961 | + protected abstract Charset getDefaultFontCharset( | |
| 962 | + String fontName); | |
| 963 | + | |
| 964 | + /* This retrieves the platform font directories (path) calculated | |
| 965 | + * by setAWTFontPathSequence(String[]). The default implementation | |
| 966 | + * returns null, its expected that X11 platforms may return | |
| 967 | + * non-null. | |
| 968 | + */ | |
| 969 | + public HashSet<String> getAWTFontPathSet() { | |
| 970 | + return null; | |
| 971 | + } | |
| 972 | + | |
| 973 | + //////////////////////////////////////////////////////////////////////// | |
| 974 | + // methods for extracting information from the fontconfig data for 2D // | |
| 975 | + //////////////////////////////////////////////////////////////////////// | |
| 976 | + | |
| 977 | + /** | |
| 978 | + * Returns an array of composite font descriptors for all logical font | |
| 979 | + * faces. | |
| 980 | + * If the font configuration file doesn't specify Lucida Sans Regular | |
| 981 | + * or the given fallback font as component fonts, they are added here. | |
| 982 | + */ | |
| 983 | + public CompositeFontDescriptor[] get2DCompositeFontInfo() { | |
| 984 | + CompositeFontDescriptor[] result = | |
| 985 | + new CompositeFontDescriptor[NUM_FONTS * NUM_STYLES]; | |
| 986 | + String defaultFontFile = fontManager.getDefaultFontFile(); | |
| 987 | + String defaultFontFaceName = fontManager.getDefaultFontFaceName(); | |
| 988 | + | |
| 989 | + for (int fontIndex = 0; fontIndex < NUM_FONTS; fontIndex++) { | |
| 990 | + String fontName = publicFontNames[fontIndex]; | |
| 991 | + | |
| 992 | + // determine exclusion ranges for font | |
| 993 | + // AWT uses separate exclusion range array per component font. | |
| 994 | + // 2D packs all range boundaries into one array. | |
| 995 | + // Both use separate entries for lower and upper boundary. | |
| 996 | + int[][] exclusions = compExclusions[fontIndex]; | |
| 997 | + int numExclusionRanges = 0; | |
| 998 | + for (int i = 0; i < exclusions.length; i++) { | |
| 999 | + numExclusionRanges += exclusions[i].length; | |
| 1000 | + } | |
| 1001 | + int[] exclusionRanges = new int[numExclusionRanges]; | |
| 1002 | + int[] exclusionRangeLimits = new int[exclusions.length]; | |
| 1003 | + int exclusionRangeIndex = 0; | |
| 1004 | + int exclusionRangeLimitIndex = 0; | |
| 1005 | + for (int i = 0; i < exclusions.length; i++) { | |
| 1006 | + int[] componentRanges = exclusions[i]; | |
| 1007 | + for (int j = 0; j < componentRanges.length; ) { | |
| 1008 | + int value = componentRanges[j]; | |
| 1009 | + exclusionRanges[exclusionRangeIndex++] = componentRanges[j++]; | |
| 1010 | + exclusionRanges[exclusionRangeIndex++] = componentRanges[j++]; | |
| 1011 | + } | |
| 1012 | + exclusionRangeLimits[i] = exclusionRangeIndex; | |
| 1013 | + } | |
| 1014 | + // other info is per style | |
| 1015 | + for (int styleIndex = 0; styleIndex < NUM_STYLES; styleIndex++) { | |
| 1016 | + int maxComponentFontCount = compFontNameIDs[fontIndex][styleIndex].length; | |
| 1017 | + boolean sawDefaultFontFile = false; | |
| 1018 | + // fall back fonts listed in the lib/fonts/fallback directory | |
| 1019 | + if (installedFallbackFontFiles != null) { | |
| 1020 | + maxComponentFontCount += installedFallbackFontFiles.length; | |
| 1021 | + } | |
| 1022 | + String faceName = fontName + "." + styleNames[styleIndex]; | |
| 1023 | + | |
| 1024 | + // determine face names and file names of component fonts | |
| 1025 | + String[] componentFaceNames = new String[maxComponentFontCount]; | |
| 1026 | + String[] componentFileNames = new String[maxComponentFontCount]; | |
| 1027 | + | |
| 1028 | + int index; | |
| 1029 | + for (index = 0; index < compFontNameIDs[fontIndex][styleIndex].length; index++) { | |
| 1030 | + short fontNameID = compFontNameIDs[fontIndex][styleIndex][index]; | |
| 1031 | + short fileNameID = getComponentFileID(fontNameID); | |
| 1032 | + componentFaceNames[index] = getFaceNameFromComponentFontName(getComponentFontName(fontNameID)); | |
| 1033 | + componentFileNames[index] = mapFileName(getComponentFileName(fileNameID)); | |
| 1034 | + if (componentFileNames[index] == null || | |
| 1035 | + needToSearchForFile(componentFileNames[index])) { | |
| 1036 | + componentFileNames[index] = getFileNameFromComponentFontName(getComponentFontName(fontNameID)); | |
| 1037 | + } | |
| 1038 | + if (!sawDefaultFontFile && | |
| 1039 | + defaultFontFile.equals(componentFileNames[index])) { | |
| 1040 | + sawDefaultFontFile = true; | |
| 1041 | + } | |
| 1042 | + /* | |
| 1043 | + System.out.println(publicFontNames[fontIndex] + "." + styleNames[styleIndex] + "." | |
| 1044 | + + getString(table_scriptIDs[coreScripts[index]]) + "=" + componentFileNames[index]); | |
| 1045 | + */ | |
| 1046 | + } | |
| 1047 | + | |
| 1048 | + //"Lucida Sans Regular" is not in the list, we add it here | |
| 1049 | + if (!sawDefaultFontFile) { | |
| 1050 | + int len = 0; | |
| 1051 | + if (installedFallbackFontFiles != null) { | |
| 1052 | + len = installedFallbackFontFiles.length; | |
| 1053 | + } | |
| 1054 | + if (index + len == maxComponentFontCount) { | |
| 1055 | + String[] newComponentFaceNames = new String[maxComponentFontCount + 1]; | |
| 1056 | + System.arraycopy(componentFaceNames, 0, newComponentFaceNames, 0, index); | |
| 1057 | + componentFaceNames = newComponentFaceNames; | |
| 1058 | + String[] newComponentFileNames = new String[maxComponentFontCount + 1]; | |
| 1059 | + System.arraycopy(componentFileNames, 0, newComponentFileNames, 0, index); | |
| 1060 | + componentFileNames = newComponentFileNames; | |
| 1061 | + } | |
| 1062 | + componentFaceNames[index] = defaultFontFaceName; | |
| 1063 | + componentFileNames[index] = defaultFontFile; | |
| 1064 | + index++; | |
| 1065 | + } | |
| 1066 | + | |
| 1067 | + if (installedFallbackFontFiles != null) { | |
| 1068 | + for (int ifb=0; ifb<installedFallbackFontFiles.length; ifb++) { | |
| 1069 | + componentFaceNames[index] = null; | |
| 1070 | + componentFileNames[index] = installedFallbackFontFiles[ifb]; | |
| 1071 | + index++; | |
| 1072 | + } | |
| 1073 | + } | |
| 1074 | + | |
| 1075 | + if (index < maxComponentFontCount) { | |
| 1076 | + String[] newComponentFaceNames = new String[index]; | |
| 1077 | + System.arraycopy(componentFaceNames, 0, newComponentFaceNames, 0, index); | |
| 1078 | + componentFaceNames = newComponentFaceNames; | |
| 1079 | + String[] newComponentFileNames = new String[index]; | |
| 1080 | + System.arraycopy(componentFileNames, 0, newComponentFileNames, 0, index); | |
| 1081 | + componentFileNames = newComponentFileNames; | |
| 1082 | + } | |
| 1083 | + // exclusion range limit array length must match component face name | |
| 1084 | + // array length - native code relies on this | |
| 1085 | + | |
| 1086 | + int[] clippedExclusionRangeLimits = exclusionRangeLimits; | |
| 1087 | + if (index != clippedExclusionRangeLimits.length) { | |
| 1088 | + int len = exclusionRangeLimits.length; | |
| 1089 | + clippedExclusionRangeLimits = new int[index]; | |
| 1090 | + System.arraycopy(exclusionRangeLimits, 0, clippedExclusionRangeLimits, 0, len); | |
| 1091 | + //padding for various fallback fonts | |
| 1092 | + for (int i = len; i < index; i++) { | |
| 1093 | + clippedExclusionRangeLimits[i] = exclusionRanges.length; | |
| 1094 | + } | |
| 1095 | + } | |
| 1096 | + /* | |
| 1097 | + System.out.println(faceName + ":"); | |
| 1098 | + for (int i = 0; i < componentFileNames.length; i++) { | |
| 1099 | + System.out.println(" " + componentFaceNames[i] | |
| 1100 | + + " -> " + componentFileNames[i]); | |
| 1101 | + } | |
| 1102 | + */ | |
| 1103 | + result[fontIndex * NUM_STYLES + styleIndex] | |
| 1104 | + = new CompositeFontDescriptor( | |
| 1105 | + faceName, | |
| 1106 | + compCoreNum[fontIndex], | |
| 1107 | + componentFaceNames, | |
| 1108 | + componentFileNames, | |
| 1109 | + exclusionRanges, | |
| 1110 | + clippedExclusionRangeLimits); | |
| 1111 | + } | |
| 1112 | + } | |
| 1113 | + return result; | |
| 1114 | + } | |
| 1115 | + | |
| 1116 | + protected abstract String getFaceNameFromComponentFontName(String componentFontName); | |
| 1117 | + protected abstract String getFileNameFromComponentFontName(String componentFontName); | |
| 1118 | + | |
| 1119 | + /* | |
| 1120 | + public class 2dFont { | |
| 1121 | + public String platformName; | |
| 1122 | + public String fontfileName; | |
| 1123 | + } | |
| 1124 | + private 2dFont [] componentFonts = null; | |
| 1125 | + */ | |
| 1126 | + | |
| 1127 | + /* Used on Linux to test if a file referenced in a font configuration | |
| 1128 | + * file exists in the location that is expected. If it does, no need | |
| 1129 | + * to search for it. If it doesn't then unless its a fallback font, | |
| 1130 | + * return that expensive code should be invoked to search for the font. | |
| 1131 | + */ | |
| 1132 | + HashMap<String, Boolean> existsMap; | |
| 1133 | + public boolean needToSearchForFile(String fileName) { | |
| 1134 | + if (!FontUtilities.isLinux) { | |
| 1135 | + return false; | |
| 1136 | + } else if (existsMap == null) { | |
| 1137 | + existsMap = new HashMap<String, Boolean>(); | |
| 1138 | + } | |
| 1139 | + Boolean exists = existsMap.get(fileName); | |
| 1140 | + if (exists == null) { | |
| 1141 | + /* call getNumberCoreFonts() to ensure these are initialised, and | |
| 1142 | + * if this file isn't for a core component, ie, is a for a fallback | |
| 1143 | + * font which very typically isn't available, then can't afford | |
| 1144 | + * to take the start-up penalty to search for it. | |
| 1145 | + */ | |
| 1146 | + getNumberCoreFonts(); | |
| 1147 | + if (!coreFontFileNames.contains(fileName)) { | |
| 1148 | + exists = Boolean.TRUE; | |
| 1149 | + } else { | |
| 1150 | + exists = Boolean.valueOf((new File(fileName)).exists()); | |
| 1151 | + existsMap.put(fileName, exists); | |
| 1152 | + if (FontUtilities.debugFonts() && | |
| 1153 | + exists == Boolean.FALSE) { | |
| 1154 | + logger.warning("Couldn't locate font file " + fileName); | |
| 1155 | + } | |
| 1156 | + } | |
| 1157 | + } | |
| 1158 | + return exists == Boolean.FALSE; | |
| 1159 | + } | |
| 1160 | + | |
| 1161 | + private int numCoreFonts = -1; | |
| 1162 | + private String[] componentFonts = null; | |
| 1163 | + HashMap <String, String> filenamesMap = new HashMap<String, String>(); | |
| 1164 | + HashSet <String> coreFontFileNames = new HashSet<String>(); | |
| 1165 | + | |
| 1166 | + /* Return the number of core fonts. Note this isn't thread safe but | |
| 1167 | + * a calling thread can call this and getPlatformFontNames() in either | |
| 1168 | + * order. | |
| 1169 | + */ | |
| 1170 | + public int getNumberCoreFonts() { | |
| 1171 | + if (numCoreFonts == -1) { | |
| 1172 | + numCoreFonts = coreFontNameIDs.size(); | |
| 1173 | + Short[] emptyShortArray = new Short[0]; | |
| 1174 | + Short[] core = coreFontNameIDs.toArray(emptyShortArray); | |
| 1175 | + Short[] fallback = fallbackFontNameIDs.toArray(emptyShortArray); | |
| 1176 | + | |
| 1177 | + int numFallbackFonts = 0; | |
| 1178 | + int i; | |
| 1179 | + for (i = 0; i < fallback.length; i++) { | |
| 1180 | + if (coreFontNameIDs.contains(fallback[i])) { | |
| 1181 | + fallback[i] = null; | |
| 1182 | + continue; | |
| 1183 | + } | |
| 1184 | + numFallbackFonts++; | |
| 1185 | + } | |
| 1186 | + componentFonts = new String[numCoreFonts + numFallbackFonts]; | |
| 1187 | + String filename = null; | |
| 1188 | + for (i = 0; i < core.length; i++) { | |
| 1189 | + short fontid = core[i]; | |
| 1190 | + short fileid = getComponentFileID(fontid); | |
| 1191 | + componentFonts[i] = getComponentFontName(fontid); | |
| 1192 | + String compFileName = getComponentFileName(fileid); | |
| 1193 | + if (compFileName != null) { | |
| 1194 | + coreFontFileNames.add(compFileName); | |
| 1195 | + } | |
| 1196 | + filenamesMap.put(componentFonts[i], mapFileName(compFileName)); | |
| 1197 | + } | |
| 1198 | + for (int j = 0; j < fallback.length; j++) { | |
| 1199 | + if (fallback[j] != null) { | |
| 1200 | + short fontid = fallback[j]; | |
| 1201 | + short fileid = getComponentFileID(fontid); | |
| 1202 | + componentFonts[i] = getComponentFontName(fontid); | |
| 1203 | + filenamesMap.put(componentFonts[i], | |
| 1204 | + mapFileName(getComponentFileName(fileid))); | |
| 1205 | + i++; | |
| 1206 | + } | |
| 1207 | + } | |
| 1208 | + } | |
| 1209 | + return numCoreFonts; | |
| 1210 | + } | |
| 1211 | + | |
| 1212 | + /* Return all platform font names used by this font configuration. | |
| 1213 | + * The first getNumberCoreFonts() entries are guaranteed to be the | |
| 1214 | + * core fonts - ie no fall back only fonts. | |
| 1215 | + */ | |
| 1216 | + public String[] getPlatformFontNames() { | |
| 1217 | + if (numCoreFonts == -1) { | |
| 1218 | + getNumberCoreFonts(); | |
| 1219 | + } | |
| 1220 | + return componentFonts; | |
| 1221 | + } | |
| 1222 | + | |
| 1223 | + /** | |
| 1224 | + * Returns a file name for the physical font represented by this platform font name, | |
| 1225 | + * if the font configuration has such information available, or null if the | |
| 1226 | + * information is unavailable. The file name returned is just a hint; a null return | |
| 1227 | + * value doesn't necessarily mean that the font is unavailable, nor does a non-null | |
| 1228 | + * return value guarantee that the file exists and contains the physical font. | |
| 1229 | + * The file name can be an absolute or a relative path name. | |
| 1230 | + */ | |
| 1231 | + public String getFileNameFromPlatformName(String platformName) { | |
| 1232 | + // get2DCompositeFontInfo | |
| 1233 | + // -> getFileNameFromComponentfontName() (W/M) | |
| 1234 | + // -> getFileNameFromPlatformName() | |
| 1235 | + // it's a waste of time on Win32, but I have to give X11 a chance to | |
| 1236 | + // call getFileNameFromXLFD() | |
| 1237 | + return filenamesMap.get(platformName); | |
| 1238 | + } | |
| 1239 | + | |
| 1240 | + /** | |
| 1241 | + * Returns a configuration specific path to be appended to the font | |
| 1242 | + * search path. | |
| 1243 | + */ | |
| 1244 | + public String getExtraFontPath() { | |
| 1245 | + return getString(head[INDEX_appendedfontpath]); | |
| 1246 | + } | |
| 1247 | + | |
| 1248 | + public String getVersion() { | |
| 1249 | + return getString(head[INDEX_version]); | |
| 1250 | + } | |
| 1251 | + | |
| 1252 | + /* subclass support */ | |
| 1253 | + protected static FontConfiguration getFontConfiguration() { | |
| 1254 | + return fontConfig; | |
| 1255 | + } | |
| 1256 | + | |
| 1257 | + protected void setFontConfiguration() { | |
| 1258 | + fontConfig = this; /* static initialization */ | |
| 1259 | + } | |
| 1260 | + | |
| 1261 | + ////////////////////////////////////////////////////////////////////// | |
| 1262 | + // FontConfig data tables and the index constants in binary file // | |
| 1263 | + ////////////////////////////////////////////////////////////////////// | |
| 1264 | + /* The binary font configuration file begins with a short[] "head", which | |
| 1265 | + * contains the offsets to the starts of the individual data table which | |
| 1266 | + * immediately follow. Teh current implemention includes the tables shown | |
| 1267 | + * below. | |
| 1268 | + * | |
| 1269 | + * (00) table_scriptIDs :stringIDs of all defined CharacterSubsetNames | |
| 1270 | + * (01) table_scriptFonts :scriptID x fontIndex x styleIndex-> | |
| 1271 | + * PlatformFontNameID mapping. Each scriptID might | |
| 1272 | + * have 1 or 20 entries depends on if it is defined | |
| 1273 | + * via a "allfonts.CharacterSubsetname" or a list of | |
| 1274 | + * "LogicalFontName.StyleName.CharacterSubsetName" | |
| 1275 | + * entries, positive entry means it's a "allfonts" | |
| 1276 | + * entry, a negative value means this is a offset to | |
| 1277 | + * a NUM_FONTS x NUM_STYLES subtable. | |
| 1278 | + * (02) table_elcIDs :stringIDs of all defined ELC names, string | |
| 1279 | + * "NULL.NULL.NULL" is used for "default" | |
| 1280 | + * (03) table_sequences :elcID x logicalFont -> scriptIDs table defined | |
| 1281 | + * by "sequence.allfonts/LogicalFontName.ELC" in | |
| 1282 | + * font configuration file, each "elcID" has | |
| 1283 | + * NUM_FONTS (5) entries in this table. | |
| 1284 | + * (04) table_fontfileNameIDs | |
| 1285 | + * :stringIDs of all defined font file names | |
| 1286 | + * (05) table_componentFontNameIDs | |
| 1287 | + * :stringIDs of all defined PlatformFontNames | |
| 1288 | + * (06) table_filenames :platformFontNamesID->fontfileNameID mapping | |
| 1289 | + * table, the index is the platformFontNamesID. | |
| 1290 | + * (07) table_awtfontpaths :CharacterSubsetNames->awtfontpaths mapping table, | |
| 1291 | + * the index is the CharacterSubsetName's stringID | |
| 1292 | + * and content is the stringID of awtfontpath. | |
| 1293 | + * (08) table_exclusions :scriptID -> exclusionRanges mapping table, | |
| 1294 | + * the index is the scriptID and the content is | |
| 1295 | + a id of an exclusionRanges int[]. | |
| 1296 | + * (09) table_proportionals:list of pairs of PlatformFontNameIDs, stores | |
| 1297 | + * the replacement info defined by "proportional" | |
| 1298 | + * keyword. | |
| 1299 | + * (10) table_scriptFontsMotif | |
| 1300 | + * :same as (01) except this table stores the | |
| 1301 | + * info defined with ".motif" keyword | |
| 1302 | + * (11) table_alphabeticSuffix | |
| 1303 | + * :elcID -> stringID of alphabetic/XXXX entries | |
| 1304 | + * (12) table_stringIDs :The index of this table is the string ID, the | |
| 1305 | + * content is the "start index" of this string in | |
| 1306 | + * stringTable, use the start index of next entry | |
| 1307 | + * as the "end index". | |
| 1308 | + * (13) table_stringTable :The real storage of all character strings defined | |
| 1309 | + * /used this font configuration, need a pair of | |
| 1310 | + * "start" and "end" indices to access. | |
| 1311 | + * (14) reserved | |
| 1312 | + * (15) table_fallbackScripts | |
| 1313 | + * :stringIDs of fallback CharacterSubsetnames, stored | |
| 1314 | + * in the order of they are defined in sequence.fallback. | |
| 1315 | + * (16) table_appendedfontpath | |
| 1316 | + * :stringtID of the "appendedfontpath" defined. | |
| 1317 | + * (17) table_version :stringID of the version number of this fontconfig file. | |
| 1318 | + */ | |
| 1319 | + private static final int HEAD_LENGTH = 20; | |
| 1320 | + private static final int INDEX_scriptIDs = 0; | |
| 1321 | + private static final int INDEX_scriptFonts = 1; | |
| 1322 | + private static final int INDEX_elcIDs = 2; | |
| 1323 | + private static final int INDEX_sequences = 3; | |
| 1324 | + private static final int INDEX_fontfileNameIDs = 4; | |
| 1325 | + private static final int INDEX_componentFontNameIDs = 5; | |
| 1326 | + private static final int INDEX_filenames = 6; | |
| 1327 | + private static final int INDEX_awtfontpaths = 7; | |
| 1328 | + private static final int INDEX_exclusions = 8; | |
| 1329 | + private static final int INDEX_proportionals = 9; | |
| 1330 | + private static final int INDEX_scriptFontsMotif = 10; | |
| 1331 | + private static final int INDEX_alphabeticSuffix = 11; | |
| 1332 | + private static final int INDEX_stringIDs = 12; | |
| 1333 | + private static final int INDEX_stringTable = 13; | |
| 1334 | + private static final int INDEX_TABLEEND = 14; | |
| 1335 | + private static final int INDEX_fallbackScripts = 15; | |
| 1336 | + private static final int INDEX_appendedfontpath = 16; | |
| 1337 | + private static final int INDEX_version = 17; | |
| 1338 | + | |
| 1339 | + private static short[] head; | |
| 1340 | + private static short[] table_scriptIDs; | |
| 1341 | + private static short[] table_scriptFonts; | |
| 1342 | + private static short[] table_elcIDs; | |
| 1343 | + private static short[] table_sequences; | |
| 1344 | + private static short[] table_fontfileNameIDs; | |
| 1345 | + private static short[] table_componentFontNameIDs; | |
| 1346 | + private static short[] table_filenames; | |
| 1347 | + protected static short[] table_awtfontpaths; | |
| 1348 | + private static short[] table_exclusions; | |
| 1349 | + private static short[] table_proportionals; | |
| 1350 | + private static short[] table_scriptFontsMotif; | |
| 1351 | + private static short[] table_alphabeticSuffix; | |
| 1352 | + private static short[] table_stringIDs; | |
| 1353 | + private static char[] table_stringTable; | |
| 1354 | + | |
| 1355 | + /** | |
| 1356 | + * Checks consistencies of complied fontconfig data. This method | |
| 1357 | + * is called only at the build-time from | |
| 1358 | + * build.tools.compilefontconfig.CompileFontConfig. | |
| 1359 | + */ | |
| 1360 | + private static void sanityCheck() { | |
| 1361 | + int errors = 0; | |
| 1362 | + | |
| 1363 | + //This method will only be called during build time, do we | |
| 1364 | + //need do PrivilegedAction? | |
| 1365 | + String osName = (String)java.security.AccessController.doPrivileged( | |
| 1366 | + new java.security.PrivilegedAction() { | |
| 1367 | + public Object run() { | |
| 1368 | + return System.getProperty("os.name"); | |
| 1369 | + } | |
| 1370 | + }); | |
| 1371 | + | |
| 1372 | + //componentFontNameID starts from "1" | |
| 1373 | + for (int ii = 1; ii < table_filenames.length; ii++) { | |
| 1374 | + if (table_filenames[ii] == -1) { | |
| 1375 | + // The corresponding finename entry for a component | |
| 1376 | + // font name is mandatory on Windows, but it's | |
| 1377 | + // optional on Solaris and Linux. | |
| 1378 | + if (osName.contains("Windows")) { | |
| 1379 | + System.err.println("\n Error: <filename." | |
| 1380 | + + getString(table_componentFontNameIDs[ii]) | |
| 1381 | + + "> entry is missing!!!"); | |
| 1382 | + errors++; | |
| 1383 | + } else { | |
| 1384 | + if (verbose && !isEmpty(table_filenames)) { | |
| 1385 | + System.err.println("\n Note: 'filename' entry is undefined for \"" | |
| 1386 | + + getString(table_componentFontNameIDs[ii]) | |
| 1387 | + + "\""); | |
| 1388 | + } | |
| 1389 | + } | |
| 1390 | + } | |
| 1391 | + } | |
| 1392 | + for (int ii = 0; ii < table_scriptIDs.length; ii++) { | |
| 1393 | + short fid = table_scriptFonts[ii]; | |
| 1394 | + if (fid == 0) { | |
| 1395 | + System.out.println("\n Error: <allfonts." | |
| 1396 | + + getString(table_scriptIDs[ii]) | |
| 1397 | + + "> entry is missing!!!"); | |
| 1398 | + errors++; | |
| 1399 | + continue; | |
| 1400 | + } else if (fid < 0) { | |
| 1401 | + fid = (short)-fid; | |
| 1402 | + for (int iii = 0; iii < NUM_FONTS; iii++) { | |
| 1403 | + for (int iij = 0; iij < NUM_STYLES; iij++) { | |
| 1404 | + int jj = iii * NUM_STYLES + iij; | |
| 1405 | + short ffid = table_scriptFonts[fid + jj]; | |
| 1406 | + if (ffid == 0) { | |
| 1407 | + System.err.println("\n Error: <" | |
| 1408 | + + getFontName(iii) + "." | |
| 1409 | + + getStyleName(iij) + "." | |
| 1410 | + + getString(table_scriptIDs[ii]) | |
| 1411 | + + "> entry is missing!!!"); | |
| 1412 | + errors++; | |
| 1413 | + } | |
| 1414 | + } | |
| 1415 | + } | |
| 1416 | + } | |
| 1417 | + } | |
| 1418 | + if ("SunOS".equals(osName)) { | |
| 1419 | + for (int ii = 0; ii < table_awtfontpaths.length; ii++) { | |
| 1420 | + if (table_awtfontpaths[ii] == 0) { | |
| 1421 | + String script = getString(table_scriptIDs[ii]); | |
| 1422 | + if (script.contains("lucida") || | |
| 1423 | + script.contains("dingbats") || | |
| 1424 | + script.contains("symbol")) { | |
| 1425 | + continue; | |
| 1426 | + } | |
| 1427 | + System.err.println("\nError: " | |
| 1428 | + + "<awtfontpath." | |
| 1429 | + + script | |
| 1430 | + + "> entry is missing!!!"); | |
| 1431 | + errors++; | |
| 1432 | + } | |
| 1433 | + } | |
| 1434 | + } | |
| 1435 | + if (errors != 0) { | |
| 1436 | + System.err.println("!!THERE ARE " + errors + " ERROR(S) IN " | |
| 1437 | + + "THE FONTCONFIG FILE, PLEASE CHECK ITS CONTENT!!\n"); | |
| 1438 | + System.exit(1); | |
| 1439 | + } | |
| 1440 | + } | |
| 1441 | + | |
| 1442 | + private static boolean isEmpty(short[] a) { | |
| 1443 | + for (short s : a) { | |
| 1444 | + if (s != -1) { | |
| 1445 | + return false; | |
| 1446 | + } | |
| 1447 | + } | |
| 1448 | + return true; | |
| 1449 | + } | |
| 1450 | + | |
| 1451 | + //dump the fontconfig data tables | |
| 1452 | + private static void dump() { | |
| 1453 | + System.out.println("\n----Head Table------------"); | |
| 1454 | + for (int ii = 0; ii < HEAD_LENGTH; ii++) { | |
| 1455 | + System.out.println(" " + ii + " : " + head[ii]); | |
| 1456 | + } | |
| 1457 | + System.out.println("\n----scriptIDs-------------"); | |
| 1458 | + printTable(table_scriptIDs, 0); | |
| 1459 | + System.out.println("\n----scriptFonts----------------"); | |
| 1460 | + for (int ii = 0; ii < table_scriptIDs.length; ii++) { | |
| 1461 | + short fid = table_scriptFonts[ii]; | |
| 1462 | + if (fid >= 0) { | |
| 1463 | + System.out.println(" allfonts." | |
| 1464 | + + getString(table_scriptIDs[ii]) | |
| 1465 | + + "=" | |
| 1466 | + + getString(table_componentFontNameIDs[fid])); | |
| 1467 | + } | |
| 1468 | + } | |
| 1469 | + for (int ii = 0; ii < table_scriptIDs.length; ii++) { | |
| 1470 | + short fid = table_scriptFonts[ii]; | |
| 1471 | + if (fid < 0) { | |
| 1472 | + fid = (short)-fid; | |
| 1473 | + for (int iii = 0; iii < NUM_FONTS; iii++) { | |
| 1474 | + for (int iij = 0; iij < NUM_STYLES; iij++) { | |
| 1475 | + int jj = iii * NUM_STYLES + iij; | |
| 1476 | + short ffid = table_scriptFonts[fid + jj]; | |
| 1477 | + System.out.println(" " | |
| 1478 | + + getFontName(iii) + "." | |
| 1479 | + + getStyleName(iij) + "." | |
| 1480 | + + getString(table_scriptIDs[ii]) | |
| 1481 | + + "=" | |
| 1482 | + + getString(table_componentFontNameIDs[ffid])); | |
| 1483 | + } | |
| 1484 | + } | |
| 1485 | + | |
| 1486 | + } | |
| 1487 | + } | |
| 1488 | + System.out.println("\n----elcIDs----------------"); | |
| 1489 | + printTable(table_elcIDs, 0); | |
| 1490 | + System.out.println("\n----sequences-------------"); | |
| 1491 | + for (int ii = 0; ii< table_elcIDs.length; ii++) { | |
| 1492 | + System.out.println(" " + ii + "/" + getString((short)table_elcIDs[ii])); | |
| 1493 | + short[] ss = getShortArray(table_sequences[ii * NUM_FONTS + 0]); | |
| 1494 | + for (int jj = 0; jj < ss.length; jj++) { | |
| 1495 | + System.out.println(" " + getString((short)table_scriptIDs[ss[jj]])); | |
| 1496 | + } | |
| 1497 | + } | |
| 1498 | + System.out.println("\n----fontfileNameIDs-------"); | |
| 1499 | + printTable(table_fontfileNameIDs, 0); | |
| 1500 | + | |
| 1501 | + System.out.println("\n----componentFontNameIDs--"); | |
| 1502 | + printTable(table_componentFontNameIDs, 1); | |
| 1503 | + System.out.println("\n----filenames-------------"); | |
| 1504 | + for (int ii = 0; ii < table_filenames.length; ii++) { | |
| 1505 | + if (table_filenames[ii] == -1) { | |
| 1506 | + System.out.println(" " + ii + " : null"); | |
| 1507 | + } else { | |
| 1508 | + System.out.println(" " + ii + " : " | |
| 1509 | + + getString(table_fontfileNameIDs[table_filenames[ii]])); | |
| 1510 | + } | |
| 1511 | + } | |
| 1512 | + System.out.println("\n----awtfontpaths---------"); | |
| 1513 | + for (int ii = 0; ii < table_awtfontpaths.length; ii++) { | |
| 1514 | + System.out.println(" " + getString(table_scriptIDs[ii]) | |
| 1515 | + + " : " | |
| 1516 | + + getString(table_awtfontpaths[ii])); | |
| 1517 | + } | |
| 1518 | + System.out.println("\n----proportionals--------"); | |
| 1519 | + for (int ii = 0; ii < table_proportionals.length; ii++) { | |
| 1520 | + System.out.println(" " | |
| 1521 | + + getString((short)table_componentFontNameIDs[table_proportionals[ii++]]) | |
| 1522 | + + " -> " | |
| 1523 | + + getString((short)table_componentFontNameIDs[table_proportionals[ii]])); | |
| 1524 | + } | |
| 1525 | + int i = 0; | |
| 1526 | + System.out.println("\n----alphabeticSuffix----"); | |
| 1527 | + while (i < table_alphabeticSuffix.length) { | |
| 1528 | + System.out.println(" " + getString(table_elcIDs[table_alphabeticSuffix[i++]]) | |
| 1529 | + + " -> " + getString(table_alphabeticSuffix[i++])); | |
| 1530 | + } | |
| 1531 | + System.out.println("\n----String Table---------"); | |
| 1532 | + System.out.println(" stringID: Num =" + table_stringIDs.length); | |
| 1533 | + System.out.println(" stringTable: Size=" + table_stringTable.length * 2); | |
| 1534 | + | |
| 1535 | + System.out.println("\n----fallbackScriptIDs---"); | |
| 1536 | + short[] fbsIDs = getShortArray(head[INDEX_fallbackScripts]); | |
| 1537 | + for (int ii = 0; ii < fbsIDs.length; ii++) { | |
| 1538 | + System.out.println(" " + getString(table_scriptIDs[fbsIDs[ii]])); | |
| 1539 | + } | |
| 1540 | + System.out.println("\n----appendedfontpath-----"); | |
| 1541 | + System.out.println(" " + getString(head[INDEX_appendedfontpath])); | |
| 1542 | + System.out.println("\n----Version--------------"); | |
| 1543 | + System.out.println(" " + getString(head[INDEX_version])); | |
| 1544 | + } | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + ////////////////////////////////////////////////////////////////////// | |
| 1548 | + // Data table access methods // | |
| 1549 | + ////////////////////////////////////////////////////////////////////// | |
| 1550 | + | |
| 1551 | + /* Return the fontID of the platformFontName defined in this font config | |
| 1552 | + * by "LogicalFontName.StyleName.CharacterSubsetName" entry or | |
| 1553 | + * "allfonts.CharacterSubsetName" entry in properties format fc file. | |
| 1554 | + */ | |
| 1555 | + protected static short getComponentFontID(short scriptID, int fontIndex, int styleIndex) { | |
| 1556 | + short fid = table_scriptFonts[scriptID]; | |
| 1557 | + //System.out.println("fid=" + fid + "/ scriptID=" + scriptID + ", fi=" + fontIndex + ", si=" + styleIndex); | |
| 1558 | + if (fid >= 0) { | |
| 1559 | + //"allfonts" | |
| 1560 | + return fid; | |
| 1561 | + } else { | |
| 1562 | + return table_scriptFonts[-fid + fontIndex * NUM_STYLES + styleIndex]; | |
| 1563 | + } | |
| 1564 | + } | |
| 1565 | + | |
| 1566 | + /* Same as getCompoentFontID() except this method returns the fontID define by | |
| 1567 | + * "xxxx.motif" entry. | |
| 1568 | + */ | |
| 1569 | + protected static short getComponentFontIDMotif(short scriptID, int fontIndex, int styleIndex) { | |
| 1570 | + if (table_scriptFontsMotif.length == 0) { | |
| 1571 | + return 0; | |
| 1572 | + } | |
| 1573 | + short fid = table_scriptFontsMotif[scriptID]; | |
| 1574 | + if (fid >= 0) { | |
| 1575 | + //"allfonts" > 0 or "not defined" == 0 | |
| 1576 | + return fid; | |
| 1577 | + } else { | |
| 1578 | + return table_scriptFontsMotif[-fid + fontIndex * NUM_STYLES + styleIndex]; | |
| 1579 | + } | |
| 1580 | + } | |
| 1581 | + | |
| 1582 | + private static int[] getExclusionRanges(short scriptID) { | |
| 1583 | + short exID = table_exclusions[scriptID]; | |
| 1584 | + if (exID == 0) { | |
| 1585 | + return EMPTY_INT_ARRAY; | |
| 1586 | + } else { | |
| 1587 | + char[] exChar = getString(exID).toCharArray(); | |
| 1588 | + int[] exInt = new int[exChar.length / 2]; | |
| 1589 | + int i = 0; | |
| 1590 | + for (int j = 0; j < exInt.length; j++) { | |
| 1591 | + exInt[j] = (exChar[i++] << 16) + (exChar[i++] & 0xffff); | |
| 1592 | + } | |
| 1593 | + return exInt; | |
| 1594 | + } | |
| 1595 | + } | |
| 1596 | + | |
| 1597 | + private static boolean contains(short IDs[], short id, int limit) { | |
| 1598 | + for (int i = 0; i < limit; i++) { | |
| 1599 | + if (IDs[i] == id) { | |
| 1600 | + return true; | |
| 1601 | + } | |
| 1602 | + } | |
| 1603 | + return false; | |
| 1604 | + } | |
| 1605 | + | |
| 1606 | + /* Return the PlatformFontName from its fontID*/ | |
| 1607 | + protected static String getComponentFontName(short id) { | |
| 1608 | + if (id < 0) { | |
| 1609 | + return null; | |
| 1610 | + } | |
| 1611 | + return getString(table_componentFontNameIDs[id]); | |
| 1612 | + } | |
| 1613 | + | |
| 1614 | + private static String getComponentFileName(short id) { | |
| 1615 | + if (id < 0) { | |
| 1616 | + return null; | |
| 1617 | + } | |
| 1618 | + return getString(table_fontfileNameIDs[id]); | |
| 1619 | + } | |
| 1620 | + | |
| 1621 | + //componentFontID -> componentFileID | |
| 1622 | + private static short getComponentFileID(short nameID) { | |
| 1623 | + return table_filenames[nameID]; | |
| 1624 | + } | |
| 1625 | + | |
| 1626 | + private static String getScriptName(short scriptID) { | |
| 1627 | + return getString(table_scriptIDs[scriptID]); | |
| 1628 | + } | |
| 1629 | + | |
| 1630 | + private HashMap<String, Short> reorderScripts; | |
| 1631 | + protected short[] getCoreScripts(int fontIndex) { | |
| 1632 | + short elc = getInitELC(); | |
| 1633 | + /* | |
| 1634 | + System.out.println("getCoreScripts: elc=" + elc + ", fontIndex=" + fontIndex); | |
| 1635 | + short[] ss = getShortArray(table_sequences[elc * NUM_FONTS + fontIndex]); | |
| 1636 | + for (int i = 0; i < ss.length; i++) { | |
| 1637 | + System.out.println(" " + getString((short)table_scriptIDs[ss[i]])); | |
| 1638 | + } | |
| 1639 | + */ | |
| 1640 | + short[] scripts = getShortArray(table_sequences[elc * NUM_FONTS + fontIndex]); | |
| 1641 | + if (preferLocaleFonts) { | |
| 1642 | + if (reorderScripts == null) { | |
| 1643 | + reorderScripts = new HashMap<String, Short>(); | |
| 1644 | + } | |
| 1645 | + String[] ss = new String[scripts.length]; | |
| 1646 | + for (int i = 0; i < ss.length; i++) { | |
| 1647 | + ss[i] = getScriptName(scripts[i]); | |
| 1648 | + reorderScripts.put(ss[i], scripts[i]); | |
| 1649 | + } | |
| 1650 | + reorderSequenceForLocale(ss); | |
| 1651 | + for (int i = 0; i < ss.length; i++) { | |
| 1652 | + scripts[i] = reorderScripts.get(ss[i]); | |
| 1653 | + } | |
| 1654 | + } | |
| 1655 | + return scripts; | |
| 1656 | + } | |
| 1657 | + | |
| 1658 | + private static short[] getFallbackScripts() { | |
| 1659 | + return getShortArray(head[INDEX_fallbackScripts]); | |
| 1660 | + } | |
| 1661 | + | |
| 1662 | + private static void printTable(short[] list, int start) { | |
| 1663 | + for (int i = start; i < list.length; i++) { | |
| 1664 | + System.out.println(" " + i + " : " + getString(list[i])); | |
| 1665 | + } | |
| 1666 | + } | |
| 1667 | + | |
| 1668 | + private static short[] readShortTable(DataInputStream in, int len ) | |
| 1669 | + throws IOException { | |
| 1670 | + if (len == 0) { | |
| 1671 | + return EMPTY_SHORT_ARRAY; | |
| 1672 | + } | |
| 1673 | + short[] data = new short[len]; | |
| 1674 | + byte[] bb = new byte[len * 2]; | |
| 1675 | + in.read(bb); | |
| 1676 | + int i = 0,j = 0; | |
| 1677 | + while (i < len) { | |
| 1678 | + data[i++] = (short)(bb[j++] << 8 | (bb[j++] & 0xff)); | |
| 1679 | + } | |
| 1680 | + return data; | |
| 1681 | + } | |
| 1682 | + | |
| 1683 | + private static void writeShortTable(DataOutputStream out, short[] data) | |
| 1684 | + throws IOException { | |
| 1685 | + for (short val : data) { | |
| 1686 | + out.writeShort(val); | |
| 1687 | + } | |
| 1688 | + } | |
| 1689 | + | |
| 1690 | + private static short[] toList(HashMap<String, Short> map) { | |
| 1691 | + short[] list = new short[map.size()]; | |
| 1692 | + Arrays.fill(list, (short) -1); | |
| 1693 | + for (Entry<String, Short> entry : map.entrySet()) { | |
| 1694 | + list[entry.getValue()] = getStringID(entry.getKey()); | |
| 1695 | + } | |
| 1696 | + return list; | |
| 1697 | + } | |
| 1698 | + | |
| 1699 | + //runtime cache | |
| 1700 | + private static String[] stringCache; | |
| 1701 | + protected static String getString(short stringID) { | |
| 1702 | + if (stringID == 0) | |
| 1703 | + return null; | |
| 1704 | + /* | |
| 1705 | + if (loadingProperties) { | |
| 1706 | + return stringTable.substring(stringIDs[stringID], | |
| 1707 | + stringIDs[stringID+1]); | |
| 1708 | + } | |
| 1709 | + */ | |
| 1710 | + //sync if we want it to be MT-enabled | |
| 1711 | + if (stringCache[stringID] == null){ | |
| 1712 | + stringCache[stringID] = | |
| 1713 | + new String (table_stringTable, | |
| 1714 | + table_stringIDs[stringID], | |
| 1715 | + table_stringIDs[stringID+1] - table_stringIDs[stringID]); | |
| 1716 | + } | |
| 1717 | + return stringCache[stringID]; | |
| 1718 | + } | |
| 1719 | + | |
| 1720 | + private static short[] getShortArray(short shortArrayID) { | |
| 1721 | + String s = getString(shortArrayID); | |
| 1722 | + char[] cc = s.toCharArray(); | |
| 1723 | + short[] ss = new short[cc.length]; | |
| 1724 | + for (int i = 0; i < cc.length; i++) { | |
| 1725 | + ss[i] = (short)(cc[i] & 0xffff); | |
| 1726 | + } | |
| 1727 | + return ss; | |
| 1728 | + } | |
| 1729 | + | |
| 1730 | + private static short getStringID(String s) { | |
| 1731 | + if (s == null) { | |
| 1732 | + return (short)0; | |
| 1733 | + } | |
| 1734 | + short pos0 = (short)stringTable.length(); | |
| 1735 | + stringTable.append(s); | |
| 1736 | + short pos1 = (short)stringTable.length(); | |
| 1737 | + | |
| 1738 | + stringIDs[stringIDNum] = pos0; | |
| 1739 | + stringIDs[stringIDNum + 1] = pos1; | |
| 1740 | + stringIDNum++; | |
| 1741 | + if (stringIDNum + 1 >= stringIDs.length) { | |
| 1742 | + short[] tmp = new short[stringIDNum + 1000]; | |
| 1743 | + System.arraycopy(stringIDs, 0, tmp, 0, stringIDNum); | |
| 1744 | + stringIDs = tmp; | |
| 1745 | + } | |
| 1746 | + return (short)(stringIDNum - 1); | |
| 1747 | + } | |
| 1748 | + | |
| 1749 | + private static short getShortArrayID(short sa[]) { | |
| 1750 | + char[] cc = new char[sa.length]; | |
| 1751 | + for (int i = 0; i < sa.length; i ++) { | |
| 1752 | + cc[i] = (char)sa[i]; | |
| 1753 | + } | |
| 1754 | + String s = new String(cc); | |
| 1755 | + return getStringID(s); | |
| 1756 | + } | |
| 1757 | + | |
| 1758 | + //utility "empty" objects | |
| 1759 | + private static final int[] EMPTY_INT_ARRAY = new int[0]; | |
| 1760 | + private static final String[] EMPTY_STRING_ARRAY = new String[0]; | |
| 1761 | + private static final short[] EMPTY_SHORT_ARRAY = new short[0]; | |
| 1762 | + private static final String UNDEFINED_COMPONENT_FONT = "unknown"; | |
| 1763 | + | |
| 1764 | + ////////////////////////////////////////////////////////////////////////// | |
| 1765 | + //Convert the FontConfig data in Properties file to binary data tables // | |
| 1766 | + ////////////////////////////////////////////////////////////////////////// | |
| 1767 | + static class PropertiesHandler { | |
| 1768 | + public void load(InputStream in) throws IOException { | |
| 1769 | + initLogicalNameStyle(); | |
| 1770 | + initHashMaps(); | |
| 1771 | + FontProperties fp = new FontProperties(); | |
| 1772 | + fp.load(in); | |
| 1773 | + initBinaryTable(); | |
| 1774 | + } | |
| 1775 | + | |
| 1776 | + private void initBinaryTable() { | |
| 1777 | + //(0) | |
| 1778 | + head = new short[HEAD_LENGTH]; | |
| 1779 | + head[INDEX_scriptIDs] = (short)HEAD_LENGTH; | |
| 1780 | + | |
| 1781 | + table_scriptIDs = toList(scriptIDs); | |
| 1782 | + //(1)a: scriptAllfonts scriptID/allfonts -> componentFontNameID | |
| 1783 | + // b: scriptFonts scriptID -> componentFontNameID[20] | |
| 1784 | + //if we have a "allfonts.script" def, then we just put | |
| 1785 | + //the "-platformFontID" value in the slot, otherwise the slot | |
| 1786 | + //value is "offset" which "offset" is where 20 entries located | |
| 1787 | + //in the table attached. | |
| 1788 | + head[INDEX_scriptFonts] = (short)(head[INDEX_scriptIDs] + table_scriptIDs.length); | |
| 1789 | + int len = table_scriptIDs.length + scriptFonts.size() * 20; | |
| 1790 | + table_scriptFonts = new short[len]; | |
| 1791 | + | |
| 1792 | + for (Entry<Short, Short> entry : scriptAllfonts.entrySet()) { | |
| 1793 | + table_scriptFonts[entry.getKey().intValue()] = entry.getValue(); | |
| 1794 | + } | |
| 1795 | + int off = table_scriptIDs.length; | |
| 1796 | + for (Entry<Short, Short[]> entry : scriptFonts.entrySet()) { | |
| 1797 | + table_scriptFonts[entry.getKey().intValue()] = (short)-off; | |
| 1798 | + Short[] v = entry.getValue(); | |
| 1799 | + for (int i = 0; i < 20; i++) { | |
| 1800 | + if (v[i] != null) { | |
| 1801 | + table_scriptFonts[off++] = v[i]; | |
| 1802 | + } else { | |
| 1803 | + table_scriptFonts[off++] = 0; | |
| 1804 | + } | |
| 1805 | + } | |
| 1806 | + } | |
| 1807 | + | |
| 1808 | + //(2) | |
| 1809 | + head[INDEX_elcIDs] = (short)(head[INDEX_scriptFonts] + table_scriptFonts.length); | |
| 1810 | + table_elcIDs = toList(elcIDs); | |
| 1811 | + | |
| 1812 | + //(3) sequences elcID -> XXXX[1|5] -> scriptID[] | |
| 1813 | + head[INDEX_sequences] = (short)(head[INDEX_elcIDs] + table_elcIDs.length); | |
| 1814 | + table_sequences = new short[elcIDs.size() * NUM_FONTS]; | |
| 1815 | + for (Entry<Short, short[]> entry : sequences.entrySet()) { | |
| 1816 | + //table_sequences[entry.getKey().intValue()] = (short)-off; | |
| 1817 | + int k = entry.getKey().intValue(); | |
| 1818 | + short[] v = entry.getValue(); | |
| 1819 | + /* | |
| 1820 | + System.out.println("elc=" + k + "/" + getString((short)table_elcIDs[k])); | |
| 1821 | + short[] ss = getShortArray(v[0]); | |
| 1822 | + for (int i = 0; i < ss.length; i++) { | |
| 1823 | + System.out.println(" " + getString((short)table_scriptIDs[ss[i]])); | |
| 1824 | + } | |
| 1825 | + */ | |
| 1826 | + if (v.length == 1) { | |
| 1827 | + //the "allfonts" entries | |
| 1828 | + for (int i = 0; i < NUM_FONTS; i++) { | |
| 1829 | + table_sequences[k * NUM_FONTS + i] = v[0]; | |
| 1830 | + } | |
| 1831 | + } else { | |
| 1832 | + for (int i = 0; i < NUM_FONTS; i++) { | |
| 1833 | + table_sequences[k * NUM_FONTS + i] = v[i]; | |
| 1834 | + } | |
| 1835 | + } | |
| 1836 | + } | |
| 1837 | + //(4) | |
| 1838 | + head[INDEX_fontfileNameIDs] = (short)(head[INDEX_sequences] + table_sequences.length); | |
| 1839 | + table_fontfileNameIDs = toList(fontfileNameIDs); | |
| 1840 | + | |
| 1841 | + //(5) | |
| 1842 | + head[INDEX_componentFontNameIDs] = (short)(head[INDEX_fontfileNameIDs] + table_fontfileNameIDs.length); | |
| 1843 | + table_componentFontNameIDs = toList(componentFontNameIDs); | |
| 1844 | + | |
| 1845 | + //(6)componentFontNameID -> filenameID | |
| 1846 | + head[INDEX_filenames] = (short)(head[INDEX_componentFontNameIDs] + table_componentFontNameIDs.length); | |
| 1847 | + table_filenames = new short[table_componentFontNameIDs.length]; | |
| 1848 | + Arrays.fill(table_filenames, (short) -1); | |
| 1849 | + | |
| 1850 | + for (Entry<Short, Short> entry : filenames.entrySet()) { | |
| 1851 | + table_filenames[entry.getKey()] = entry.getValue(); | |
| 1852 | + } | |
| 1853 | + | |
| 1854 | + //(7)scriptID-> awtfontpath | |
| 1855 | + //the paths are stored as scriptID -> stringID in awtfontpahts | |
| 1856 | + head[INDEX_awtfontpaths] = (short)(head[INDEX_filenames] + table_filenames.length); | |
| 1857 | + table_awtfontpaths = new short[table_scriptIDs.length]; | |
| 1858 | + for (Entry<Short, Short> entry : awtfontpaths.entrySet()) { | |
| 1859 | + table_awtfontpaths[entry.getKey()] = entry.getValue(); | |
| 1860 | + } | |
| 1861 | + | |
| 1862 | + //(8)exclusions | |
| 1863 | + head[INDEX_exclusions] = (short)(head[INDEX_awtfontpaths] + table_awtfontpaths.length); | |
| 1864 | + table_exclusions = new short[scriptIDs.size()]; | |
| 1865 | + for (Entry<Short, int[]> entry : exclusions.entrySet()) { | |
| 1866 | + int[] exI = entry.getValue(); | |
| 1867 | + char[] exC = new char[exI.length * 2]; | |
| 1868 | + int j = 0; | |
| 1869 | + for (int i = 0; i < exI.length; i++) { | |
| 1870 | + exC[j++] = (char) (exI[i] >> 16); | |
| 1871 | + exC[j++] = (char) (exI[i] & 0xffff); | |
| 1872 | + } | |
| 1873 | + table_exclusions[entry.getKey()] = getStringID(new String (exC)); | |
| 1874 | + } | |
| 1875 | + //(9)proportionals | |
| 1876 | + head[INDEX_proportionals] = (short)(head[INDEX_exclusions] + table_exclusions.length); | |
| 1877 | + table_proportionals = new short[proportionals.size() * 2]; | |
| 1878 | + int j = 0; | |
| 1879 | + for (Entry<Short, Short> entry : proportionals.entrySet()) { | |
| 1880 | + table_proportionals[j++] = entry.getKey(); | |
| 1881 | + table_proportionals[j++] = entry.getValue(); | |
| 1882 | + } | |
| 1883 | + | |
| 1884 | + //(10) see (1) for info, the only difference is "xxx.motif" | |
| 1885 | + head[INDEX_scriptFontsMotif] = (short)(head[INDEX_proportionals] + table_proportionals.length); | |
| 1886 | + if (scriptAllfontsMotif.size() != 0 || scriptFontsMotif.size() != 0) { | |
| 1887 | + len = table_scriptIDs.length + scriptFontsMotif.size() * 20; | |
| 1888 | + table_scriptFontsMotif = new short[len]; | |
| 1889 | + | |
| 1890 | + for (Entry<Short, Short> entry : scriptAllfontsMotif.entrySet()) { | |
| 1891 | + table_scriptFontsMotif[entry.getKey().intValue()] = | |
| 1892 | + (short)entry.getValue(); | |
| 1893 | + } | |
| 1894 | + off = table_scriptIDs.length; | |
| 1895 | + for (Entry<Short, Short[]> entry : scriptFontsMotif.entrySet()) { | |
| 1896 | + table_scriptFontsMotif[entry.getKey().intValue()] = (short)-off; | |
| 1897 | + Short[] v = entry.getValue(); | |
| 1898 | + int i = 0; | |
| 1899 | + while (i < 20) { | |
| 1900 | + if (v[i] != null) { | |
| 1901 | + table_scriptFontsMotif[off++] = v[i]; | |
| 1902 | + } else { | |
| 1903 | + table_scriptFontsMotif[off++] = 0; | |
| 1904 | + } | |
| 1905 | + i++; | |
| 1906 | + } | |
| 1907 | + } | |
| 1908 | + } else { | |
| 1909 | + table_scriptFontsMotif = EMPTY_SHORT_ARRAY; | |
| 1910 | + } | |
| 1911 | + | |
| 1912 | + //(11)short[] alphabeticSuffix | |
| 1913 | + head[INDEX_alphabeticSuffix] = (short)(head[INDEX_scriptFontsMotif] + table_scriptFontsMotif.length); | |
| 1914 | + table_alphabeticSuffix = new short[alphabeticSuffix.size() * 2]; | |
| 1915 | + j = 0; | |
| 1916 | + for (Entry<Short, Short> entry : alphabeticSuffix.entrySet()) { | |
| 1917 | + table_alphabeticSuffix[j++] = entry.getKey(); | |
| 1918 | + table_alphabeticSuffix[j++] = entry.getValue(); | |
| 1919 | + } | |
| 1920 | + | |
| 1921 | + //(15)short[] fallbackScriptIDs; just put the ID in head | |
| 1922 | + head[INDEX_fallbackScripts] = getShortArrayID(fallbackScriptIDs); | |
| 1923 | + | |
| 1924 | + //(16)appendedfontpath | |
| 1925 | + head[INDEX_appendedfontpath] = getStringID(appendedfontpath); | |
| 1926 | + | |
| 1927 | + //(17)version | |
| 1928 | + head[INDEX_version] = getStringID(version); | |
| 1929 | + | |
| 1930 | + //(12)short[] StringIDs | |
| 1931 | + head[INDEX_stringIDs] = (short)(head[INDEX_alphabeticSuffix] + table_alphabeticSuffix.length); | |
| 1932 | + table_stringIDs = new short[stringIDNum + 1]; | |
| 1933 | + System.arraycopy(stringIDs, 0, table_stringIDs, 0, stringIDNum + 1); | |
| 1934 | + | |
| 1935 | + //(13)StringTable | |
| 1936 | + head[INDEX_stringTable] = (short)(head[INDEX_stringIDs] + stringIDNum + 1); | |
| 1937 | + table_stringTable = stringTable.toString().toCharArray(); | |
| 1938 | + //(14) | |
| 1939 | + head[INDEX_TABLEEND] = (short)(head[INDEX_stringTable] + stringTable.length()); | |
| 1940 | + | |
| 1941 | + //StringTable cache | |
| 1942 | + stringCache = new String[table_stringIDs.length]; | |
| 1943 | + } | |
| 1944 | + | |
| 1945 | + ////////////////////////////////////////////// | |
| 1946 | + private HashMap<String, Short> scriptIDs; | |
| 1947 | + //elc -> Encoding.Language.Country | |
| 1948 | + private HashMap<String, Short> elcIDs; | |
| 1949 | + //componentFontNameID starts from "1", "0" reserves for "undefined" | |
| 1950 | + private HashMap<String, Short> componentFontNameIDs; | |
| 1951 | + private HashMap<String, Short> fontfileNameIDs; | |
| 1952 | + private HashMap<String, Integer> logicalFontIDs; | |
| 1953 | + private HashMap<String, Integer> fontStyleIDs; | |
| 1954 | + | |
| 1955 | + //componentFontNameID -> fontfileNameID | |
| 1956 | + private HashMap<Short, Short> filenames; | |
| 1957 | + | |
| 1958 | + //elcID -> allfonts/logicalFont -> scriptID list | |
| 1959 | + //(1)if we have a "allfonts", then the length of the | |
| 1960 | + // value array is "1", otherwise it's 5, each font | |
| 1961 | + // must have their own individual entry. | |
| 1962 | + //scriptID list "short[]" is stored as an ID | |
| 1963 | + private HashMap<Short, short[]> sequences; | |
| 1964 | + | |
| 1965 | + //scriptID ->logicFontID/fontStyleID->componentFontNameID, | |
| 1966 | + //a 20-entry array (5-name x 4-style) for each script | |
| 1967 | + private HashMap<Short, Short[]> scriptFonts; | |
| 1968 | + | |
| 1969 | + //scriptID -> componentFontNameID | |
| 1970 | + private HashMap<Short, Short> scriptAllfonts; | |
| 1971 | + | |
| 1972 | + //scriptID -> exclusionRanges[] | |
| 1973 | + private HashMap<Short, int[]> exclusions; | |
| 1974 | + | |
| 1975 | + //scriptID -> fontpath | |
| 1976 | + private HashMap<Short, Short> awtfontpaths; | |
| 1977 | + | |
| 1978 | + //fontID -> fontID | |
| 1979 | + private HashMap<Short, Short> proportionals; | |
| 1980 | + | |
| 1981 | + //scriptID -> componentFontNameID | |
| 1982 | + private HashMap<Short, Short> scriptAllfontsMotif; | |
| 1983 | + | |
| 1984 | + //scriptID ->logicFontID/fontStyleID->componentFontNameID, | |
| 1985 | + private HashMap<Short, Short[]> scriptFontsMotif; | |
| 1986 | + | |
| 1987 | + //elcID -> stringID of alphabetic/XXXX | |
| 1988 | + private HashMap<Short, Short> alphabeticSuffix; | |
| 1989 | + | |
| 1990 | + private short[] fallbackScriptIDs; | |
| 1991 | + private String version; | |
| 1992 | + private String appendedfontpath; | |
| 1993 | + | |
| 1994 | + private void initLogicalNameStyle() { | |
| 1995 | + logicalFontIDs = new HashMap<String, Integer>(); | |
| 1996 | + fontStyleIDs = new HashMap<String, Integer>(); | |
| 1997 | + logicalFontIDs.put("serif", 0); | |
| 1998 | + logicalFontIDs.put("sansserif", 1); | |
| 1999 | + logicalFontIDs.put("monospaced", 2); | |
| 2000 | + logicalFontIDs.put("dialog", 3); | |
| 2001 | + logicalFontIDs.put("dialoginput",4); | |
| 2002 | + fontStyleIDs.put("plain", 0); | |
| 2003 | + fontStyleIDs.put("bold", 1); | |
| 2004 | + fontStyleIDs.put("italic", 2); | |
| 2005 | + fontStyleIDs.put("bolditalic", 3); | |
| 2006 | + } | |
| 2007 | + | |
| 2008 | + private void initHashMaps() { | |
| 2009 | + scriptIDs = new HashMap<String, Short>(); | |
| 2010 | + elcIDs = new HashMap<String, Short>(); | |
| 2011 | + componentFontNameIDs = new HashMap<String, Short>(); | |
| 2012 | + /*Init these tables to allow componentFontNameID, fontfileNameIDs | |
| 2013 | + to start from "1". | |
| 2014 | + */ | |
| 2015 | + componentFontNameIDs.put("", Short.valueOf((short)0)); | |
| 2016 | + | |
| 2017 | + fontfileNameIDs = new HashMap<String, Short>(); | |
| 2018 | + filenames = new HashMap<Short, Short>(); | |
| 2019 | + sequences = new HashMap<Short, short[]>(); | |
| 2020 | + scriptFonts = new HashMap<Short, Short[]>(); | |
| 2021 | + scriptAllfonts = new HashMap<Short, Short>(); | |
| 2022 | + exclusions = new HashMap<Short, int[]>(); | |
| 2023 | + awtfontpaths = new HashMap<Short, Short>(); | |
| 2024 | + proportionals = new HashMap<Short, Short>(); | |
| 2025 | + scriptFontsMotif = new HashMap<Short, Short[]>(); | |
| 2026 | + scriptAllfontsMotif = new HashMap<Short, Short>(); | |
| 2027 | + alphabeticSuffix = new HashMap<Short, Short>(); | |
| 2028 | + fallbackScriptIDs = EMPTY_SHORT_ARRAY; | |
| 2029 | + /* | |
| 2030 | + version | |
| 2031 | + appendedfontpath | |
| 2032 | + */ | |
| 2033 | + } | |
| 2034 | + | |
| 2035 | + private int[] parseExclusions(String key, String exclusions) { | |
| 2036 | + if (exclusions == null) { | |
| 2037 | + return EMPTY_INT_ARRAY; | |
| 2038 | + } | |
| 2039 | + // range format is xxxx-XXXX,yyyyyy-YYYYYY,..... | |
| 2040 | + int numExclusions = 1; | |
| 2041 | + int pos = 0; | |
| 2042 | + while ((pos = exclusions.indexOf(',', pos)) != -1) { | |
| 2043 | + numExclusions++; | |
| 2044 | + pos++; | |
| 2045 | + } | |
| 2046 | + int[] exclusionRanges = new int[numExclusions * 2]; | |
| 2047 | + pos = 0; | |
| 2048 | + int newPos = 0; | |
| 2049 | + for (int j = 0; j < numExclusions * 2; ) { | |
| 2050 | + String lower, upper; | |
| 2051 | + int lo = 0, up = 0; | |
| 2052 | + try { | |
| 2053 | + newPos = exclusions.indexOf('-', pos); | |
| 2054 | + lower = exclusions.substring(pos, newPos); | |
| 2055 | + pos = newPos + 1; | |
| 2056 | + newPos = exclusions.indexOf(',', pos); | |
| 2057 | + if (newPos == -1) { | |
| 2058 | + newPos = exclusions.length(); | |
| 2059 | + } | |
| 2060 | + upper = exclusions.substring(pos, newPos); | |
| 2061 | + pos = newPos + 1; | |
| 2062 | + int lowerLength = lower.length(); | |
| 2063 | + int upperLength = upper.length(); | |
| 2064 | + if (lowerLength != 4 && lowerLength != 6 | |
| 2065 | + || upperLength != 4 && upperLength != 6) { | |
| 2066 | + throw new Exception(); | |
| 2067 | + } | |
| 2068 | + lo = Integer.parseInt(lower, 16); | |
| 2069 | + up = Integer.parseInt(upper, 16); | |
| 2070 | + if (lo > up) { | |
| 2071 | + throw new Exception(); | |
| 2072 | + } | |
| 2073 | + } catch (Exception e) { | |
| 2074 | + if (FontUtilities.debugFonts() && | |
| 2075 | + logger != null) { | |
| 2076 | + logger.config("Failed parsing " + key + | |
| 2077 | + " property of font configuration."); | |
| 2078 | + | |
| 2079 | + } | |
| 2080 | + return EMPTY_INT_ARRAY; | |
| 2081 | + } | |
| 2082 | + exclusionRanges[j++] = lo; | |
| 2083 | + exclusionRanges[j++] = up; | |
| 2084 | + } | |
| 2085 | + return exclusionRanges; | |
| 2086 | + } | |
| 2087 | + | |
| 2088 | + private Short getID(HashMap<String, Short> map, String key) { | |
| 2089 | + Short ret = map.get(key); | |
| 2090 | + if ( ret == null) { | |
| 2091 | + map.put(key, (short)map.size()); | |
| 2092 | + return map.get(key); | |
| 2093 | + } | |
| 2094 | + return ret; | |
| 2095 | + } | |
| 2096 | + | |
| 2097 | + class FontProperties extends Properties { | |
| 2098 | + public synchronized Object put(Object k, Object v) { | |
| 2099 | + parseProperty((String)k, (String)v); | |
| 2100 | + return null; | |
| 2101 | + } | |
| 2102 | + } | |
| 2103 | + | |
| 2104 | + private void parseProperty(String key, String value) { | |
| 2105 | + if (key.startsWith("filename.")) { | |
| 2106 | + //the only special case is "MingLiu_HKSCS" which has "_" in its | |
| 2107 | + //facename, we dont want to replace the "_" with " " | |
| 2108 | + key = key.substring(9); | |
| 2109 | + if (!"MingLiU_HKSCS".equals(key)) { | |
| 2110 | + key = key.replace('_', ' '); | |
| 2111 | + } | |
| 2112 | + Short faceID = getID(componentFontNameIDs, key); | |
| 2113 | + Short fileID = getID(fontfileNameIDs, value); | |
| 2114 | + //System.out.println("faceID=" + faceID + "/" + key + " -> " | |
| 2115 | + // + "fileID=" + fileID + "/" + value); | |
| 2116 | + filenames.put(faceID, fileID); | |
| 2117 | + } else if (key.startsWith("exclusion.")) { | |
| 2118 | + key = key.substring(10); | |
| 2119 | + exclusions.put(getID(scriptIDs,key), parseExclusions(key,value)); | |
| 2120 | + } else if (key.startsWith("sequence.")) { | |
| 2121 | + key = key.substring(9); | |
| 2122 | + boolean hasDefault = false; | |
| 2123 | + boolean has1252 = false; | |
| 2124 | + | |
| 2125 | + //get the scriptID list | |
| 2126 | + String[] ss = (String[])splitSequence(value).toArray(EMPTY_STRING_ARRAY); | |
| 2127 | + short [] sa = new short[ss.length]; | |
| 2128 | + for (int i = 0; i < ss.length; i++) { | |
| 2129 | + if ("alphabetic/default".equals(ss[i])) { | |
| 2130 | + //System.out.println(key + " -> " + ss[i]); | |
| 2131 | + ss[i] = "alphabetic"; | |
| 2132 | + hasDefault = true; | |
| 2133 | + } else if ("alphabetic/1252".equals(ss[i])) { | |
| 2134 | + //System.out.println(key + " -> " + ss[i]); | |
| 2135 | + ss[i] = "alphabetic"; | |
| 2136 | + has1252 = true; | |
| 2137 | + } | |
| 2138 | + sa[i] = getID(scriptIDs, ss[i]).shortValue(); | |
| 2139 | + //System.out.println("scriptID=" + si[i] + "/" + ss[i]); | |
| 2140 | + } | |
| 2141 | + //convert the "short[] -> string -> stringID" | |
| 2142 | + short scriptArrayID = getShortArrayID(sa); | |
| 2143 | + Short elcID = null; | |
| 2144 | + int dot = key.indexOf('.'); | |
| 2145 | + if (dot == -1) { | |
| 2146 | + if ("fallback".equals(key)) { | |
| 2147 | + fallbackScriptIDs = sa; | |
| 2148 | + return; | |
| 2149 | + } | |
| 2150 | + if ("allfonts".equals(key)) { | |
| 2151 | + elcID = getID(elcIDs, "NULL.NULL.NULL"); | |
| 2152 | + } else { | |
| 2153 | + if (logger != null) { | |
| 2154 | + logger.config("Error sequence def: <sequence." + key + ">"); | |
| 2155 | + } | |
| 2156 | + return; | |
| 2157 | + } | |
| 2158 | + } else { | |
| 2159 | + elcID = getID(elcIDs, key.substring(dot + 1)); | |
| 2160 | + //System.out.println("elcID=" + elcID + "/" + key.substring(dot + 1)); | |
| 2161 | + key = key.substring(0, dot); | |
| 2162 | + } | |
| 2163 | + short[] scriptArrayIDs = null; | |
| 2164 | + if ("allfonts".equals(key)) { | |
| 2165 | + scriptArrayIDs = new short[1]; | |
| 2166 | + scriptArrayIDs[0] = scriptArrayID; | |
| 2167 | + } else { | |
| 2168 | + scriptArrayIDs = sequences.get(elcID); | |
| 2169 | + if (scriptArrayIDs == null) { | |
| 2170 | + scriptArrayIDs = new short[5]; | |
| 2171 | + } | |
| 2172 | + Integer fid = logicalFontIDs.get(key); | |
| 2173 | + if (fid == null) { | |
| 2174 | + if (logger != null) { | |
| 2175 | + logger.config("Unrecognizable logicfont name " + key); | |
| 2176 | + } | |
| 2177 | + return; | |
| 2178 | + } | |
| 2179 | + //System.out.println("sequence." + key + "/" + id); | |
| 2180 | + scriptArrayIDs[fid.intValue()] = scriptArrayID; | |
| 2181 | + } | |
| 2182 | + sequences.put(elcID, scriptArrayIDs); | |
| 2183 | + if (hasDefault) { | |
| 2184 | + alphabeticSuffix.put(elcID, getStringID("default")); | |
| 2185 | + } else | |
| 2186 | + if (has1252) { | |
| 2187 | + alphabeticSuffix.put(elcID, getStringID("1252")); | |
| 2188 | + } | |
| 2189 | + } else if (key.startsWith("allfonts.")) { | |
| 2190 | + key = key.substring(9); | |
| 2191 | + if (key.endsWith(".motif")) { | |
| 2192 | + key = key.substring(0, key.length() - 6); | |
| 2193 | + //System.out.println("motif: all." + key + "=" + value); | |
| 2194 | + scriptAllfontsMotif.put(getID(scriptIDs,key), getID(componentFontNameIDs,value)); | |
| 2195 | + } else { | |
| 2196 | + scriptAllfonts.put(getID(scriptIDs,key), getID(componentFontNameIDs,value)); | |
| 2197 | + } | |
| 2198 | + } else if (key.startsWith("awtfontpath.")) { | |
| 2199 | + key = key.substring(12); | |
| 2200 | + //System.out.println("scriptID=" + getID(scriptIDs, key) + "/" + key); | |
| 2201 | + awtfontpaths.put(getID(scriptIDs, key), getStringID(value)); | |
| 2202 | + } else if ("version".equals(key)) { | |
| 2203 | + version = value; | |
| 2204 | + } else if ("appendedfontpath".equals(key)) { | |
| 2205 | + appendedfontpath = value; | |
| 2206 | + } else if (key.startsWith("proportional.")) { | |
| 2207 | + key = key.substring(13).replace('_', ' '); | |
| 2208 | + //System.out.println(key + "=" + value); | |
| 2209 | + proportionals.put(getID(componentFontNameIDs, key), | |
| 2210 | + getID(componentFontNameIDs, value)); | |
| 2211 | + } else { | |
| 2212 | + //"name.style.script(.motif)", we dont care anything else | |
| 2213 | + int dot1, dot2; | |
| 2214 | + boolean isMotif = false; | |
| 2215 | + | |
| 2216 | + dot1 = key.indexOf('.'); | |
| 2217 | + if (dot1 == -1) { | |
| 2218 | + if (logger != null) { | |
| 2219 | + logger.config("Failed parsing " + key + | |
| 2220 | + " property of font configuration."); | |
| 2221 | + | |
| 2222 | + } | |
| 2223 | + return; | |
| 2224 | + } | |
| 2225 | + dot2 = key.indexOf('.', dot1 + 1); | |
| 2226 | + if (dot2 == -1) { | |
| 2227 | + if (logger != null) { | |
| 2228 | + logger.config("Failed parsing " + key + | |
| 2229 | + " property of font configuration."); | |
| 2230 | + | |
| 2231 | + } | |
| 2232 | + return; | |
| 2233 | + } | |
| 2234 | + if (key.endsWith(".motif")) { | |
| 2235 | + key = key.substring(0, key.length() - 6); | |
| 2236 | + isMotif = true; | |
| 2237 | + //System.out.println("motif: " + key + "=" + value); | |
| 2238 | + } | |
| 2239 | + Integer nameID = logicalFontIDs.get(key.substring(0, dot1)); | |
| 2240 | + Integer styleID = fontStyleIDs.get(key.substring(dot1+1, dot2)); | |
| 2241 | + Short scriptID = getID(scriptIDs, key.substring(dot2 + 1)); | |
| 2242 | + if (nameID == null || styleID == null) { | |
| 2243 | + if (logger != null) { | |
| 2244 | + logger.config("unrecognizable logicfont name/style at " + key); | |
| 2245 | + } | |
| 2246 | + return; | |
| 2247 | + } | |
| 2248 | + Short[] pnids; | |
| 2249 | + if (isMotif) { | |
| 2250 | + pnids = scriptFontsMotif.get(scriptID); | |
| 2251 | + } else { | |
| 2252 | + pnids = scriptFonts.get(scriptID); | |
| 2253 | + } | |
| 2254 | + if (pnids == null) { | |
| 2255 | + pnids = new Short[20]; | |
| 2256 | + } | |
| 2257 | + pnids[nameID.intValue() * NUM_STYLES + styleID.intValue()] | |
| 2258 | + = getID(componentFontNameIDs, value); | |
| 2259 | + /* | |
| 2260 | + System.out.println("key=" + key + "/<" + nameID + "><" + styleID | |
| 2261 | + + "><" + scriptID + ">=" + value | |
| 2262 | + + "/" + getID(componentFontNameIDs, value)); | |
| 2263 | + */ | |
| 2264 | + if (isMotif) { | |
| 2265 | + scriptFontsMotif.put(scriptID, pnids); | |
| 2266 | + } else { | |
| 2267 | + scriptFonts.put(scriptID, pnids); | |
| 2268 | + } | |
| 2269 | + } | |
| 2270 | + } | |
| 2271 | + } | |
| 2272 | +} | |
Binary file not shown.
| @@ -0,0 +1,121 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1996, 2005, 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 | +package sun.awt; | |
| 26 | + | |
| 27 | +import java.nio.charset.Charset; | |
| 28 | +import java.nio.charset.CharsetEncoder; | |
| 29 | +import java.nio.charset.StandardCharsets; | |
| 30 | +import sun.nio.cs.HistoricallyNamedCharset; | |
| 31 | + | |
| 32 | +public class FontDescriptor implements Cloneable { | |
| 33 | + | |
| 34 | + static { | |
| 35 | + NativeLibLoader.loadLibraries(); | |
| 36 | + initIDs(); | |
| 37 | + } | |
| 38 | + | |
| 39 | + String nativeName; | |
| 40 | + public CharsetEncoder encoder; | |
| 41 | + String charsetName; | |
| 42 | + private int[] exclusionRanges; | |
| 43 | + | |
| 44 | + public FontDescriptor(String nativeName, CharsetEncoder encoder, | |
| 45 | + int[] exclusionRanges){ | |
| 46 | + | |
| 47 | + this.nativeName = nativeName; | |
| 48 | + this.encoder = encoder; | |
| 49 | + this.exclusionRanges = exclusionRanges; | |
| 50 | + this.useUnicode = false; | |
| 51 | + Charset cs = encoder.charset(); | |
| 52 | + if (cs instanceof HistoricallyNamedCharset) | |
| 53 | + this.charsetName = ((HistoricallyNamedCharset)cs).historicalName(); | |
| 54 | + else | |
| 55 | + this.charsetName = cs.name(); | |
| 56 | + | |
| 57 | + } | |
| 58 | + | |
| 59 | + public String getNativeName() { | |
| 60 | + return nativeName; | |
| 61 | + } | |
| 62 | + | |
| 63 | + public CharsetEncoder getFontCharsetEncoder() { | |
| 64 | + return encoder; | |
| 65 | + } | |
| 66 | + | |
| 67 | + public String getFontCharsetName() { | |
| 68 | + return charsetName; | |
| 69 | + } | |
| 70 | + | |
| 71 | + public int[] getExclusionRanges() { | |
| 72 | + return exclusionRanges; | |
| 73 | + } | |
| 74 | + | |
| 75 | + /** | |
| 76 | + * Return true if the character is exclusion character. | |
| 77 | + */ | |
| 78 | + public boolean isExcluded(char ch){ | |
| 79 | + for (int i = 0; i < exclusionRanges.length; ){ | |
| 80 | + | |
| 81 | + int lo = (exclusionRanges[i++]); | |
| 82 | + int up = (exclusionRanges[i++]); | |
| 83 | + | |
| 84 | + if (ch >= lo && ch <= up){ | |
| 85 | + return true; | |
| 86 | + } | |
| 87 | + } | |
| 88 | + return false; | |
| 89 | + } | |
| 90 | + | |
| 91 | + public String toString() { | |
| 92 | + return super.toString() + " [" + nativeName + "|" + encoder + "]"; | |
| 93 | + } | |
| 94 | + | |
| 95 | + /** | |
| 96 | + * Initialize JNI field and method IDs | |
| 97 | + */ | |
| 98 | + private static native void initIDs(); | |
| 99 | + | |
| 100 | + | |
| 101 | + public CharsetEncoder unicodeEncoder; | |
| 102 | + boolean useUnicode; // set to true from native code on Unicode-based systems | |
| 103 | + | |
| 104 | + public boolean useUnicode() { | |
| 105 | + if (useUnicode && unicodeEncoder == null) { | |
| 106 | + try { | |
| 107 | + this.unicodeEncoder = isLE? | |
| 108 | + StandardCharsets.UTF_16LE.newEncoder(): | |
| 109 | + StandardCharsets.UTF_16BE.newEncoder(); | |
| 110 | + } catch (IllegalArgumentException x) {} | |
| 111 | + } | |
| 112 | + return useUnicode; | |
| 113 | + } | |
| 114 | + static boolean isLE; | |
| 115 | + static { | |
| 116 | + String enc = (String) java.security.AccessController.doPrivileged( | |
| 117 | + new sun.security.action.GetPropertyAction("sun.io.unicode.encoding", | |
| 118 | + "UnicodeBig")); | |
| 119 | + isLE = !"UnicodeBig".equals(enc); | |
| 120 | + } | |
| 121 | +} | |
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1,216 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1999, 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 | + | |
| 26 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.awt.*; | |
| 29 | +import java.awt.event.InputEvent; | |
| 30 | +import java.awt.event.InvocationEvent; | |
| 31 | + | |
| 32 | +/** | |
| 33 | + * A stateless class which responds to native mouse moves, Component resizes, | |
| 34 | + * Component moves, showing and hiding of Components, minimizing and | |
| 35 | + * maximizing of top level Windows, addition and removal of Components, | |
| 36 | + * and calls to setCursor(). | |
| 37 | + */ | |
| 38 | +public abstract class GlobalCursorManager { | |
| 39 | + | |
| 40 | + class NativeUpdater implements Runnable { | |
| 41 | + boolean pending = false; | |
| 42 | + | |
| 43 | + public void run() { | |
| 44 | + boolean shouldUpdate = false; | |
| 45 | + synchronized (this) { | |
| 46 | + if (pending) { | |
| 47 | + pending = false; | |
| 48 | + shouldUpdate = true; | |
| 49 | + } | |
| 50 | + } | |
| 51 | + if (shouldUpdate) { | |
| 52 | + _updateCursor(false); | |
| 53 | + } | |
| 54 | + } | |
| 55 | + | |
| 56 | + public void postIfNotPending(Component heavy, InvocationEvent in) { | |
| 57 | + boolean shouldPost = false; | |
| 58 | + synchronized (this) { | |
| 59 | + if (!pending) { | |
| 60 | + pending = shouldPost = true; | |
| 61 | + } | |
| 62 | + } | |
| 63 | + if (shouldPost) { | |
| 64 | + SunToolkit.postEvent(SunToolkit.targetToAppContext(heavy), in); | |
| 65 | + } | |
| 66 | + } | |
| 67 | + } | |
| 68 | + | |
| 69 | + /** | |
| 70 | + * Use a singleton NativeUpdater for better performance. We cannot use | |
| 71 | + * a singleton InvocationEvent because we want each event to have a fresh | |
| 72 | + * timestamp. | |
| 73 | + */ | |
| 74 | + private final NativeUpdater nativeUpdater = new NativeUpdater(); | |
| 75 | + | |
| 76 | + /** | |
| 77 | + * The last time the cursor was updated, in milliseconds. | |
| 78 | + */ | |
| 79 | + private long lastUpdateMillis; | |
| 80 | + | |
| 81 | + /** | |
| 82 | + * Locking object for synchronizing access to lastUpdateMillis. The VM | |
| 83 | + * does not guarantee atomicity of longs. | |
| 84 | + */ | |
| 85 | + private final Object lastUpdateLock = new Object(); | |
| 86 | + | |
| 87 | + /** | |
| 88 | + * Should be called for any activity at the Java level which may affect | |
| 89 | + * the global cursor, except for Java MOUSE_MOVED events. | |
| 90 | + */ | |
| 91 | + public void updateCursorImmediately() { | |
| 92 | + synchronized (nativeUpdater) { | |
| 93 | + nativeUpdater.pending = false; | |
| 94 | + } | |
| 95 | + _updateCursor(false); | |
| 96 | + } | |
| 97 | + | |
| 98 | + /** | |
| 99 | + * Should be called in response to Java MOUSE_MOVED events. The update | |
| 100 | + * will be discarded if the InputEvent is outdated. | |
| 101 | + * | |
| 102 | + * @param e the InputEvent which triggered the cursor update. | |
| 103 | + */ | |
| 104 | + public void updateCursorImmediately(InputEvent e) { | |
| 105 | + boolean shouldUpdate; | |
| 106 | + synchronized (lastUpdateLock) { | |
| 107 | + shouldUpdate = (e.getWhen() >= lastUpdateMillis); | |
| 108 | + } | |
| 109 | + if (shouldUpdate) { | |
| 110 | + _updateCursor(true); | |
| 111 | + } | |
| 112 | + } | |
| 113 | + | |
| 114 | + /** | |
| 115 | + * Should be called in response to a native mouse enter or native mouse | |
| 116 | + * button released message. Should not be called during a mouse drag. | |
| 117 | + */ | |
| 118 | + public void updateCursorLater(Component heavy) { | |
| 119 | + nativeUpdater.postIfNotPending(heavy, new InvocationEvent | |
| 120 | + (Toolkit.getDefaultToolkit(), nativeUpdater)); | |
| 121 | + } | |
| 122 | + | |
| 123 | + protected GlobalCursorManager() { } | |
| 124 | + | |
| 125 | + /** | |
| 126 | + * Set the global cursor to the specified cursor. The component over | |
| 127 | + * which the Cursor current resides is provided as a convenience. Not | |
| 128 | + * all platforms may require the Component. | |
| 129 | + */ | |
| 130 | + protected abstract void setCursor(Component comp, Cursor cursor, | |
| 131 | + boolean useCache); | |
| 132 | + /** | |
| 133 | + * Returns the global cursor position, in screen coordinates. | |
| 134 | + */ | |
| 135 | + protected abstract void getCursorPos(Point p); | |
| 136 | + | |
| 137 | + protected abstract Component findComponentAt(Container con, int x, int y); | |
| 138 | + protected abstract Point getLocationOnScreen(Component com); | |
| 139 | + | |
| 140 | + /** | |
| 141 | + * Returns the most specific, visible, heavyweight Component | |
| 142 | + * under the cursor. This method should return null iff the cursor is | |
| 143 | + * not over any Java Window. | |
| 144 | + * | |
| 145 | + * @param useCache If true, the implementation is free to use caching | |
| 146 | + * mechanisms because the Z-order, visibility, and enabled state of the | |
| 147 | + * Components has not changed. If false, the implementation should not | |
| 148 | + * make these assumptions. | |
| 149 | + */ | |
| 150 | + protected abstract Component findHeavyweightUnderCursor(boolean useCache); | |
| 151 | + | |
| 152 | + /** | |
| 153 | + * Updates the global cursor. We apply a three-step scheme to cursor | |
| 154 | + * updates:<p> | |
| 155 | + * | |
| 156 | + * (1) InputEvent updates which are outdated are discarded by | |
| 157 | + * <code>updateCursorImmediately(InputEvent)</code>.<p> | |
| 158 | + * | |
| 159 | + * (2) If 'useCache' is true, the native code is free to use a cached | |
| 160 | + * value to determine the most specific, visible, enabled heavyweight | |
| 161 | + * because this update is occuring in response to a mouse move. If | |
| 162 | + * 'useCache' is false, the native code must perform a new search given | |
| 163 | + * the current mouse coordinates. | |
| 164 | + * | |
| 165 | + * (3) Once we have determined the most specific, visible, enabled | |
| 166 | + * heavyweight, we use findComponentAt to find the most specific, visible, | |
| 167 | + * enabled Component. | |
| 168 | + */ | |
| 169 | + private void _updateCursor(boolean useCache) { | |
| 170 | + | |
| 171 | + synchronized (lastUpdateLock) { | |
| 172 | + lastUpdateMillis = System.currentTimeMillis(); | |
| 173 | + } | |
| 174 | + | |
| 175 | + Point queryPos = null, p = null; | |
| 176 | + Component comp; | |
| 177 | + | |
| 178 | + try { | |
| 179 | + comp = findHeavyweightUnderCursor(useCache); | |
| 180 | + if (comp == null) { | |
| 181 | + updateCursorOutOfJava(); | |
| 182 | + return; | |
| 183 | + } | |
| 184 | + | |
| 185 | + if (comp instanceof Window) { | |
| 186 | + p = AWTAccessor.getComponentAccessor().getLocation(comp); | |
| 187 | + } else if (comp instanceof Container) { | |
| 188 | + p = getLocationOnScreen(comp); | |
| 189 | + } | |
| 190 | + if (p != null) { | |
| 191 | + queryPos = new Point(); | |
| 192 | + getCursorPos(queryPos); | |
| 193 | + Component c = findComponentAt((Container)comp, | |
| 194 | + queryPos.x - p.x, | |
| 195 | + queryPos.y - p.y); | |
| 196 | + // If findComponentAt returns null, then something bad has | |
| 197 | + // happened. For example, the heavyweight Component may | |
| 198 | + // have been hidden or disabled by another thread. In that | |
| 199 | + // case, we'll just use the originial heavyweight. | |
| 200 | + if (c != null) { | |
| 201 | + comp = c; | |
| 202 | + } | |
| 203 | + } | |
| 204 | + | |
| 205 | + setCursor(comp, AWTAccessor.getComponentAccessor().getCursor(comp), useCache); | |
| 206 | + | |
| 207 | + } catch (IllegalComponentStateException e) { | |
| 208 | + // Shouldn't happen, but if it does, abort. | |
| 209 | + } | |
| 210 | + } | |
| 211 | + | |
| 212 | + protected void updateCursorOutOfJava() { | |
| 213 | + // Cursor is not over a Java Window. Do nothing...usually | |
| 214 | + // But we need to update it in case of grab on X. | |
| 215 | + } | |
| 216 | +} | |
Binary file not shown.
| @@ -0,0 +1,33 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1999, 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 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.awt.Color; | |
| 29 | + | |
| 30 | + | |
| 31 | +public interface Graphics2Delegate { | |
| 32 | + void setBackground(Color color); | |
| 33 | +} | |
| @@ -0,0 +1,44 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 2005, 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 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.nio.charset.Charset; | |
| 29 | +import java.nio.charset.CharsetEncoder; | |
| 30 | +import java.nio.charset.CharsetDecoder; | |
| 31 | + | |
| 32 | +/* 2d/XMap and WFontConfiguration implementation need access HKSCS, | |
| 33 | + make a subclass here to avoid expose HKSCS to the public in | |
| 34 | + ExtendedCharsets class, because if we want to have a public HKSCS, | |
| 35 | + it probably should be HKSCS_2001 not HKSCS. | |
| 36 | +*/ | |
| 37 | +public class HKSCS extends sun.nio.cs.ext.MS950_HKSCS_XP { | |
| 38 | + public HKSCS () { | |
| 39 | + super(); | |
| 40 | + } | |
| 41 | + public boolean contains(Charset cs) { | |
| 42 | + return (cs instanceof HKSCS); | |
| 43 | + } | |
| 44 | +} | |
| @@ -0,0 +1,378 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 2011, 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 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.awt.*; | |
| 29 | +import java.awt.dnd.*; | |
| 30 | +import java.awt.dnd.peer.DragSourceContextPeer; | |
| 31 | +import java.awt.im.InputMethodHighlight; | |
| 32 | +import java.awt.im.spi.InputMethodDescriptor; | |
| 33 | +import java.awt.image.*; | |
| 34 | +import java.awt.datatransfer.Clipboard; | |
| 35 | +import java.awt.peer.*; | |
| 36 | +import java.util.Map; | |
| 37 | +import java.util.Properties; | |
| 38 | + | |
| 39 | +/* | |
| 40 | + * HToolkit is a platform independent Toolkit used | |
| 41 | + * with the HeadlessToolkit. It is primarily used | |
| 42 | + * in embedded JRE's that do not have sun/awt/X11 classes. | |
| 43 | + */ | |
| 44 | +public class HToolkit extends SunToolkit | |
| 45 | + implements ComponentFactory { | |
| 46 | + | |
| 47 | + public HToolkit() { | |
| 48 | + } | |
| 49 | + | |
| 50 | + /* | |
| 51 | + * Component peer objects - unsupported. | |
| 52 | + */ | |
| 53 | + | |
| 54 | + public WindowPeer createWindow(Window target) | |
| 55 | + throws HeadlessException { | |
| 56 | + throw new HeadlessException(); | |
| 57 | + } | |
| 58 | + | |
| 59 | + public FramePeer createFrame(Frame target) | |
| 60 | + throws HeadlessException { | |
| 61 | + throw new HeadlessException(); | |
| 62 | + } | |
| 63 | + | |
| 64 | + public DialogPeer createDialog(Dialog target) | |
| 65 | + throws HeadlessException { | |
| 66 | + throw new HeadlessException(); | |
| 67 | + } | |
| 68 | + | |
| 69 | + public ButtonPeer createButton(Button target) | |
| 70 | + throws HeadlessException { | |
| 71 | + throw new HeadlessException(); | |
| 72 | + } | |
| 73 | + | |
| 74 | + public TextFieldPeer createTextField(TextField target) | |
| 75 | + throws HeadlessException { | |
| 76 | + throw new HeadlessException(); | |
| 77 | + } | |
| 78 | + | |
| 79 | + public ChoicePeer createChoice(Choice target) | |
| 80 | + throws HeadlessException { | |
| 81 | + throw new HeadlessException(); | |
| 82 | + } | |
| 83 | + | |
| 84 | + public LabelPeer createLabel(Label target) | |
| 85 | + throws HeadlessException { | |
| 86 | + throw new HeadlessException(); | |
| 87 | + } | |
| 88 | + | |
| 89 | + public ListPeer createList(List target) | |
| 90 | + throws HeadlessException { | |
| 91 | + throw new HeadlessException(); | |
| 92 | + } | |
| 93 | + | |
| 94 | + public CheckboxPeer createCheckbox(Checkbox target) | |
| 95 | + throws HeadlessException { | |
| 96 | + throw new HeadlessException(); | |
| 97 | + } | |
| 98 | + | |
| 99 | + public ScrollbarPeer createScrollbar(Scrollbar target) | |
| 100 | + throws HeadlessException { | |
| 101 | + throw new HeadlessException(); | |
| 102 | + } | |
| 103 | + | |
| 104 | + public ScrollPanePeer createScrollPane(ScrollPane target) | |
| 105 | + throws HeadlessException { | |
| 106 | + throw new HeadlessException(); | |
| 107 | + } | |
| 108 | + | |
| 109 | + public TextAreaPeer createTextArea(TextArea target) | |
| 110 | + throws HeadlessException { | |
| 111 | + throw new HeadlessException(); | |
| 112 | + } | |
| 113 | + | |
| 114 | + public FileDialogPeer createFileDialog(FileDialog target) | |
| 115 | + throws HeadlessException { | |
| 116 | + throw new HeadlessException(); | |
| 117 | + } | |
| 118 | + | |
| 119 | + public MenuBarPeer createMenuBar(MenuBar target) | |
| 120 | + throws HeadlessException { | |
| 121 | + throw new HeadlessException(); | |
| 122 | + } | |
| 123 | + | |
| 124 | + public MenuPeer createMenu(Menu target) | |
| 125 | + throws HeadlessException { | |
| 126 | + throw new HeadlessException(); | |
| 127 | + } | |
| 128 | + | |
| 129 | + public PopupMenuPeer createPopupMenu(PopupMenu target) | |
| 130 | + throws HeadlessException { | |
| 131 | + throw new HeadlessException(); | |
| 132 | + } | |
| 133 | + | |
| 134 | + public MenuItemPeer createMenuItem(MenuItem target) | |
| 135 | + throws HeadlessException { | |
| 136 | + throw new HeadlessException(); | |
| 137 | + } | |
| 138 | + | |
| 139 | + public CheckboxMenuItemPeer createCheckboxMenuItem(CheckboxMenuItem target) | |
| 140 | + throws HeadlessException { | |
| 141 | + throw new HeadlessException(); | |
| 142 | + } | |
| 143 | + | |
| 144 | + public DragSourceContextPeer createDragSourceContextPeer( | |
| 145 | + DragGestureEvent dge) | |
| 146 | + throws InvalidDnDOperationException { | |
| 147 | + throw new InvalidDnDOperationException("Headless environment"); | |
| 148 | + } | |
| 149 | + | |
| 150 | + public RobotPeer createRobot(Robot target, GraphicsDevice screen) | |
| 151 | + throws AWTException, HeadlessException { | |
| 152 | + throw new HeadlessException(); | |
| 153 | + } | |
| 154 | + | |
| 155 | + public KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager manager) { | |
| 156 | + // See 6833019. | |
| 157 | + return | |
| 158 | + new KeyboardFocusManagerPeer() { | |
| 159 | + public Window getCurrentFocusedWindow() { return null; } | |
| 160 | + public void setCurrentFocusOwner(Component comp) {} | |
| 161 | + public Component getCurrentFocusOwner() { return null; } | |
| 162 | + public void clearGlobalFocusOwner(Window activeWindow) {} | |
| 163 | + }; | |
| 164 | + } | |
| 165 | + | |
| 166 | + public TrayIconPeer createTrayIcon(TrayIcon target) | |
| 167 | + throws HeadlessException { | |
| 168 | + throw new HeadlessException(); | |
| 169 | + } | |
| 170 | + | |
| 171 | + public SystemTrayPeer createSystemTray(SystemTray target) | |
| 172 | + throws HeadlessException { | |
| 173 | + throw new HeadlessException(); | |
| 174 | + } | |
| 175 | + | |
| 176 | + public boolean isTraySupported() { | |
| 177 | + return false; | |
| 178 | + } | |
| 179 | + | |
| 180 | + public GlobalCursorManager getGlobalCursorManager() | |
| 181 | + throws HeadlessException { | |
| 182 | + throw new HeadlessException(); | |
| 183 | + } | |
| 184 | + | |
| 185 | + /* | |
| 186 | + * Headless toolkit - unsupported. | |
| 187 | + */ | |
| 188 | + protected void loadSystemColors(int[] systemColors) | |
| 189 | + throws HeadlessException { | |
| 190 | + throw new HeadlessException(); | |
| 191 | + } | |
| 192 | + | |
| 193 | + public ColorModel getColorModel() | |
| 194 | + throws HeadlessException { | |
| 195 | + throw new HeadlessException(); | |
| 196 | + } | |
| 197 | + | |
| 198 | + public int getScreenResolution() | |
| 199 | + throws HeadlessException { | |
| 200 | + throw new HeadlessException(); | |
| 201 | + } | |
| 202 | + | |
| 203 | + public Map mapInputMethodHighlight(InputMethodHighlight highlight) | |
| 204 | + throws HeadlessException { | |
| 205 | + throw new HeadlessException(); | |
| 206 | + } | |
| 207 | + | |
| 208 | + public int getMenuShortcutKeyMask() | |
| 209 | + throws HeadlessException { | |
| 210 | + throw new HeadlessException(); | |
| 211 | + } | |
| 212 | + | |
| 213 | + public boolean getLockingKeyState(int keyCode) | |
| 214 | + throws UnsupportedOperationException { | |
| 215 | + throw new HeadlessException(); | |
| 216 | + } | |
| 217 | + | |
| 218 | + public void setLockingKeyState(int keyCode, boolean on) | |
| 219 | + throws UnsupportedOperationException { | |
| 220 | + throw new HeadlessException(); | |
| 221 | + } | |
| 222 | + | |
| 223 | + public Cursor createCustomCursor(Image cursor, Point hotSpot, String name) | |
| 224 | + throws IndexOutOfBoundsException, HeadlessException { | |
| 225 | + throw new HeadlessException(); | |
| 226 | + } | |
| 227 | + | |
| 228 | + public Dimension getBestCursorSize(int preferredWidth, int preferredHeight) | |
| 229 | + throws HeadlessException { | |
| 230 | + throw new HeadlessException(); | |
| 231 | + } | |
| 232 | + | |
| 233 | + public int getMaximumCursorColors() | |
| 234 | + throws HeadlessException { | |
| 235 | + throw new HeadlessException(); | |
| 236 | + } | |
| 237 | + | |
| 238 | + public <T extends DragGestureRecognizer> T | |
| 239 | + createDragGestureRecognizer(Class<T> abstractRecognizerClass, | |
| 240 | + DragSource ds, Component c, | |
| 241 | + int srcActions, DragGestureListener dgl) | |
| 242 | + { | |
| 243 | + return null; | |
| 244 | + } | |
| 245 | + | |
| 246 | + public int getScreenHeight() | |
| 247 | + throws HeadlessException { | |
| 248 | + throw new HeadlessException(); | |
| 249 | + } | |
| 250 | + | |
| 251 | + public int getScreenWidth() | |
| 252 | + throws HeadlessException { | |
| 253 | + throw new HeadlessException(); | |
| 254 | + } | |
| 255 | + | |
| 256 | + public Dimension getScreenSize() | |
| 257 | + throws HeadlessException { | |
| 258 | + throw new HeadlessException(); | |
| 259 | + } | |
| 260 | + | |
| 261 | + public Insets getScreenInsets(GraphicsConfiguration gc) | |
| 262 | + throws HeadlessException { | |
| 263 | + throw new HeadlessException(); | |
| 264 | + } | |
| 265 | + | |
| 266 | + public void setDynamicLayout(boolean dynamic) | |
| 267 | + throws HeadlessException { | |
| 268 | + throw new HeadlessException(); | |
| 269 | + } | |
| 270 | + | |
| 271 | + protected boolean isDynamicLayoutSet() | |
| 272 | + throws HeadlessException { | |
| 273 | + throw new HeadlessException(); | |
| 274 | + } | |
| 275 | + | |
| 276 | + public boolean isDynamicLayoutActive() | |
| 277 | + throws HeadlessException { | |
| 278 | + throw new HeadlessException(); | |
| 279 | + } | |
| 280 | + | |
| 281 | + public Clipboard getSystemClipboard() | |
| 282 | + throws HeadlessException { | |
| 283 | + throw new HeadlessException(); | |
| 284 | + } | |
| 285 | + | |
| 286 | + /* | |
| 287 | + * Printing | |
| 288 | + */ | |
| 289 | + public PrintJob getPrintJob(Frame frame, String jobtitle, | |
| 290 | + JobAttributes jobAttributes, | |
| 291 | + PageAttributes pageAttributes) { | |
| 292 | + if (frame != null) { | |
| 293 | + // Should never happen | |
| 294 | + throw new HeadlessException(); | |
| 295 | + } | |
| 296 | + throw new IllegalArgumentException( | |
| 297 | + "PrintJob not supported in a headless environment"); | |
| 298 | + } | |
| 299 | + | |
| 300 | + public PrintJob getPrintJob(Frame frame, String doctitle, Properties props) | |
| 301 | + { | |
| 302 | + if (frame != null) { | |
| 303 | + // Should never happen | |
| 304 | + throw new HeadlessException(); | |
| 305 | + } | |
| 306 | + throw new IllegalArgumentException( | |
| 307 | + "PrintJob not supported in a headless environment"); | |
| 308 | + } | |
| 309 | + | |
| 310 | + /* | |
| 311 | + * Headless toolkit - supported. | |
| 312 | + */ | |
| 313 | + | |
| 314 | + public void sync() { | |
| 315 | + // Do nothing | |
| 316 | + } | |
| 317 | + | |
| 318 | + protected boolean syncNativeQueue(final long timeout) { | |
| 319 | + return false; | |
| 320 | + } | |
| 321 | + | |
| 322 | + public void beep() { | |
| 323 | + // Send alert character | |
| 324 | + System.out.write(0x07); | |
| 325 | + } | |
| 326 | + | |
| 327 | + | |
| 328 | + /* | |
| 329 | + * Fonts | |
| 330 | + */ | |
| 331 | + public FontPeer getFontPeer(String name, int style) { | |
| 332 | + return (FontPeer)null; | |
| 333 | + } | |
| 334 | + | |
| 335 | + /* | |
| 336 | + * Modality | |
| 337 | + */ | |
| 338 | + public boolean isModalityTypeSupported(Dialog.ModalityType modalityType) { | |
| 339 | + return false; | |
| 340 | + } | |
| 341 | + | |
| 342 | + public boolean isModalExclusionTypeSupported(Dialog.ModalExclusionType exclusionType) { | |
| 343 | + return false; | |
| 344 | + } | |
| 345 | + | |
| 346 | + public boolean isDesktopSupported() { | |
| 347 | + return false; | |
| 348 | + } | |
| 349 | + | |
| 350 | + public DesktopPeer createDesktopPeer(Desktop target) | |
| 351 | + throws HeadlessException{ | |
| 352 | + throw new HeadlessException(); | |
| 353 | + } | |
| 354 | + | |
| 355 | + public boolean isWindowOpacityControlSupported() { | |
| 356 | + return false; | |
| 357 | + } | |
| 358 | + | |
| 359 | + public boolean isWindowShapingSupported() { | |
| 360 | + return false; | |
| 361 | + } | |
| 362 | + | |
| 363 | + public boolean isWindowTranslucencySupported() { | |
| 364 | + return false; | |
| 365 | + } | |
| 366 | + | |
| 367 | + public void grab(Window w) { } | |
| 368 | + | |
| 369 | + public void ungrab(Window w) { } | |
| 370 | + | |
| 371 | + protected boolean syncNativeQueue() { return false; } | |
| 372 | + | |
| 373 | + public InputMethodDescriptor getInputMethodAdapterDescriptor() | |
| 374 | + throws AWTException | |
| 375 | + { | |
| 376 | + return (InputMethodDescriptor)null; | |
| 377 | + } | |
| 378 | +} | |
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1,479 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 2000, 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 | + */ | |
| 25 | + | |
| 26 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.awt.*; | |
| 29 | +import java.awt.dnd.*; | |
| 30 | +import java.awt.dnd.peer.DragSourceContextPeer; | |
| 31 | +import java.awt.event.*; | |
| 32 | +import java.awt.im.InputMethodHighlight; | |
| 33 | +import java.awt.im.spi.InputMethodDescriptor; | |
| 34 | +import java.awt.image.*; | |
| 35 | +import java.awt.datatransfer.Clipboard; | |
| 36 | +import java.awt.peer.*; | |
| 37 | +import java.beans.PropertyChangeListener; | |
| 38 | +import java.lang.reflect.Constructor; | |
| 39 | +import java.lang.reflect.InvocationTargetException; | |
| 40 | +import java.net.URL; | |
| 41 | +import java.util.Map; | |
| 42 | +import java.util.Properties; | |
| 43 | +import sun.awt.im.InputContext; | |
| 44 | +import sun.awt.image.ImageRepresentation; | |
| 45 | + | |
| 46 | +public class HeadlessToolkit extends Toolkit | |
| 47 | + implements ComponentFactory, KeyboardFocusManagerPeerProvider { | |
| 48 | + | |
| 49 | + private Toolkit tk; | |
| 50 | + private ComponentFactory componentFactory; | |
| 51 | + | |
| 52 | + public HeadlessToolkit(Toolkit tk) { | |
| 53 | + this.tk = tk; | |
| 54 | + if (tk instanceof ComponentFactory) { | |
| 55 | + componentFactory = (ComponentFactory)tk; | |
| 56 | + } | |
| 57 | + } | |
| 58 | + | |
| 59 | + public Toolkit getUnderlyingToolkit() { | |
| 60 | + return tk; | |
| 61 | + } | |
| 62 | + | |
| 63 | + /* | |
| 64 | + * Component peer objects. | |
| 65 | + */ | |
| 66 | + | |
| 67 | + /* Lightweight implementation of Canvas and Panel */ | |
| 68 | + | |
| 69 | + public CanvasPeer createCanvas(Canvas target) { | |
| 70 | + return (CanvasPeer)createComponent(target); | |
| 71 | + } | |
| 72 | + | |
| 73 | + public PanelPeer createPanel(Panel target) { | |
| 74 | + return (PanelPeer)createComponent(target); | |
| 75 | + } | |
| 76 | + | |
| 77 | + /* | |
| 78 | + * Component peer objects - unsupported. | |
| 79 | + */ | |
| 80 | + | |
| 81 | + public WindowPeer createWindow(Window target) | |
| 82 | + throws HeadlessException { | |
| 83 | + throw new HeadlessException(); | |
| 84 | + } | |
| 85 | + | |
| 86 | + public FramePeer createFrame(Frame target) | |
| 87 | + throws HeadlessException { | |
| 88 | + throw new HeadlessException(); | |
| 89 | + } | |
| 90 | + | |
| 91 | + public DialogPeer createDialog(Dialog target) | |
| 92 | + throws HeadlessException { | |
| 93 | + throw new HeadlessException(); | |
| 94 | + } | |
| 95 | + | |
| 96 | + public ButtonPeer createButton(Button target) | |
| 97 | + throws HeadlessException { | |
| 98 | + throw new HeadlessException(); | |
| 99 | + } | |
| 100 | + | |
| 101 | + public TextFieldPeer createTextField(TextField target) | |
| 102 | + throws HeadlessException { | |
| 103 | + throw new HeadlessException(); | |
| 104 | + } | |
| 105 | + | |
| 106 | + public ChoicePeer createChoice(Choice target) | |
| 107 | + throws HeadlessException { | |
| 108 | + throw new HeadlessException(); | |
| 109 | + } | |
| 110 | + | |
| 111 | + public LabelPeer createLabel(Label target) | |
| 112 | + throws HeadlessException { | |
| 113 | + throw new HeadlessException(); | |
| 114 | + } | |
| 115 | + | |
| 116 | + public ListPeer createList(List target) | |
| 117 | + throws HeadlessException { | |
| 118 | + throw new HeadlessException(); | |
| 119 | + } | |
| 120 | + | |
| 121 | + public CheckboxPeer createCheckbox(Checkbox target) | |
| 122 | + throws HeadlessException { | |
| 123 | + throw new HeadlessException(); | |
| 124 | + } | |
| 125 | + | |
| 126 | + public ScrollbarPeer createScrollbar(Scrollbar target) | |
| 127 | + throws HeadlessException { | |
| 128 | + throw new HeadlessException(); | |
| 129 | + } | |
| 130 | + | |
| 131 | + public ScrollPanePeer createScrollPane(ScrollPane target) | |
| 132 | + throws HeadlessException { | |
| 133 | + throw new HeadlessException(); | |
| 134 | + } | |
| 135 | + | |
| 136 | + public TextAreaPeer createTextArea(TextArea target) | |
| 137 | + throws HeadlessException { | |
| 138 | + throw new HeadlessException(); | |
| 139 | + } | |
| 140 | + | |
| 141 | + public FileDialogPeer createFileDialog(FileDialog target) | |
| 142 | + throws HeadlessException { | |
| 143 | + throw new HeadlessException(); | |
| 144 | + } | |
| 145 | + | |
| 146 | + public MenuBarPeer createMenuBar(MenuBar target) | |
| 147 | + throws HeadlessException { | |
| 148 | + throw new HeadlessException(); | |
| 149 | + } | |
| 150 | + | |
| 151 | + public MenuPeer createMenu(Menu target) | |
| 152 | + throws HeadlessException { | |
| 153 | + throw new HeadlessException(); | |
| 154 | + } | |
| 155 | + | |
| 156 | + public PopupMenuPeer createPopupMenu(PopupMenu target) | |
| 157 | + throws HeadlessException { | |
| 158 | + throw new HeadlessException(); | |
| 159 | + } | |
| 160 | + | |
| 161 | + public MenuItemPeer createMenuItem(MenuItem target) | |
| 162 | + throws HeadlessException { | |
| 163 | + throw new HeadlessException(); | |
| 164 | + } | |
| 165 | + | |
| 166 | + public CheckboxMenuItemPeer createCheckboxMenuItem(CheckboxMenuItem target) | |
| 167 | + throws HeadlessException { | |
| 168 | + throw new HeadlessException(); | |
| 169 | + } | |
| 170 | + | |
| 171 | + public DragSourceContextPeer createDragSourceContextPeer( | |
| 172 | + DragGestureEvent dge) | |
| 173 | + throws InvalidDnDOperationException { | |
| 174 | + throw new InvalidDnDOperationException("Headless environment"); | |
| 175 | + } | |
| 176 | + | |
| 177 | + public RobotPeer createRobot(Robot target, GraphicsDevice screen) | |
| 178 | + throws AWTException, HeadlessException { | |
| 179 | + throw new HeadlessException(); | |
| 180 | + } | |
| 181 | + | |
| 182 | + public KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager manager) { | |
| 183 | + // See 6833019. | |
| 184 | + return | |
| 185 | + new KeyboardFocusManagerPeer() { | |
| 186 | + public Window getCurrentFocusedWindow() { return null; } | |
| 187 | + public void setCurrentFocusOwner(Component comp) {} | |
| 188 | + public Component getCurrentFocusOwner() { return null; } | |
| 189 | + public void clearGlobalFocusOwner(Window activeWindow) {} | |
| 190 | + }; | |
| 191 | + } | |
| 192 | + | |
| 193 | + public TrayIconPeer createTrayIcon(TrayIcon target) | |
| 194 | + throws HeadlessException { | |
| 195 | + throw new HeadlessException(); | |
| 196 | + } | |
| 197 | + | |
| 198 | + public SystemTrayPeer createSystemTray(SystemTray target) | |
| 199 | + throws HeadlessException { | |
| 200 | + throw new HeadlessException(); | |
| 201 | + } | |
| 202 | + | |
| 203 | + public boolean isTraySupported() { | |
| 204 | + return false; | |
| 205 | + } | |
| 206 | + | |
| 207 | + public GlobalCursorManager getGlobalCursorManager() | |
| 208 | + throws HeadlessException { | |
| 209 | + throw new HeadlessException(); | |
| 210 | + } | |
| 211 | + | |
| 212 | + /* | |
| 213 | + * Headless toolkit - unsupported. | |
| 214 | + */ | |
| 215 | + protected void loadSystemColors(int[] systemColors) | |
| 216 | + throws HeadlessException { | |
| 217 | + throw new HeadlessException(); | |
| 218 | + } | |
| 219 | + | |
| 220 | + public ColorModel getColorModel() | |
| 221 | + throws HeadlessException { | |
| 222 | + throw new HeadlessException(); | |
| 223 | + } | |
| 224 | + | |
| 225 | + public int getScreenResolution() | |
| 226 | + throws HeadlessException { | |
| 227 | + throw new HeadlessException(); | |
| 228 | + } | |
| 229 | + | |
| 230 | + public Map mapInputMethodHighlight(InputMethodHighlight highlight) | |
| 231 | + throws HeadlessException { | |
| 232 | + throw new HeadlessException(); | |
| 233 | + } | |
| 234 | + | |
| 235 | + public int getMenuShortcutKeyMask() | |
| 236 | + throws HeadlessException { | |
| 237 | + throw new HeadlessException(); | |
| 238 | + } | |
| 239 | + | |
| 240 | + public boolean getLockingKeyState(int keyCode) | |
| 241 | + throws UnsupportedOperationException { | |
| 242 | + throw new HeadlessException(); | |
| 243 | + } | |
| 244 | + | |
| 245 | + public void setLockingKeyState(int keyCode, boolean on) | |
| 246 | + throws UnsupportedOperationException { | |
| 247 | + throw new HeadlessException(); | |
| 248 | + } | |
| 249 | + | |
| 250 | + public Cursor createCustomCursor(Image cursor, Point hotSpot, String name) | |
| 251 | + throws IndexOutOfBoundsException, HeadlessException { | |
| 252 | + throw new HeadlessException(); | |
| 253 | + } | |
| 254 | + | |
| 255 | + public Dimension getBestCursorSize(int preferredWidth, int preferredHeight) | |
| 256 | + throws HeadlessException { | |
| 257 | + throw new HeadlessException(); | |
| 258 | + } | |
| 259 | + | |
| 260 | + public int getMaximumCursorColors() | |
| 261 | + throws HeadlessException { | |
| 262 | + throw new HeadlessException(); | |
| 263 | + } | |
| 264 | + | |
| 265 | + public <T extends DragGestureRecognizer> T | |
| 266 | + createDragGestureRecognizer(Class<T> abstractRecognizerClass, | |
| 267 | + DragSource ds, Component c, | |
| 268 | + int srcActions, DragGestureListener dgl) | |
| 269 | + { | |
| 270 | + return null; | |
| 271 | + } | |
| 272 | + | |
| 273 | + public int getScreenHeight() | |
| 274 | + throws HeadlessException { | |
| 275 | + throw new HeadlessException(); | |
| 276 | + } | |
| 277 | + | |
| 278 | + public int getScreenWidth() | |
| 279 | + throws HeadlessException { | |
| 280 | + throw new HeadlessException(); | |
| 281 | + } | |
| 282 | + | |
| 283 | + public Dimension getScreenSize() | |
| 284 | + throws HeadlessException { | |
| 285 | + throw new HeadlessException(); | |
| 286 | + } | |
| 287 | + | |
| 288 | + public Insets getScreenInsets(GraphicsConfiguration gc) | |
| 289 | + throws HeadlessException { | |
| 290 | + throw new HeadlessException(); | |
| 291 | + } | |
| 292 | + | |
| 293 | + public void setDynamicLayout(boolean dynamic) | |
| 294 | + throws HeadlessException { | |
| 295 | + throw new HeadlessException(); | |
| 296 | + } | |
| 297 | + | |
| 298 | + protected boolean isDynamicLayoutSet() | |
| 299 | + throws HeadlessException { | |
| 300 | + throw new HeadlessException(); | |
| 301 | + } | |
| 302 | + | |
| 303 | + public boolean isDynamicLayoutActive() | |
| 304 | + throws HeadlessException { | |
| 305 | + throw new HeadlessException(); | |
| 306 | + } | |
| 307 | + | |
| 308 | + public Clipboard getSystemClipboard() | |
| 309 | + throws HeadlessException { | |
| 310 | + throw new HeadlessException(); | |
| 311 | + } | |
| 312 | + | |
| 313 | + /* | |
| 314 | + * Printing | |
| 315 | + */ | |
| 316 | + public PrintJob getPrintJob(Frame frame, String jobtitle, | |
| 317 | + JobAttributes jobAttributes, | |
| 318 | + PageAttributes pageAttributes) { | |
| 319 | + if (frame != null) { | |
| 320 | + // Should never happen | |
| 321 | + throw new HeadlessException(); | |
| 322 | + } | |
| 323 | + throw new NullPointerException("frame must not be null"); | |
| 324 | + } | |
| 325 | + | |
| 326 | + public PrintJob getPrintJob(Frame frame, String doctitle, Properties props) | |
| 327 | + { | |
| 328 | + if (frame != null) { | |
| 329 | + // Should never happen | |
| 330 | + throw new HeadlessException(); | |
| 331 | + } | |
| 332 | + throw new NullPointerException("frame must not be null"); | |
| 333 | + } | |
| 334 | + | |
| 335 | + /* | |
| 336 | + * Headless toolkit - supported. | |
| 337 | + */ | |
| 338 | + | |
| 339 | + public void sync() { | |
| 340 | + // Do nothing | |
| 341 | + } | |
| 342 | + | |
| 343 | + public void beep() { | |
| 344 | + // Send alert character | |
| 345 | + System.out.write(0x07); | |
| 346 | + } | |
| 347 | + | |
| 348 | + /* | |
| 349 | + * Event Queue | |
| 350 | + */ | |
| 351 | + public EventQueue getSystemEventQueueImpl() { | |
| 352 | + return SunToolkit.getSystemEventQueueImplPP(); | |
| 353 | + } | |
| 354 | + | |
| 355 | + /* | |
| 356 | + * Images. | |
| 357 | + */ | |
| 358 | + public int checkImage(Image img, int w, int h, ImageObserver o) { | |
| 359 | + return tk.checkImage(img, w, h, o); | |
| 360 | + } | |
| 361 | + | |
| 362 | + public boolean prepareImage( | |
| 363 | + Image img, int w, int h, ImageObserver o) { | |
| 364 | + return tk.prepareImage(img, w, h, o); | |
| 365 | + } | |
| 366 | + | |
| 367 | + public Image getImage(String filename) { | |
| 368 | + return tk.getImage(filename); | |
| 369 | + } | |
| 370 | + | |
| 371 | + public Image getImage(URL url) { | |
| 372 | + return tk.getImage(url); | |
| 373 | + } | |
| 374 | + | |
| 375 | + public Image createImage(String filename) { | |
| 376 | + return tk.createImage(filename); | |
| 377 | + } | |
| 378 | + | |
| 379 | + public Image createImage(URL url) { | |
| 380 | + return tk.createImage(url); | |
| 381 | + } | |
| 382 | + | |
| 383 | + public Image createImage(byte[] data, int offset, int length) { | |
| 384 | + return tk.createImage(data, offset, length); | |
| 385 | + } | |
| 386 | + | |
| 387 | + public Image createImage(ImageProducer producer) { | |
| 388 | + return tk.createImage(producer); | |
| 389 | + } | |
| 390 | + | |
| 391 | + public Image createImage(byte[] imagedata) { | |
| 392 | + return tk.createImage(imagedata); | |
| 393 | + } | |
| 394 | + | |
| 395 | + | |
| 396 | + /* | |
| 397 | + * Fonts | |
| 398 | + */ | |
| 399 | + public FontPeer getFontPeer(String name, int style) { | |
| 400 | + if (componentFactory != null) { | |
| 401 | + return componentFactory.getFontPeer(name, style); | |
| 402 | + } | |
| 403 | + return null; | |
| 404 | + } | |
| 405 | + | |
| 406 | + public FontMetrics getFontMetrics(Font font) { | |
| 407 | + return tk.getFontMetrics(font); | |
| 408 | + } | |
| 409 | + | |
| 410 | + public String[] getFontList() { | |
| 411 | + return tk.getFontList(); | |
| 412 | + } | |
| 413 | + | |
| 414 | + /* | |
| 415 | + * Desktop properties | |
| 416 | + */ | |
| 417 | + | |
| 418 | + public void addPropertyChangeListener(String name, | |
| 419 | + PropertyChangeListener pcl) { | |
| 420 | + tk.addPropertyChangeListener(name, pcl); | |
| 421 | + } | |
| 422 | + | |
| 423 | + public void removePropertyChangeListener(String name, | |
| 424 | + PropertyChangeListener pcl) { | |
| 425 | + tk.removePropertyChangeListener(name, pcl); | |
| 426 | + } | |
| 427 | + | |
| 428 | + /* | |
| 429 | + * Modality | |
| 430 | + */ | |
| 431 | + public boolean isModalityTypeSupported(Dialog.ModalityType modalityType) { | |
| 432 | + return false; | |
| 433 | + } | |
| 434 | + | |
| 435 | + public boolean isModalExclusionTypeSupported(Dialog.ModalExclusionType exclusionType) { | |
| 436 | + return false; | |
| 437 | + } | |
| 438 | + | |
| 439 | + /* | |
| 440 | + * Always on top | |
| 441 | + */ | |
| 442 | + public boolean isAlwaysOnTopSupported() { | |
| 443 | + return false; | |
| 444 | + } | |
| 445 | + | |
| 446 | + /* | |
| 447 | + * AWT Event listeners | |
| 448 | + */ | |
| 449 | + | |
| 450 | + public void addAWTEventListener(AWTEventListener listener, | |
| 451 | + long eventMask) { | |
| 452 | + tk.addAWTEventListener(listener, eventMask); | |
| 453 | + } | |
| 454 | + | |
| 455 | + public void removeAWTEventListener(AWTEventListener listener) { | |
| 456 | + tk.removeAWTEventListener(listener); | |
| 457 | + } | |
| 458 | + | |
| 459 | + public AWTEventListener[] getAWTEventListeners() { | |
| 460 | + return tk.getAWTEventListeners(); | |
| 461 | + } | |
| 462 | + | |
| 463 | + public AWTEventListener[] getAWTEventListeners(long eventMask) { | |
| 464 | + return tk.getAWTEventListeners(eventMask); | |
| 465 | + } | |
| 466 | + | |
| 467 | + public boolean isDesktopSupported() { | |
| 468 | + return false; | |
| 469 | + } | |
| 470 | + | |
| 471 | + public DesktopPeer createDesktopPeer(Desktop target) | |
| 472 | + throws HeadlessException{ | |
| 473 | + throw new HeadlessException(); | |
| 474 | + } | |
| 475 | + | |
| 476 | + public boolean areExtraMouseButtonsEnabled() throws HeadlessException{ | |
| 477 | + throw new HeadlessException(); | |
| 478 | + } | |
| 479 | +} | |
| @@ -0,0 +1,154 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1995, 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 | + | |
| 26 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.awt.*; | |
| 29 | + | |
| 30 | +/** | |
| 31 | + * A horizontal 'bag' of Components. Allocates space for each Component | |
| 32 | + * from left to right. | |
| 33 | + * | |
| 34 | + * @author Herb Jellinek | |
| 35 | + */ | |
| 36 | +public class HorizBagLayout implements LayoutManager { | |
| 37 | + | |
| 38 | + int hgap; | |
| 39 | + | |
| 40 | + /** | |
| 41 | + * Constructs a new HorizBagLayout. | |
| 42 | + */ | |
| 43 | + public HorizBagLayout() { | |
| 44 | + this(0); | |
| 45 | + } | |
| 46 | + | |
| 47 | + /** | |
| 48 | + * Constructs a HorizBagLayout with the specified gaps. | |
| 49 | + * @param hgap the horizontal gap | |
| 50 | + */ | |
| 51 | + public HorizBagLayout(int hgap) { | |
| 52 | + this.hgap = hgap; | |
| 53 | + } | |
| 54 | + | |
| 55 | + /** | |
| 56 | + * Adds the specified named component to the layout. | |
| 57 | + * @param name the String name | |
| 58 | + * @param comp the component to be added | |
| 59 | + */ | |
| 60 | + public void addLayoutComponent(String name, Component comp) { | |
| 61 | + } | |
| 62 | + | |
| 63 | + /** | |
| 64 | + * Removes the specified component from the layout. | |
| 65 | + * @param comp the component to be removed | |
| 66 | + */ | |
| 67 | + public void removeLayoutComponent(Component comp) { | |
| 68 | + } | |
| 69 | + | |
| 70 | + /** | |
| 71 | + * Returns the minimum dimensions needed to lay out the components | |
| 72 | + * contained in the specified target container. | |
| 73 | + * @param target the Container on which to do the layout | |
| 74 | + * @see Container | |
| 75 | + * @see #preferredLayoutSize | |
| 76 | + */ | |
| 77 | + public Dimension minimumLayoutSize(Container target) { | |
| 78 | + Dimension dim = new Dimension(); | |
| 79 | + | |
| 80 | + for (int i = 0; i < target.countComponents(); i++) { | |
| 81 | + Component comp = target.getComponent(i); | |
| 82 | + if (comp.isVisible()) { | |
| 83 | + Dimension d = comp.minimumSize(); | |
| 84 | + dim.width += d.width + hgap; | |
| 85 | + dim.height = Math.max(d.height, dim.height); | |
| 86 | + } | |
| 87 | + } | |
| 88 | + | |
| 89 | + Insets insets = target.insets(); | |
| 90 | + dim.width += insets.left + insets.right; | |
| 91 | + dim.height += insets.top + insets.bottom; | |
| 92 | + | |
| 93 | + return dim; | |
| 94 | + } | |
| 95 | + | |
| 96 | + /** | |
| 97 | + * Returns the preferred dimensions for this layout given the components | |
| 98 | + * in the specified target container. | |
| 99 | + * @param target the component which needs to be laid out | |
| 100 | + * @see Container | |
| 101 | + * @see #minimumLayoutSize | |
| 102 | + */ | |
| 103 | + public Dimension preferredLayoutSize(Container target) { | |
| 104 | + Dimension dim = new Dimension(); | |
| 105 | + | |
| 106 | + for (int i = 0; i < target.countComponents(); i++) { | |
| 107 | + Component comp = target.getComponent(i); | |
| 108 | + if (comp.isVisible()) { | |
| 109 | + Dimension d = comp.preferredSize(); | |
| 110 | + dim.width += d.width + hgap; | |
| 111 | + dim.height = Math.max(dim.height, d.height); | |
| 112 | + } | |
| 113 | + } | |
| 114 | + | |
| 115 | + Insets insets = target.insets(); | |
| 116 | + dim.width += insets.left + insets.right; | |
| 117 | + dim.height += insets.top + insets.bottom; | |
| 118 | + | |
| 119 | + return dim; | |
| 120 | + } | |
| 121 | + | |
| 122 | + /** | |
| 123 | + * Lays out the specified container. This method will actually reshape the | |
| 124 | + * components in the specified target container in order to satisfy the | |
| 125 | + * constraints of the HorizBagLayout object. | |
| 126 | + * @param target the component being laid out | |
| 127 | + * @see Container | |
| 128 | + */ | |
| 129 | + public void layoutContainer(Container target) { | |
| 130 | + Insets insets = target.insets(); | |
| 131 | + int top = insets.top; | |
| 132 | + int bottom = target.size().height - insets.bottom; | |
| 133 | + int left = insets.left; | |
| 134 | + int right = target.size().width - insets.right; | |
| 135 | + | |
| 136 | + for (int i = 0; i < target.countComponents(); i++) { | |
| 137 | + Component comp = target.getComponent(i); | |
| 138 | + if (comp.isVisible()) { | |
| 139 | + int compWidth = comp.size().width; | |
| 140 | + comp.resize(compWidth, bottom - top); | |
| 141 | + Dimension d = comp.preferredSize(); | |
| 142 | + comp.reshape(left, top, d.width, bottom - top); | |
| 143 | + left += d.width + hgap; | |
| 144 | + } | |
| 145 | + } | |
| 146 | + } | |
| 147 | + | |
| 148 | + /** | |
| 149 | + * Returns the String representation of this HorizBagLayout's values. | |
| 150 | + */ | |
| 151 | + public String toString() { | |
| 152 | + return getClass().getName() + "[hgap=" + hgap + "]"; | |
| 153 | + } | |
| 154 | +} | |
Binary file not shown.
| @@ -0,0 +1,57 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 2000, 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 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.awt.AWTException; | |
| 29 | +import java.awt.Window; | |
| 30 | +import java.awt.im.spi.InputMethodDescriptor; | |
| 31 | +import java.util.Locale; | |
| 32 | +import sun.awt.im.InputContext; | |
| 33 | + | |
| 34 | +/** | |
| 35 | + * Input method support for toolkits | |
| 36 | + */ | |
| 37 | +public interface InputMethodSupport { | |
| 38 | + /** | |
| 39 | + * Returns a new input method adapter descriptor for native input methods. | |
| 40 | + */ | |
| 41 | + InputMethodDescriptor getInputMethodAdapterDescriptor() | |
| 42 | + throws AWTException; | |
| 43 | + /** | |
| 44 | + * Returns a new input method window for the platform | |
| 45 | + */ | |
| 46 | + Window createInputMethodWindow(String title, InputContext context); | |
| 47 | + | |
| 48 | + /** | |
| 49 | + * Returns whether input methods are enabled on the platform | |
| 50 | + */ | |
| 51 | + boolean enableInputMethodsForTextComponent(); | |
| 52 | + | |
| 53 | + /** | |
| 54 | + * Returns the default keyboard locale of the underlying operating system. | |
| 55 | + */ | |
| 56 | + Locale getDefaultKeyboardLocale(); | |
| 57 | +} | |
| @@ -0,0 +1,178 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 2003, 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 | +package sun.awt; | |
| 26 | + | |
| 27 | +import java.awt.Component; | |
| 28 | +import java.awt.KeyboardFocusManager; | |
| 29 | +import java.awt.Window; | |
| 30 | +import java.awt.Canvas; | |
| 31 | +import java.awt.Scrollbar; | |
| 32 | +import java.awt.Panel; | |
| 33 | + | |
| 34 | +import java.awt.event.FocusEvent; | |
| 35 | + | |
| 36 | +import java.awt.peer.KeyboardFocusManagerPeer; | |
| 37 | +import java.awt.peer.ComponentPeer; | |
| 38 | + | |
| 39 | +import java.lang.reflect.InvocationTargetException; | |
| 40 | +import java.lang.reflect.Method; | |
| 41 | + | |
| 42 | +import sun.util.logging.PlatformLogger; | |
| 43 | + | |
| 44 | +public abstract class KeyboardFocusManagerPeerImpl implements KeyboardFocusManagerPeer { | |
| 45 | + | |
| 46 | + private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.awt.focus.KeyboardFocusManagerPeerImpl"); | |
| 47 | + | |
| 48 | + private static AWTAccessor.KeyboardFocusManagerAccessor kfmAccessor = | |
| 49 | + AWTAccessor.getKeyboardFocusManagerAccessor(); | |
| 50 | + | |
| 51 | + // The constants are copied from java.awt.KeyboardFocusManager | |
| 52 | + public static final int SNFH_FAILURE = 0; | |
| 53 | + public static final int SNFH_SUCCESS_HANDLED = 1; | |
| 54 | + public static final int SNFH_SUCCESS_PROCEED = 2; | |
| 55 | + | |
| 56 | + protected KeyboardFocusManager manager; | |
| 57 | + | |
| 58 | + public KeyboardFocusManagerPeerImpl(KeyboardFocusManager manager) { | |
| 59 | + this.manager = manager; | |
| 60 | + } | |
| 61 | + | |
| 62 | + @Override | |
| 63 | + public void clearGlobalFocusOwner(Window activeWindow) { | |
| 64 | + if (activeWindow != null) { | |
| 65 | + Component focusOwner = activeWindow.getFocusOwner(); | |
| 66 | + if (focusLog.isLoggable(PlatformLogger.FINE)) | |
| 67 | + focusLog.fine("Clearing global focus owner " + focusOwner); | |
| 68 | + if (focusOwner != null) { | |
| 69 | + FocusEvent fl = new CausedFocusEvent(focusOwner, FocusEvent.FOCUS_LOST, false, null, | |
| 70 | + CausedFocusEvent.Cause.CLEAR_GLOBAL_FOCUS_OWNER); | |
| 71 | + SunToolkit.postPriorityEvent(fl); | |
| 72 | + } | |
| 73 | + } | |
| 74 | + } | |
| 75 | + | |
| 76 | + /* | |
| 77 | + * WARNING: Don't call it on the Toolkit thread. | |
| 78 | + * | |
| 79 | + * Checks if the component: | |
| 80 | + * 1) accepts focus on click (in general) | |
| 81 | + * 2) may be a focus owner (in particular) | |
| 82 | + */ | |
| 83 | + public static boolean shouldFocusOnClick(Component component) { | |
| 84 | + boolean acceptFocusOnClick = false; | |
| 85 | + | |
| 86 | + // A component is generally allowed to accept focus on click | |
| 87 | + // if its peer is focusable. There're some exceptions though. | |
| 88 | + | |
| 89 | + | |
| 90 | + // CANVAS & SCROLLBAR accept focus on click | |
| 91 | + if (component instanceof Canvas || | |
| 92 | + component instanceof Scrollbar) | |
| 93 | + { | |
| 94 | + acceptFocusOnClick = true; | |
| 95 | + | |
| 96 | + // PANEL, empty only, accepts focus on click | |
| 97 | + } else if (component instanceof Panel) { | |
| 98 | + acceptFocusOnClick = (((Panel)component).getComponentCount() == 0); | |
| 99 | + | |
| 100 | + | |
| 101 | + // Other components | |
| 102 | + } else { | |
| 103 | + ComponentPeer peer = (component != null ? component.getPeer() : null); | |
| 104 | + acceptFocusOnClick = (peer != null ? peer.isFocusable() : false); | |
| 105 | + } | |
| 106 | + return acceptFocusOnClick && | |
| 107 | + AWTAccessor.getComponentAccessor().canBeFocusOwner(component); | |
| 108 | + } | |
| 109 | + | |
| 110 | + /* | |
| 111 | + * Posts proper lost/gain focus events to the event queue. | |
| 112 | + */ | |
| 113 | + public static boolean deliverFocus(Component lightweightChild, | |
| 114 | + Component target, | |
| 115 | + boolean temporary, | |
| 116 | + boolean focusedWindowChangeAllowed, | |
| 117 | + long time, | |
| 118 | + CausedFocusEvent.Cause cause, | |
| 119 | + Component currentFocusOwner) // provided by the descendant peers | |
| 120 | + { | |
| 121 | + if (lightweightChild == null) { | |
| 122 | + lightweightChild = (Component)target; | |
| 123 | + } | |
| 124 | + | |
| 125 | + Component currentOwner = currentFocusOwner; | |
| 126 | + if (currentOwner != null && currentOwner.getPeer() == null) { | |
| 127 | + currentOwner = null; | |
| 128 | + } | |
| 129 | + if (currentOwner != null) { | |
| 130 | + FocusEvent fl = new CausedFocusEvent(currentOwner, FocusEvent.FOCUS_LOST, | |
| 131 | + false, lightweightChild, cause); | |
| 132 | + | |
| 133 | + if (focusLog.isLoggable(PlatformLogger.FINER)) | |
| 134 | + focusLog.finer("Posting focus event: " + fl); | |
| 135 | + SunToolkit.postPriorityEvent(fl); | |
| 136 | + } | |
| 137 | + | |
| 138 | + FocusEvent fg = new CausedFocusEvent(lightweightChild, FocusEvent.FOCUS_GAINED, | |
| 139 | + false, currentOwner, cause); | |
| 140 | + | |
| 141 | + if (focusLog.isLoggable(PlatformLogger.FINER)) | |
| 142 | + focusLog.finer("Posting focus event: " + fg); | |
| 143 | + SunToolkit.postPriorityEvent(fg); | |
| 144 | + return true; | |
| 145 | + } | |
| 146 | + | |
| 147 | + // WARNING: Don't call it on the Toolkit thread. | |
| 148 | + public static boolean requestFocusFor(Component target, CausedFocusEvent.Cause cause) { | |
| 149 | + return AWTAccessor.getComponentAccessor().requestFocus(target, cause); | |
| 150 | + } | |
| 151 | + | |
| 152 | + // WARNING: Don't call it on the Toolkit thread. | |
| 153 | + public static int shouldNativelyFocusHeavyweight(Component heavyweight, | |
| 154 | + Component descendant, | |
| 155 | + boolean temporary, | |
| 156 | + boolean focusedWindowChangeAllowed, | |
| 157 | + long time, | |
| 158 | + CausedFocusEvent.Cause cause) | |
| 159 | + { | |
| 160 | + return kfmAccessor.shouldNativelyFocusHeavyweight( | |
| 161 | + heavyweight, descendant, temporary, focusedWindowChangeAllowed, time, cause); | |
| 162 | + } | |
| 163 | + | |
| 164 | + public static void removeLastFocusRequest(Component heavyweight) { | |
| 165 | + kfmAccessor.removeLastFocusRequest(heavyweight); | |
| 166 | + } | |
| 167 | + | |
| 168 | + // WARNING: Don't call it on the Toolkit thread. | |
| 169 | + public static boolean processSynchronousLightweightTransfer(Component heavyweight, | |
| 170 | + Component descendant, | |
| 171 | + boolean temporary, | |
| 172 | + boolean focusedWindowChangeAllowed, | |
| 173 | + long time) | |
| 174 | + { | |
| 175 | + return kfmAccessor.processSynchronousLightweightTransfer( | |
| 176 | + heavyweight, descendant, temporary, focusedWindowChangeAllowed, time); | |
| 177 | + } | |
| 178 | +} | |
Binary file not shown.
| @@ -0,0 +1,44 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 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 | + | |
| 26 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.awt.KeyboardFocusManager; | |
| 29 | +import java.awt.peer.KeyboardFocusManagerPeer; | |
| 30 | + | |
| 31 | +/** | |
| 32 | + * {@link KeyboardFocusManagerPeerProvider} is required to be implemented by | |
| 33 | + * the currently used {@link java.awt.Toolkit} instance. In order to initialize | |
| 34 | + * {@link java.awt.KeyboardFocusManager}, an instance of {@link KeyboardFocusManagerPeer} | |
| 35 | + * is needed. To create that instance, the {@link #createKeyboardFocusManagerPeer} | |
| 36 | + * method of the current toolkit is called. | |
| 37 | + */ | |
| 38 | +public interface KeyboardFocusManagerPeerProvider { | |
| 39 | + | |
| 40 | + /** | |
| 41 | + * Creates a KeyboardFocusManagerPeer for the specified KeyboardFocusManager. | |
| 42 | + */ | |
| 43 | + KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager manager); | |
| 44 | +} | |
Binary file not shown.
| @@ -0,0 +1,37 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 2003, 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 | +package sun.awt; | |
| 27 | + | |
| 28 | +/** | |
| 29 | + * Interface for identifying a component that will be excluded during | |
| 30 | + * modal operations. Implementing this interface will ensure that the | |
| 31 | + * component willl still receive it's events. | |
| 32 | + * | |
| 33 | + * @since 1.5 | |
| 34 | + * @author Joshua Outwater | |
| 35 | + */ | |
| 36 | +public interface ModalExclude { | |
| 37 | +} | |
Binary file not shown.
| @@ -0,0 +1,60 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 2003, 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 | + | |
| 26 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.awt.*; | |
| 29 | + | |
| 30 | +/** | |
| 31 | + * Event object describing changes in AWT modality | |
| 32 | + */ | |
| 33 | +public class ModalityEvent extends AWTEvent implements ActiveEvent { | |
| 34 | + | |
| 35 | + public static final int MODALITY_PUSHED = 1300; | |
| 36 | + public static final int MODALITY_POPPED = 1301; | |
| 37 | + | |
| 38 | + private ModalityListener listener; | |
| 39 | + | |
| 40 | + public ModalityEvent(Object source, ModalityListener listener, int id) { | |
| 41 | + super(source, id); | |
| 42 | + this.listener = listener; | |
| 43 | + } | |
| 44 | + | |
| 45 | + public void dispatch() { | |
| 46 | + switch(getID()) { | |
| 47 | + case MODALITY_PUSHED: | |
| 48 | + listener.modalityPushed(this); | |
| 49 | + break; | |
| 50 | + | |
| 51 | + case MODALITY_POPPED: | |
| 52 | + listener.modalityPopped(this); | |
| 53 | + break; | |
| 54 | + | |
| 55 | + default: | |
| 56 | + throw new Error("Invalid event id."); | |
| 57 | + } | |
| 58 | + } | |
| 59 | + | |
| 60 | +} | |
Binary file not shown.
| @@ -0,0 +1,42 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 2003, 2005, 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 | +package sun.awt; | |
| 27 | + | |
| 28 | +/** | |
| 29 | + * Listener interface so Java Plug-in can be notified | |
| 30 | + * of changes in AWT modality | |
| 31 | + */ | |
| 32 | +public interface ModalityListener { | |
| 33 | + /** | |
| 34 | + * Called by AWT when it enters a new level of modality | |
| 35 | + */ | |
| 36 | + public void modalityPushed(ModalityEvent ev); | |
| 37 | + | |
| 38 | + /** | |
| 39 | + * Called by AWT when it exits a level of modality | |
| 40 | + */ | |
| 41 | + public void modalityPopped(ModalityEvent ev); | |
| 42 | +} | |
Binary file not shown.
| @@ -0,0 +1,62 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1999, 2000, 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 | +package sun.awt; | |
| 27 | + | |
| 28 | +public class Mutex { | |
| 29 | + private boolean locked; | |
| 30 | + private Thread owner; | |
| 31 | + | |
| 32 | + public synchronized void lock() { | |
| 33 | + if (locked && Thread.currentThread() == owner) { | |
| 34 | + throw new IllegalMonitorStateException(); | |
| 35 | + } | |
| 36 | + do { | |
| 37 | + if (!locked) { | |
| 38 | + locked = true; | |
| 39 | + owner = Thread.currentThread(); | |
| 40 | + } else { | |
| 41 | + try { | |
| 42 | + wait(); | |
| 43 | + } catch (InterruptedException e) { | |
| 44 | + // try again | |
| 45 | + } | |
| 46 | + } | |
| 47 | + } while (owner != Thread.currentThread()); | |
| 48 | + } | |
| 49 | + | |
| 50 | + public synchronized void unlock() { | |
| 51 | + if (Thread.currentThread() != owner) { | |
| 52 | + throw new IllegalMonitorStateException(); | |
| 53 | + } | |
| 54 | + owner = null; | |
| 55 | + locked = false; | |
| 56 | + notify(); | |
| 57 | + } | |
| 58 | + | |
| 59 | + protected boolean isOwned() { | |
| 60 | + return (locked && Thread.currentThread() == owner); | |
| 61 | + } | |
| 62 | +} | |
Binary file not shown.
| @@ -0,0 +1,59 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1998, 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 | +package sun.awt; | |
| 27 | + | |
| 28 | +class NativeLibLoader { | |
| 29 | + | |
| 30 | + /** | |
| 31 | + * This is copied from java.awt.Toolkit since we need the library | |
| 32 | + * loaded in sun.awt.image also: | |
| 33 | + * | |
| 34 | + * WARNING: This is a temporary workaround for a problem in the | |
| 35 | + * way the AWT loads native libraries. A number of classes in this | |
| 36 | + * package (sun.awt.image) have a native method, initIDs(), | |
| 37 | + * which initializes | |
| 38 | + * the JNI field and method ids used in the native portion of | |
| 39 | + * their implementation. | |
| 40 | + * | |
| 41 | + * Since the use and storage of these ids is done by the | |
| 42 | + * implementation libraries, the implementation of these method is | |
| 43 | + * provided by the particular AWT implementations | |
| 44 | + * (i.e. "Toolkit"s/Peer), such as Motif, Win32 or Tiny. The | |
| 45 | + * problem is that this means that the native libraries must be | |
| 46 | + * loaded by the java.* classes, which do not necessarily know the | |
| 47 | + * names of the libraries to load. A better way of doing this | |
| 48 | + * would be to provide a separate library which defines java.awt.* | |
| 49 | + * initIDs, and exports the relevant symbols out to the | |
| 50 | + * implementation libraries. | |
| 51 | + * | |
| 52 | + * For now, we know it's done by the implementation, and we assume | |
| 53 | + * that the name of the library is "awt". -br. | |
| 54 | + */ | |
| 55 | + static void loadLibraries() { | |
| 56 | + java.security.AccessController.doPrivileged( | |
| 57 | + new sun.security.action.LoadLibraryAction("awt")); | |
| 58 | + } | |
| 59 | +} | |
Binary file not shown.
| @@ -0,0 +1,312 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 2000, 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 | + */ | |
| 25 | + | |
| 26 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.awt.AWTException; | |
| 29 | +import java.awt.BufferCapabilities; | |
| 30 | +import java.awt.Color; | |
| 31 | +import java.awt.Component; | |
| 32 | +import java.awt.Cursor; | |
| 33 | +import java.awt.Dimension; | |
| 34 | +import java.awt.Font; | |
| 35 | +import java.awt.FontMetrics; | |
| 36 | +import java.awt.Graphics; | |
| 37 | +import java.awt.GraphicsConfiguration; | |
| 38 | +import java.awt.Image; | |
| 39 | +import java.awt.Insets; | |
| 40 | +import java.awt.MenuBar; | |
| 41 | +import java.awt.Point; | |
| 42 | +import java.awt.Event; | |
| 43 | +import java.awt.event.PaintEvent; | |
| 44 | +import java.awt.image.ColorModel; | |
| 45 | +import java.awt.image.ImageObserver; | |
| 46 | +import java.awt.image.ImageProducer; | |
| 47 | +import java.awt.image.VolatileImage; | |
| 48 | +import java.awt.peer.CanvasPeer; | |
| 49 | +import java.awt.peer.LightweightPeer; | |
| 50 | +import java.awt.peer.PanelPeer; | |
| 51 | +import java.awt.peer.ComponentPeer; | |
| 52 | +import java.awt.peer.ContainerPeer; | |
| 53 | +import java.awt.Rectangle; | |
| 54 | +import sun.java2d.pipe.Region; | |
| 55 | + | |
| 56 | + | |
| 57 | +/** | |
| 58 | + * Implements the LightweightPeer interface for use in lightweight components | |
| 59 | + * that have no native window associated with them. This gets created by | |
| 60 | + * default in Component so that Component and Container can be directly | |
| 61 | + * extended to create useful components written entirely in java. These | |
| 62 | + * components must be hosted somewhere higher up in the component tree by a | |
| 63 | + * native container (such as a Frame). | |
| 64 | + * | |
| 65 | + * This implementation provides no useful semantics and serves only as a | |
| 66 | + * marker. One could provide alternative implementations in java that do | |
| 67 | + * something useful for some of the other peer interfaces to minimize the | |
| 68 | + * native code. | |
| 69 | + * | |
| 70 | + * This was renamed from java.awt.LightweightPeer (a horrible and confusing | |
| 71 | + * name) and moved from java.awt.Toolkit into sun.awt as a public class in | |
| 72 | + * its own file. | |
| 73 | + * | |
| 74 | + * @author Timothy Prinzing | |
| 75 | + * @author Michael Martak | |
| 76 | + */ | |
| 77 | + | |
| 78 | +public class NullComponentPeer implements LightweightPeer, | |
| 79 | + CanvasPeer, PanelPeer { | |
| 80 | + | |
| 81 | + public boolean isObscured() { | |
| 82 | + return false; | |
| 83 | + } | |
| 84 | + | |
| 85 | + public boolean canDetermineObscurity() { | |
| 86 | + return false; | |
| 87 | + } | |
| 88 | + | |
| 89 | + public boolean isFocusable() { | |
| 90 | + return false; | |
| 91 | + } | |
| 92 | + | |
| 93 | + public void setVisible(boolean b) { | |
| 94 | + } | |
| 95 | + | |
| 96 | + public void show() { | |
| 97 | + } | |
| 98 | + | |
| 99 | + public void hide() { | |
| 100 | + } | |
| 101 | + | |
| 102 | + public void setEnabled(boolean b) { | |
| 103 | + } | |
| 104 | + | |
| 105 | + public void enable() { | |
| 106 | + } | |
| 107 | + | |
| 108 | + public void disable() { | |
| 109 | + } | |
| 110 | + | |
| 111 | + public void paint(Graphics g) { | |
| 112 | + } | |
| 113 | + | |
| 114 | + public void repaint(long tm, int x, int y, int width, int height) { | |
| 115 | + } | |
| 116 | + | |
| 117 | + public void print(Graphics g) { | |
| 118 | + } | |
| 119 | + | |
| 120 | + public void setBounds(int x, int y, int width, int height, int op) { | |
| 121 | + } | |
| 122 | + | |
| 123 | + public void reshape(int x, int y, int width, int height) { | |
| 124 | + } | |
| 125 | + | |
| 126 | + public void coalescePaintEvent(PaintEvent e) { | |
| 127 | + } | |
| 128 | + | |
| 129 | + public boolean handleEvent(Event e) { | |
| 130 | + return false; | |
| 131 | + } | |
| 132 | + | |
| 133 | + public void handleEvent(java.awt.AWTEvent arg0) { | |
| 134 | + } | |
| 135 | + | |
| 136 | + public Dimension getPreferredSize() { | |
| 137 | + return new Dimension(1,1); | |
| 138 | + } | |
| 139 | + | |
| 140 | + public Dimension getMinimumSize() { | |
| 141 | + return new Dimension(1,1); | |
| 142 | + } | |
| 143 | + | |
| 144 | + public java.awt.Toolkit getToolkit() { | |
| 145 | + return null; | |
| 146 | + } | |
| 147 | + | |
| 148 | + public ColorModel getColorModel() { | |
| 149 | + return null; | |
| 150 | + } | |
| 151 | + | |
| 152 | + public Graphics getGraphics() { | |
| 153 | + return null; | |
| 154 | + } | |
| 155 | + | |
| 156 | + public GraphicsConfiguration getGraphicsConfiguration() { | |
| 157 | + return null; | |
| 158 | + } | |
| 159 | + | |
| 160 | + public FontMetrics getFontMetrics(Font font) { | |
| 161 | + return null; | |
| 162 | + } | |
| 163 | + | |
| 164 | + public void dispose() { | |
| 165 | + // no native code | |
| 166 | + } | |
| 167 | + | |
| 168 | + public void setForeground(Color c) { | |
| 169 | + } | |
| 170 | + | |
| 171 | + public void setBackground(Color c) { | |
| 172 | + } | |
| 173 | + | |
| 174 | + public void setFont(Font f) { | |
| 175 | + } | |
| 176 | + | |
| 177 | + public void updateCursorImmediately() { | |
| 178 | + } | |
| 179 | + | |
| 180 | + public void setCursor(Cursor cursor) { | |
| 181 | + } | |
| 182 | + | |
| 183 | + public boolean requestFocus | |
| 184 | + (Component lightweightChild, boolean temporary, | |
| 185 | + boolean focusedWindowChangeAllowed, long time, CausedFocusEvent.Cause cause) { | |
| 186 | + return false; | |
| 187 | + } | |
| 188 | + | |
| 189 | + public Image createImage(ImageProducer producer) { | |
| 190 | + return null; | |
| 191 | + } | |
| 192 | + | |
| 193 | + public Image createImage(int width, int height) { | |
| 194 | + return null; | |
| 195 | + } | |
| 196 | + | |
| 197 | + public boolean prepareImage(Image img, int w, int h, ImageObserver o) { | |
| 198 | + return false; | |
| 199 | + } | |
| 200 | + | |
| 201 | + public int checkImage(Image img, int w, int h, ImageObserver o) { | |
| 202 | + return 0; | |
| 203 | + } | |
| 204 | + | |
| 205 | + public Dimension preferredSize() { | |
| 206 | + return getPreferredSize(); | |
| 207 | + } | |
| 208 | + | |
| 209 | + public Dimension minimumSize() { | |
| 210 | + return getMinimumSize(); | |
| 211 | + } | |
| 212 | + | |
| 213 | + public Point getLocationOnScreen() { | |
| 214 | + return new Point(0,0); | |
| 215 | + } | |
| 216 | + | |
| 217 | + public Insets getInsets() { | |
| 218 | + return insets(); | |
| 219 | + } | |
| 220 | + | |
| 221 | + public void beginValidate() { | |
| 222 | + } | |
| 223 | + | |
| 224 | + public void endValidate() { | |
| 225 | + } | |
| 226 | + | |
| 227 | + public Insets insets() { | |
| 228 | + return new Insets(0, 0, 0, 0); | |
| 229 | + } | |
| 230 | + | |
| 231 | + public boolean isPaintPending() { | |
| 232 | + return false; | |
| 233 | + } | |
| 234 | + | |
| 235 | + public boolean handlesWheelScrolling() { | |
| 236 | + return false; | |
| 237 | + } | |
| 238 | + | |
| 239 | + public VolatileImage createVolatileImage(int width, int height) { | |
| 240 | + return null; | |
| 241 | + } | |
| 242 | + | |
| 243 | + public void beginLayout() { | |
| 244 | + } | |
| 245 | + | |
| 246 | + public void endLayout() { | |
| 247 | + } | |
| 248 | + | |
| 249 | + public void createBuffers(int numBuffers, BufferCapabilities caps) | |
| 250 | + throws AWTException { | |
| 251 | + throw new AWTException( | |
| 252 | + "Page-flipping is not allowed on a lightweight component"); | |
| 253 | + } | |
| 254 | + public Image getBackBuffer() { | |
| 255 | + throw new IllegalStateException( | |
| 256 | + "Page-flipping is not allowed on a lightweight component"); | |
| 257 | + } | |
| 258 | + public void flip(int x1, int y1, int x2, int y2, | |
| 259 | + BufferCapabilities.FlipContents flipAction) | |
| 260 | + { | |
| 261 | + throw new IllegalStateException( | |
| 262 | + "Page-flipping is not allowed on a lightweight component"); | |
| 263 | + } | |
| 264 | + public void destroyBuffers() { | |
| 265 | + } | |
| 266 | + | |
| 267 | + /** | |
| 268 | + * @see java.awt.peer.ComponentPeer#isReparentSupported | |
| 269 | + */ | |
| 270 | + public boolean isReparentSupported() { | |
| 271 | + return false; | |
| 272 | + } | |
| 273 | + | |
| 274 | + /** | |
| 275 | + * @see java.awt.peer.ComponentPeer#reparent | |
| 276 | + */ | |
| 277 | + public void reparent(ContainerPeer newNativeParent) { | |
| 278 | + throw new UnsupportedOperationException(); | |
| 279 | + } | |
| 280 | + | |
| 281 | + public void layout() { | |
| 282 | + } | |
| 283 | + | |
| 284 | + public Rectangle getBounds() { | |
| 285 | + return new Rectangle(0, 0, 0, 0); | |
| 286 | + } | |
| 287 | + | |
| 288 | + | |
| 289 | + /** | |
| 290 | + * Applies the shape to the native component window. | |
| 291 | + * @since 1.7 | |
| 292 | + */ | |
| 293 | + public void applyShape(Region shape) { | |
| 294 | + } | |
| 295 | + | |
| 296 | + /** | |
| 297 | + * Lowers this component at the bottom of the above HW peer. If the above parameter | |
| 298 | + * is null then the method places this component at the top of the Z-order. | |
| 299 | + */ | |
| 300 | + public void setZOrder(ComponentPeer above) { | |
| 301 | + } | |
| 302 | + | |
| 303 | + public boolean updateGraphicsData(GraphicsConfiguration gc) { | |
| 304 | + return false; | |
| 305 | + } | |
| 306 | + | |
| 307 | + public GraphicsConfiguration getAppropriateGraphicsConfiguration( | |
| 308 | + GraphicsConfiguration gc) | |
| 309 | + { | |
| 310 | + return gc; | |
| 311 | + } | |
| 312 | +} | |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1,184 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1997, 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 | + */ | |
| 25 | + | |
| 26 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.security.PrivilegedAction; | |
| 29 | +import java.util.HashMap; | |
| 30 | +import java.util.Map; | |
| 31 | + | |
| 32 | +import static sun.awt.OSInfo.OSType.*; | |
| 33 | + | |
| 34 | +/** | |
| 35 | + * @author Pavel Porvatov | |
| 36 | + */ | |
| 37 | +public class OSInfo { | |
| 38 | + public static enum OSType { | |
| 39 | + WINDOWS, | |
| 40 | + LINUX, | |
| 41 | + SOLARIS, | |
| 42 | + UNKNOWN | |
| 43 | + } | |
| 44 | + | |
| 45 | + /* | |
| 46 | + The map windowsVersionMap must contain all windows version constants except WINDOWS_UNKNOWN, | |
| 47 | + and so the method getWindowsVersion() will return the constant for known OS. | |
| 48 | + It allows compare objects by "==" instead of "equals". | |
| 49 | + */ | |
| 50 | + public static final WindowsVersion WINDOWS_UNKNOWN = new WindowsVersion(-1, -1); | |
| 51 | + public static final WindowsVersion WINDOWS_95 = new WindowsVersion(4, 0); | |
| 52 | + public static final WindowsVersion WINDOWS_98 = new WindowsVersion(4, 10); | |
| 53 | + public static final WindowsVersion WINDOWS_ME = new WindowsVersion(4, 90); | |
| 54 | + public static final WindowsVersion WINDOWS_2000 = new WindowsVersion(5, 0); | |
| 55 | + public static final WindowsVersion WINDOWS_XP = new WindowsVersion(5, 1); | |
| 56 | + public static final WindowsVersion WINDOWS_2003 = new WindowsVersion(5, 2); | |
| 57 | + public static final WindowsVersion WINDOWS_VISTA = new WindowsVersion(6, 0); | |
| 58 | + | |
| 59 | + private static final String OS_NAME = "os.name"; | |
| 60 | + private static final String OS_VERSION = "os.version"; | |
| 61 | + | |
| 62 | + private final static Map<String, WindowsVersion> windowsVersionMap = new HashMap<String, OSInfo.WindowsVersion>(); | |
| 63 | + | |
| 64 | + static { | |
| 65 | + windowsVersionMap.put(WINDOWS_95.toString(), WINDOWS_95); | |
| 66 | + windowsVersionMap.put(WINDOWS_98.toString(), WINDOWS_98); | |
| 67 | + windowsVersionMap.put(WINDOWS_ME.toString(), WINDOWS_ME); | |
| 68 | + windowsVersionMap.put(WINDOWS_2000.toString(), WINDOWS_2000); | |
| 69 | + windowsVersionMap.put(WINDOWS_XP.toString(), WINDOWS_XP); | |
| 70 | + windowsVersionMap.put(WINDOWS_2003.toString(), WINDOWS_2003); | |
| 71 | + windowsVersionMap.put(WINDOWS_VISTA.toString(), WINDOWS_VISTA); | |
| 72 | + } | |
| 73 | + | |
| 74 | + private static final PrivilegedAction<OSType> osTypeAction = new PrivilegedAction<OSType>() { | |
| 75 | + public OSType run() { | |
| 76 | + return getOSType(); | |
| 77 | + } | |
| 78 | + }; | |
| 79 | + | |
| 80 | + private OSInfo() { | |
| 81 | + // Don't allow to create instances | |
| 82 | + } | |
| 83 | + | |
| 84 | + /** | |
| 85 | + * Returns type of operating system. | |
| 86 | + */ | |
| 87 | + public static OSType getOSType() throws SecurityException { | |
| 88 | + String osName = System.getProperty(OS_NAME); | |
| 89 | + | |
| 90 | + if (osName != null) { | |
| 91 | + if (osName.contains("Windows")) { | |
| 92 | + return WINDOWS; | |
| 93 | + } | |
| 94 | + | |
| 95 | + if (osName.contains("Linux")) { | |
| 96 | + return LINUX; | |
| 97 | + } | |
| 98 | + | |
| 99 | + if (osName.contains("Solaris") || osName.contains("SunOS")) { | |
| 100 | + return SOLARIS; | |
| 101 | + } | |
| 102 | + | |
| 103 | + // determine another OS here | |
| 104 | + } | |
| 105 | + | |
| 106 | + return UNKNOWN; | |
| 107 | + } | |
| 108 | + | |
| 109 | + public static PrivilegedAction<OSType> getOSTypeAction() { | |
| 110 | + return osTypeAction; | |
| 111 | + } | |
| 112 | + | |
| 113 | + public static WindowsVersion getWindowsVersion() throws SecurityException { | |
| 114 | + String osVersion = System.getProperty(OS_VERSION); | |
| 115 | + | |
| 116 | + if (osVersion == null) { | |
| 117 | + return WINDOWS_UNKNOWN; | |
| 118 | + } | |
| 119 | + | |
| 120 | + synchronized (windowsVersionMap) { | |
| 121 | + WindowsVersion result = windowsVersionMap.get(osVersion); | |
| 122 | + | |
| 123 | + if (result == null) { | |
| 124 | + // Try parse version and put object into windowsVersionMap | |
| 125 | + String[] arr = osVersion.split("\\."); | |
| 126 | + | |
| 127 | + if (arr.length == 2) { | |
| 128 | + try { | |
| 129 | + result = new WindowsVersion(Integer.parseInt(arr[0]), Integer.parseInt(arr[1])); | |
| 130 | + } catch (NumberFormatException e) { | |
| 131 | + return WINDOWS_UNKNOWN; | |
| 132 | + } | |
| 133 | + } else { | |
| 134 | + return WINDOWS_UNKNOWN; | |
| 135 | + } | |
| 136 | + | |
| 137 | + windowsVersionMap.put(osVersion, result); | |
| 138 | + } | |
| 139 | + | |
| 140 | + return result; | |
| 141 | + } | |
| 142 | + } | |
| 143 | + | |
| 144 | + public static class WindowsVersion implements Comparable<WindowsVersion> { | |
| 145 | + private final int major; | |
| 146 | + | |
| 147 | + private final int minor; | |
| 148 | + | |
| 149 | + private WindowsVersion(int major, int minor) { | |
| 150 | + this.major = major; | |
| 151 | + this.minor = minor; | |
| 152 | + } | |
| 153 | + | |
| 154 | + public int getMajor() { | |
| 155 | + return major; | |
| 156 | + } | |
| 157 | + | |
| 158 | + public int getMinor() { | |
| 159 | + return minor; | |
| 160 | + } | |
| 161 | + | |
| 162 | + public int compareTo(WindowsVersion o) { | |
| 163 | + int result = major - o.getMajor(); | |
| 164 | + | |
| 165 | + if (result == 0) { | |
| 166 | + result = minor - o.getMinor(); | |
| 167 | + } | |
| 168 | + | |
| 169 | + return result; | |
| 170 | + } | |
| 171 | + | |
| 172 | + public boolean equals(Object obj) { | |
| 173 | + return obj instanceof WindowsVersion && compareTo((WindowsVersion) obj) == 0; | |
| 174 | + } | |
| 175 | + | |
| 176 | + public int hashCode() { | |
| 177 | + return 31 * major + minor; | |
| 178 | + } | |
| 179 | + | |
| 180 | + public String toString() { | |
| 181 | + return major + "." + minor; | |
| 182 | + } | |
| 183 | + } | |
| 184 | +} | |
| @@ -0,0 +1,310 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1996, 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 | +package sun.awt; | |
| 26 | + | |
| 27 | +import java.awt.*; | |
| 28 | + | |
| 29 | +/** | |
| 30 | + * Extends the FlowLayout class to support both vertical and horizontal | |
| 31 | + * layout of components. Orientation can be changed dynamically after | |
| 32 | + * creation by calling either of the methods @method orientHorizontally or | |
| 33 | + * @method orientVertically. Separate values for alignment, vertical gap, | |
| 34 | + * and horizontal gap can be specified for horizontal and vertical | |
| 35 | + * orientation. | |
| 36 | + * | |
| 37 | + * @author Terry Cline | |
| 38 | + */ | |
| 39 | +public class OrientableFlowLayout extends FlowLayout { | |
| 40 | + /** | |
| 41 | + * The horizontal orientation constant. | |
| 42 | + */ | |
| 43 | + public static final int HORIZONTAL = 0; | |
| 44 | + | |
| 45 | + /** | |
| 46 | + * The vertical orientation constant. | |
| 47 | + */ | |
| 48 | + public static final int VERTICAL = 1; | |
| 49 | + | |
| 50 | + /** | |
| 51 | + * The top vertical alignment constant. | |
| 52 | + */ | |
| 53 | + public static final int TOP = 0; | |
| 54 | + | |
| 55 | + /** | |
| 56 | + * The bottom vertical alignment constant. | |
| 57 | + */ | |
| 58 | + public static final int BOTTOM = 2; // CENTER == 1 | |
| 59 | + | |
| 60 | + int orientation; | |
| 61 | + int vAlign; | |
| 62 | + int vHGap; | |
| 63 | + int vVGap; | |
| 64 | + | |
| 65 | + /** | |
| 66 | + * Constructs a new flow layout with a horizontal orientation and | |
| 67 | + * centered alignment. | |
| 68 | + */ | |
| 69 | + public OrientableFlowLayout() { | |
| 70 | + this(HORIZONTAL, CENTER, CENTER, 5, 5, 5, 5); | |
| 71 | + } | |
| 72 | + | |
| 73 | + /** | |
| 74 | + * Constructs a new flow layout with the specified orientation and | |
| 75 | + * a centered alignment. | |
| 76 | + * | |
| 77 | + * @param orientation the orientation, one of HORIZONTAL or VERTICAL. | |
| 78 | + */ | |
| 79 | + public OrientableFlowLayout(int orientation) { | |
| 80 | + this(orientation, CENTER, CENTER, 5, 5, 5, 5); | |
| 81 | + } | |
| 82 | + | |
| 83 | + /** | |
| 84 | + * Constructs a new flow layout with the specified orientation and | |
| 85 | + * alignment. | |
| 86 | + * | |
| 87 | + * @param orientation the orientation, one of HORIZONTAL or VERTICAL. | |
| 88 | + * @param hAlign the horizontal alignment, one of LEFT, CENTER, or RIGHT. | |
| 89 | + * @param vAlign the vertical alignment, one of TOP, CENTER, or BOTTOM. | |
| 90 | + */ | |
| 91 | + public OrientableFlowLayout(int orientation, int hAlign, int vAlign) { | |
| 92 | + this(orientation, hAlign, vAlign, 5, 5, 5, 5); | |
| 93 | + } | |
| 94 | + | |
| 95 | + /** | |
| 96 | + * Constructs a new flow layout with the specified orientation, | |
| 97 | + * alignment, and gap values. | |
| 98 | + * | |
| 99 | + * @param orientation the orientation, one of HORIZONTAL or VERTICAL. | |
| 100 | + * @param hAlign the horizontal alignment, one of LEFT, CENTER, or RIGHT. | |
| 101 | + * @param vAlign the vertical alignment, one of TOP, CENTER, or BOTTOM. | |
| 102 | + * @param hHGap the horizontal gap between components in HORIZONTAL. | |
| 103 | + * @param hVGap the vertical gap between components in HORIZONTAL. | |
| 104 | + * @param vHGap the horizontal gap between components in VERTICAL. | |
| 105 | + * @param vVGap the vertical gap between components in VERTICAL. | |
| 106 | + */ | |
| 107 | + public OrientableFlowLayout(int orientation, int hAlign, int vAlign, int hHGap, int hVGap, int vHGap, int vVGap) { | |
| 108 | + super(hAlign, hHGap, hVGap); | |
| 109 | + this.orientation = orientation; | |
| 110 | + this.vAlign = vAlign; | |
| 111 | + this.vHGap = vHGap; | |
| 112 | + this.vVGap = vVGap; | |
| 113 | + } | |
| 114 | + | |
| 115 | + /** | |
| 116 | + * Set the layout's current orientation to horizontal. | |
| 117 | + */ | |
| 118 | + public synchronized void orientHorizontally() { | |
| 119 | + orientation = HORIZONTAL; | |
| 120 | + } | |
| 121 | + | |
| 122 | + /** | |
| 123 | + * Set the layout's current orientation to vertical. | |
| 124 | + */ | |
| 125 | + public synchronized void orientVertically() { | |
| 126 | + orientation = VERTICAL; | |
| 127 | + } | |
| 128 | + | |
| 129 | + /** | |
| 130 | + * Returns the preferred dimensions for this layout given the | |
| 131 | + * components in the specified target container. | |
| 132 | + * | |
| 133 | + * @param target the component which needs to be laid out. | |
| 134 | + * @see Container | |
| 135 | + * @see FlowLayout | |
| 136 | + * @see #minimumLayoutSize | |
| 137 | + */ | |
| 138 | + public Dimension preferredLayoutSize(Container target) { | |
| 139 | + if (orientation == HORIZONTAL) { | |
| 140 | + return super.preferredLayoutSize(target); | |
| 141 | + } | |
| 142 | + else { | |
| 143 | + Dimension dim = new Dimension(0, 0); | |
| 144 | + | |
| 145 | + int n = target.countComponents(); | |
| 146 | + for (int i = 0; i < n; i++) { | |
| 147 | + Component c = target.getComponent(i); | |
| 148 | + if (c.isVisible()) { | |
| 149 | + Dimension cDim = c.preferredSize(); | |
| 150 | + dim.width = Math.max(dim.width, cDim.width); | |
| 151 | + if (i > 0) { | |
| 152 | + dim.height += vVGap; | |
| 153 | + } | |
| 154 | + dim.height += cDim.height; | |
| 155 | + } | |
| 156 | + } | |
| 157 | + | |
| 158 | + Insets insets = target.insets();; | |
| 159 | + dim.width += insets.left + insets.right + vHGap*2; | |
| 160 | + dim.height += insets.top + insets.bottom + vVGap*2; | |
| 161 | + | |
| 162 | + return dim; | |
| 163 | + } | |
| 164 | + } | |
| 165 | + | |
| 166 | + /** | |
| 167 | + * Returns the minimum dimensions needed to layout the components | |
| 168 | + * contained in the specified target container. | |
| 169 | + * | |
| 170 | + * @param target the component which needs to be laid out. | |
| 171 | + * @see #preferredLayoutSize. | |
| 172 | + */ | |
| 173 | + public Dimension minimumLayoutSize(Container target) { | |
| 174 | + if (orientation == HORIZONTAL) { | |
| 175 | + return super.minimumLayoutSize(target); | |
| 176 | + } | |
| 177 | + else { | |
| 178 | + Dimension dim = new Dimension(0, 0); | |
| 179 | + | |
| 180 | + int n = target.countComponents(); | |
| 181 | + for (int i = 0; i < n; i++) { | |
| 182 | + Component c = target.getComponent(i); | |
| 183 | + if (c.isVisible()) { | |
| 184 | + Dimension cDim = c.minimumSize(); | |
| 185 | + dim.width = Math.max(dim.width, cDim.width); | |
| 186 | + if (i > 0) { | |
| 187 | + dim.height += vVGap; | |
| 188 | + } | |
| 189 | + dim.height += cDim.height; | |
| 190 | + } | |
| 191 | + } | |
| 192 | + | |
| 193 | + Insets insets = target.insets(); | |
| 194 | + dim.width += insets.left + insets.right + vHGap*2; | |
| 195 | + dim.height += insets.top + insets.bottom + vVGap*2; | |
| 196 | + | |
| 197 | + return dim; | |
| 198 | + } | |
| 199 | + } | |
| 200 | + | |
| 201 | + /** | |
| 202 | + * Lays out the container. This method will reshape the | |
| 203 | + * components in the target to satisfy the constraints of the | |
| 204 | + * layout. | |
| 205 | + * | |
| 206 | + * @param target the specified component being laid out. | |
| 207 | + * @see Container. | |
| 208 | + */ | |
| 209 | + public void layoutContainer(Container target) { | |
| 210 | + if (orientation == HORIZONTAL) { | |
| 211 | + super.layoutContainer(target); | |
| 212 | + } | |
| 213 | + else { | |
| 214 | + Insets insets = target.insets(); | |
| 215 | + Dimension targetDim = target.size(); | |
| 216 | + int maxHeight = targetDim.height - (insets.top + insets.bottom + vVGap*2); | |
| 217 | + int x = insets.left + vHGap; | |
| 218 | + int y = 0; | |
| 219 | + int colWidth = 0; | |
| 220 | + int start = 0; | |
| 221 | + | |
| 222 | + int n = target.countComponents(); | |
| 223 | + for (int i = 0; i < n; i++) { | |
| 224 | + Component c = target.getComponent(i); | |
| 225 | + if (c.isVisible()) { | |
| 226 | + Dimension cDim = c.preferredSize(); | |
| 227 | + c.resize(cDim.width, cDim.height); | |
| 228 | + | |
| 229 | + if ((y == 0) || ((y + cDim.height) <= maxHeight)) { | |
| 230 | + if (y > 0) { | |
| 231 | + y += vVGap; | |
| 232 | + } | |
| 233 | + y += cDim.height; | |
| 234 | + colWidth = Math.max(colWidth, cDim.width); | |
| 235 | + } | |
| 236 | + else { | |
| 237 | + moveComponents(target, | |
| 238 | + x, | |
| 239 | + insets.top + vVGap, | |
| 240 | + colWidth, | |
| 241 | + maxHeight - y, | |
| 242 | + start, | |
| 243 | + i); | |
| 244 | + x += vHGap + colWidth; | |
| 245 | + y = cDim.width; | |
| 246 | + colWidth = cDim.width; | |
| 247 | + start = i; | |
| 248 | + } | |
| 249 | + } | |
| 250 | + } | |
| 251 | + | |
| 252 | + moveComponents(target, | |
| 253 | + x, | |
| 254 | + insets.top + vVGap, | |
| 255 | + colWidth, | |
| 256 | + maxHeight - y, | |
| 257 | + start, | |
| 258 | + n); | |
| 259 | + } | |
| 260 | + } | |
| 261 | + | |
| 262 | + /** | |
| 263 | + * Aligns the components vertically if there is any slack. | |
| 264 | + * | |
| 265 | + * @param target the container whose components need to be moved. | |
| 266 | + * @param x the x coordinate. | |
| 267 | + * @param y the y coordinate. | |
| 268 | + * @param width the width available. | |
| 269 | + * @param height the height available. | |
| 270 | + * @param colStart the beginning of the column. | |
| 271 | + * @param colEnd the end of the column. | |
| 272 | + */ | |
| 273 | + private void moveComponents(Container target, int x, int y, int width, int height, int colStart, int colEnd) { | |
| 274 | + switch (vAlign) { | |
| 275 | + case TOP: | |
| 276 | + break; | |
| 277 | + case CENTER: | |
| 278 | + y += height/2; | |
| 279 | + break; | |
| 280 | + case BOTTOM: | |
| 281 | + y += height; | |
| 282 | + } | |
| 283 | + | |
| 284 | + for (int i = colStart; i < colEnd; i++) { | |
| 285 | + Component c = target.getComponent(i); | |
| 286 | + Dimension cDim = c.size(); | |
| 287 | + if (c.isVisible()) { | |
| 288 | + c.move(x + (width - cDim.width)/2, y); | |
| 289 | + y += vVGap + cDim.height; | |
| 290 | + } | |
| 291 | + } | |
| 292 | + } | |
| 293 | + | |
| 294 | + /** | |
| 295 | + * Returns the String representation of this layout's values. | |
| 296 | + */ | |
| 297 | + public String toString() { | |
| 298 | + String str = ""; | |
| 299 | + switch (orientation) { | |
| 300 | + case HORIZONTAL: | |
| 301 | + str = "orientation=horizontal, "; | |
| 302 | + break; | |
| 303 | + case VERTICAL: | |
| 304 | + str = "orientation=vertical, "; | |
| 305 | + break; | |
| 306 | + } | |
| 307 | + | |
| 308 | + return getClass().getName() + "[" + str + super.toString() + "]"; | |
| 309 | + } | |
| 310 | +} | |
Binary file not shown.
| @@ -0,0 +1,104 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 2005, 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 | +package sun.awt; | |
| 26 | + | |
| 27 | +import java.awt.Component; | |
| 28 | +import java.awt.Rectangle; | |
| 29 | +import java.awt.event.PaintEvent; | |
| 30 | + | |
| 31 | +/** | |
| 32 | + * PaintEventDispatcher is responsible for dispatching PaintEvents. There | |
| 33 | + * can be only one PaintEventDispatcher active at a particular time. | |
| 34 | + * | |
| 35 | + */ | |
| 36 | +public class PaintEventDispatcher { | |
| 37 | + /** | |
| 38 | + * Singleton dispatcher. | |
| 39 | + */ | |
| 40 | + private static PaintEventDispatcher dispatcher; | |
| 41 | + | |
| 42 | + /** | |
| 43 | + * Sets the current <code>PaintEventDispatcher</code>. | |
| 44 | + * | |
| 45 | + * @param dispatcher PaintEventDispatcher | |
| 46 | + */ | |
| 47 | + public static void setPaintEventDispatcher( | |
| 48 | + PaintEventDispatcher dispatcher) { | |
| 49 | + synchronized(PaintEventDispatcher.class) { | |
| 50 | + PaintEventDispatcher.dispatcher = dispatcher; | |
| 51 | + } | |
| 52 | + } | |
| 53 | + | |
| 54 | + /** | |
| 55 | + * Returns the currently active <code>PaintEventDispatcher</code>. This | |
| 56 | + * will never return null. | |
| 57 | + * | |
| 58 | + * @return PaintEventDispatcher | |
| 59 | + */ | |
| 60 | + public static PaintEventDispatcher getPaintEventDispatcher() { | |
| 61 | + synchronized(PaintEventDispatcher.class) { | |
| 62 | + if (dispatcher == null) { | |
| 63 | + dispatcher = new PaintEventDispatcher(); | |
| 64 | + } | |
| 65 | + return dispatcher; | |
| 66 | + } | |
| 67 | + } | |
| 68 | + | |
| 69 | + /** | |
| 70 | + * Creates and returns the <code>PaintEvent</code> that should be | |
| 71 | + * dispatched for the specified component. If this returns null | |
| 72 | + * no <code>PaintEvent</code> is dispatched. | |
| 73 | + * <p> | |
| 74 | + * <b>WARNING:</b> This is invoked from the native thread, be careful | |
| 75 | + * what methods you end up invoking here. | |
| 76 | + */ | |
| 77 | + public PaintEvent createPaintEvent(Component target, int x, int y, int w, | |
| 78 | + int h) { | |
| 79 | + | |
| 80 | + return new PaintEvent((Component)target, PaintEvent.PAINT, | |
| 81 | + new Rectangle(x, y, w, h)); | |
| 82 | + } | |
| 83 | + | |
| 84 | + /** | |
| 85 | + * Returns true if a native background erase should be done for | |
| 86 | + * the specified Component. | |
| 87 | + */ | |
| 88 | + public boolean shouldDoNativeBackgroundErase(Component c) { | |
| 89 | + return true; | |
| 90 | + } | |
| 91 | + | |
| 92 | + /** | |
| 93 | + * This method is invoked from the toolkit thread when the surface | |
| 94 | + * data of the component needs to be replaced. The method run() of | |
| 95 | + * the Runnable argument performs surface data replacing, run() | |
| 96 | + * should be invoked on the EDT of this component's AppContext. | |
| 97 | + * Returns true if the Runnable has been enqueued to be invoked | |
| 98 | + * on the EDT. | |
| 99 | + * (Fix 6255371.) | |
| 100 | + */ | |
| 101 | + public boolean queueSurfaceDataReplacing(Component c, Runnable r) { | |
| 102 | + return false; | |
| 103 | + } | |
| 104 | +} | |
Binary file not shown.
| @@ -0,0 +1,54 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1998, 2005, 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 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.awt.event.InvocationEvent; | |
| 29 | + | |
| 30 | +public class PeerEvent extends InvocationEvent { | |
| 31 | + public static final long PRIORITY_EVENT = 0x01; | |
| 32 | + public static final long ULTIMATE_PRIORITY_EVENT = 0x02; | |
| 33 | + public static final long LOW_PRIORITY_EVENT = 0x04; | |
| 34 | + | |
| 35 | + private long flags; | |
| 36 | + | |
| 37 | + public PeerEvent(Object source, Runnable runnable, long flags) { | |
| 38 | + this(source, runnable, null, false, flags); | |
| 39 | + } | |
| 40 | + | |
| 41 | + public PeerEvent(Object source, Runnable runnable, Object notifier, | |
| 42 | + boolean catchExceptions, long flags) { | |
| 43 | + super(source, runnable, notifier, catchExceptions); | |
| 44 | + this.flags = flags; | |
| 45 | + } | |
| 46 | + | |
| 47 | + public long getFlags() { | |
| 48 | + return flags; | |
| 49 | + } | |
| 50 | + | |
| 51 | + public PeerEvent coalesceEvents(PeerEvent newEvent) { | |
| 52 | + return null; | |
| 53 | + } | |
| 54 | +} | |
| @@ -0,0 +1,440 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1996, 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 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.awt.peer.FontPeer; | |
| 29 | +import java.util.Locale; | |
| 30 | +import java.util.Vector; | |
| 31 | +import sun.font.SunFontManager; | |
| 32 | +import sun.java2d.FontSupport; | |
| 33 | +import java.nio.CharBuffer; | |
| 34 | +import java.nio.ByteBuffer; | |
| 35 | + | |
| 36 | +public abstract class PlatformFont implements FontPeer { | |
| 37 | + | |
| 38 | + static { | |
| 39 | + NativeLibLoader.loadLibraries(); | |
| 40 | + initIDs(); | |
| 41 | + } | |
| 42 | + | |
| 43 | + protected FontDescriptor[] componentFonts; | |
| 44 | + protected char defaultChar; | |
| 45 | + protected FontConfiguration fontConfig; | |
| 46 | + | |
| 47 | + protected FontDescriptor defaultFont; | |
| 48 | + | |
| 49 | + protected String familyName; | |
| 50 | + | |
| 51 | + private Object[] fontCache; | |
| 52 | + | |
| 53 | + // Maybe this should be a property that is set based | |
| 54 | + // on the locale? | |
| 55 | + protected static int FONTCACHESIZE = 256; | |
| 56 | + protected static int FONTCACHEMASK = PlatformFont.FONTCACHESIZE - 1; | |
| 57 | + protected static String osVersion; | |
| 58 | + | |
| 59 | + public PlatformFont(String name, int style){ | |
| 60 | + SunFontManager sfm = SunFontManager.getInstance(); | |
| 61 | + if (sfm instanceof FontSupport) { | |
| 62 | + fontConfig = ((FontSupport)sfm).getFontConfiguration(); | |
| 63 | + } | |
| 64 | + if (fontConfig == null) { | |
| 65 | + return; | |
| 66 | + } | |
| 67 | + | |
| 68 | + // map given font name to a valid logical font family name | |
| 69 | + familyName = name.toLowerCase(Locale.ENGLISH); | |
| 70 | + if (!FontConfiguration.isLogicalFontFamilyName(familyName)) { | |
| 71 | + familyName = fontConfig.getFallbackFamilyName(familyName, "sansserif"); | |
| 72 | + } | |
| 73 | + | |
| 74 | + componentFonts = fontConfig.getFontDescriptors(familyName, style); | |
| 75 | + | |
| 76 | + // search default character | |
| 77 | + // | |
| 78 | + char missingGlyphCharacter = getMissingGlyphCharacter(); | |
| 79 | + | |
| 80 | + defaultChar = '?'; | |
| 81 | + if (componentFonts.length > 0) | |
| 82 | + defaultFont = componentFonts[0]; | |
| 83 | + | |
| 84 | + for (int i = 0; i < componentFonts.length; i++){ | |
| 85 | + if (componentFonts[i].isExcluded(missingGlyphCharacter)) { | |
| 86 | + continue; | |
| 87 | + } | |
| 88 | + | |
| 89 | + if (componentFonts[i].encoder.canEncode(missingGlyphCharacter)) { | |
| 90 | + defaultFont = componentFonts[i]; | |
| 91 | + defaultChar = missingGlyphCharacter; | |
| 92 | + break; | |
| 93 | + } | |
| 94 | + } | |
| 95 | + } | |
| 96 | + | |
| 97 | + /** | |
| 98 | + * Returns the character that should be rendered when a glyph | |
| 99 | + * is missing. | |
| 100 | + */ | |
| 101 | + protected abstract char getMissingGlyphCharacter(); | |
| 102 | + | |
| 103 | + /** | |
| 104 | + * make a array of CharsetString with given String. | |
| 105 | + */ | |
| 106 | + public CharsetString[] makeMultiCharsetString(String str){ | |
| 107 | + return makeMultiCharsetString(str.toCharArray(), 0, str.length(), true); | |
| 108 | + } | |
| 109 | + | |
| 110 | + /** | |
| 111 | + * make a array of CharsetString with given String. | |
| 112 | + */ | |
| 113 | + public CharsetString[] makeMultiCharsetString(String str, boolean allowdefault){ | |
| 114 | + return makeMultiCharsetString(str.toCharArray(), 0, str.length(), allowdefault); | |
| 115 | + } | |
| 116 | + | |
| 117 | + /** | |
| 118 | + * make a array of CharsetString with given char array. | |
| 119 | + * @param str The char array to convert. | |
| 120 | + * @param offset offset of first character of interest | |
| 121 | + * @param len number of characters to convert | |
| 122 | + */ | |
| 123 | + public CharsetString[] makeMultiCharsetString(char str[], int offset, int len) { | |
| 124 | + return makeMultiCharsetString(str, offset, len, true); | |
| 125 | + } | |
| 126 | + | |
| 127 | + /** | |
| 128 | + * make a array of CharsetString with given char array. | |
| 129 | + * @param str The char array to convert. | |
| 130 | + * @param offset offset of first character of interest | |
| 131 | + * @param len number of characters to convert | |
| 132 | + * @param allowDefault whether to allow the default char. | |
| 133 | + * Setting this to true overloads the meaning of this method to | |
| 134 | + * return non-null only if all chars can be converted. | |
| 135 | + * @return array of CharsetString or if allowDefault is false and any | |
| 136 | + * of the returned chars would have been converted to a default char, | |
| 137 | + * then return null. | |
| 138 | + * This is used to choose alternative means of displaying the text. | |
| 139 | + */ | |
| 140 | + public CharsetString[] makeMultiCharsetString(char str[], int offset, int len, | |
| 141 | + boolean allowDefault) { | |
| 142 | + | |
| 143 | + if (len < 1) { | |
| 144 | + return new CharsetString[0]; | |
| 145 | + } | |
| 146 | + Vector mcs = null; | |
| 147 | + char[] tmpStr = new char[len]; | |
| 148 | + char tmpChar = defaultChar; | |
| 149 | + boolean encoded = false; | |
| 150 | + | |
| 151 | + FontDescriptor currentFont = defaultFont; | |
| 152 | + | |
| 153 | + | |
| 154 | + for (int i = 0; i < componentFonts.length; i++) { | |
| 155 | + if (componentFonts[i].isExcluded(str[offset])){ | |
| 156 | + continue; | |
| 157 | + } | |
| 158 | + | |
| 159 | + /* Need "encoded" variable to distinguish the case when | |
| 160 | + * the default char is the same as the encoded char. | |
| 161 | + * The defaultChar on Linux is '?' so it is needed there. | |
| 162 | + */ | |
| 163 | + if (componentFonts[i].encoder.canEncode(str[offset])){ | |
| 164 | + currentFont = componentFonts[i]; | |
| 165 | + tmpChar = str[offset]; | |
| 166 | + encoded = true; | |
| 167 | + break; | |
| 168 | + } | |
| 169 | + } | |
| 170 | + if (!allowDefault && !encoded) { | |
| 171 | + return null; | |
| 172 | + } else { | |
| 173 | + tmpStr[0] = tmpChar; | |
| 174 | + } | |
| 175 | + | |
| 176 | + int lastIndex = 0; | |
| 177 | + for (int i = 1; i < len; i++){ | |
| 178 | + char ch = str[offset + i]; | |
| 179 | + FontDescriptor fd = defaultFont; | |
| 180 | + tmpChar = defaultChar; | |
| 181 | + encoded = false; | |
| 182 | + for (int j = 0; j < componentFonts.length; j++){ | |
| 183 | + if (componentFonts[j].isExcluded(ch)){ | |
| 184 | + continue; | |
| 185 | + } | |
| 186 | + | |
| 187 | + if (componentFonts[j].encoder.canEncode(ch)){ | |
| 188 | + fd = componentFonts[j]; | |
| 189 | + tmpChar = ch; | |
| 190 | + encoded = true; | |
| 191 | + break; | |
| 192 | + } | |
| 193 | + } | |
| 194 | + if (!allowDefault && !encoded) { | |
| 195 | + return null; | |
| 196 | + } else { | |
| 197 | + tmpStr[i] = tmpChar; | |
| 198 | + } | |
| 199 | + if (currentFont != fd){ | |
| 200 | + if (mcs == null) { | |
| 201 | + mcs = new Vector(3); | |
| 202 | + } | |
| 203 | + mcs.addElement(new CharsetString(tmpStr, lastIndex, | |
| 204 | + i-lastIndex, currentFont)); | |
| 205 | + currentFont = fd; | |
| 206 | + fd = defaultFont; | |
| 207 | + lastIndex = i; | |
| 208 | + } | |
| 209 | + } | |
| 210 | + CharsetString[] result; | |
| 211 | + CharsetString cs = new CharsetString(tmpStr, lastIndex, | |
| 212 | + len-lastIndex, currentFont); | |
| 213 | + if (mcs == null) { | |
| 214 | + result = new CharsetString[1]; | |
| 215 | + result[0] = cs; | |
| 216 | + } else { | |
| 217 | + mcs.addElement(cs); | |
| 218 | + result = new CharsetString[mcs.size()]; | |
| 219 | + for (int i = 0; i < mcs.size(); i++){ | |
| 220 | + result[i] = (CharsetString)mcs.elementAt(i); | |
| 221 | + } | |
| 222 | + } | |
| 223 | + return result; | |
| 224 | + } | |
| 225 | + | |
| 226 | + /** | |
| 227 | + * Is it possible that this font's metrics require the multi-font calls? | |
| 228 | + * This might be true, for example, if the font supports kerning. | |
| 229 | + **/ | |
| 230 | + public boolean mightHaveMultiFontMetrics() { | |
| 231 | + return fontConfig != null; | |
| 232 | + } | |
| 233 | + | |
| 234 | + /** | |
| 235 | + * Specialized fast path string conversion for AWT. | |
| 236 | + */ | |
| 237 | + public Object[] makeConvertedMultiFontString(String str) | |
| 238 | + { | |
| 239 | + return makeConvertedMultiFontChars(str.toCharArray(),0,str.length()); | |
| 240 | + } | |
| 241 | + | |
| 242 | + public Object[] makeConvertedMultiFontChars(char[] data, | |
| 243 | + int start, int len) | |
| 244 | + { | |
| 245 | + Object[] result = new Object[2]; | |
| 246 | + Object[] workingCache; | |
| 247 | + byte[] convertedData = null; | |
| 248 | + int stringIndex = start; | |
| 249 | + int convertedDataIndex = 0; | |
| 250 | + int resultIndex = 0; | |
| 251 | + int cacheIndex; | |
| 252 | + FontDescriptor currentFontDescriptor = null; | |
| 253 | + FontDescriptor lastFontDescriptor = null; | |
| 254 | + char currentDefaultChar; | |
| 255 | + PlatformFontCache theChar; | |
| 256 | + | |
| 257 | + // Simple bounds check | |
| 258 | + int end = start + len; | |
| 259 | + if (start < 0 || end > data.length) { | |
| 260 | + throw new ArrayIndexOutOfBoundsException(); | |
| 261 | + } | |
| 262 | + | |
| 263 | + if(stringIndex >= end) { | |
| 264 | + return null; | |
| 265 | + } | |
| 266 | + | |
| 267 | + // coversion loop | |
| 268 | + while(stringIndex < end) | |
| 269 | + { | |
| 270 | + currentDefaultChar = data[stringIndex]; | |
| 271 | + | |
| 272 | + // Note that cache sizes must be a power of two! | |
| 273 | + cacheIndex = (int)(currentDefaultChar & this.FONTCACHEMASK); | |
| 274 | + | |
| 275 | + theChar = (PlatformFontCache)getFontCache()[cacheIndex]; | |
| 276 | + | |
| 277 | + // Is the unicode char we want cached? | |
| 278 | + if(theChar == null || theChar.uniChar != currentDefaultChar) | |
| 279 | + { | |
| 280 | + /* find a converter that can convert the current character */ | |
| 281 | + currentFontDescriptor = defaultFont; | |
| 282 | + currentDefaultChar = defaultChar; | |
| 283 | + char ch = (char)data[stringIndex]; | |
| 284 | + int componentCount = componentFonts.length; | |
| 285 | + | |
| 286 | + for (int j = 0; j < componentCount; j++) { | |
| 287 | + FontDescriptor fontDescriptor = componentFonts[j]; | |
| 288 | + | |
| 289 | + fontDescriptor.encoder.reset(); | |
| 290 | + //fontDescriptor.encoder.onUnmappleCharacterAction(...); | |
| 291 | + | |
| 292 | + if (fontDescriptor.isExcluded(ch)) { | |
| 293 | + continue; | |
| 294 | + } | |
| 295 | + if (fontDescriptor.encoder.canEncode(ch)) { | |
| 296 | + currentFontDescriptor = fontDescriptor; | |
| 297 | + currentDefaultChar = ch; | |
| 298 | + break; | |
| 299 | + } | |
| 300 | + } | |
| 301 | + try { | |
| 302 | + char[] input = new char[1]; | |
| 303 | + input[0] = currentDefaultChar; | |
| 304 | + | |
| 305 | + theChar = new PlatformFontCache(); | |
| 306 | + if (currentFontDescriptor.useUnicode()) { | |
| 307 | + /* | |
| 308 | + currentFontDescriptor.unicodeEncoder.encode(CharBuffer.wrap(input), | |
| 309 | + theChar.bb, | |
| 310 | + true); | |
| 311 | + */ | |
| 312 | + if (currentFontDescriptor.isLE) { | |
| 313 | + theChar.bb.put((byte)(input[0] & 0xff)); | |
| 314 | + theChar.bb.put((byte)(input[0] >>8)); | |
| 315 | + } else { | |
| 316 | + theChar.bb.put((byte)(input[0] >> 8)); | |
| 317 | + theChar.bb.put((byte)(input[0] & 0xff)); | |
| 318 | + } | |
| 319 | + } | |
| 320 | + else { | |
| 321 | + currentFontDescriptor.encoder.encode(CharBuffer.wrap(input), | |
| 322 | + theChar.bb, | |
| 323 | + true); | |
| 324 | + } | |
| 325 | + theChar.fontDescriptor = currentFontDescriptor; | |
| 326 | + theChar.uniChar = data[stringIndex]; | |
| 327 | + getFontCache()[cacheIndex] = theChar; | |
| 328 | + } catch(Exception e){ | |
| 329 | + // Should never happen! | |
| 330 | + System.err.println(e); | |
| 331 | + e.printStackTrace(); | |
| 332 | + return null; | |
| 333 | + } | |
| 334 | + } | |
| 335 | + | |
| 336 | + // Check to see if we've changed fonts. | |
| 337 | + if(lastFontDescriptor != theChar.fontDescriptor) { | |
| 338 | + if(lastFontDescriptor != null) { | |
| 339 | + result[resultIndex++] = lastFontDescriptor; | |
| 340 | + result[resultIndex++] = convertedData; | |
| 341 | + // Add the size to the converted data field. | |
| 342 | + if(convertedData != null) { | |
| 343 | + convertedDataIndex -= 4; | |
| 344 | + convertedData[0] = (byte)(convertedDataIndex >> 24); | |
| 345 | + convertedData[1] = (byte)(convertedDataIndex >> 16); | |
| 346 | + convertedData[2] = (byte)(convertedDataIndex >> 8); | |
| 347 | + convertedData[3] = (byte)convertedDataIndex; | |
| 348 | + } | |
| 349 | + | |
| 350 | + if(resultIndex >= result.length) { | |
| 351 | + Object[] newResult = new Object[result.length * 2]; | |
| 352 | + | |
| 353 | + System.arraycopy(result, 0, newResult, 0, | |
| 354 | + result.length); | |
| 355 | + result = newResult; | |
| 356 | + } | |
| 357 | + } | |
| 358 | + | |
| 359 | + if (theChar.fontDescriptor.useUnicode()) { | |
| 360 | + convertedData = new byte[(end - stringIndex + 1) * | |
| 361 | + (int)theChar.fontDescriptor.unicodeEncoder.maxBytesPerChar() | |
| 362 | + + 4]; | |
| 363 | + } | |
| 364 | + else { | |
| 365 | + convertedData = new byte[(end - stringIndex + 1) * | |
| 366 | + (int)theChar.fontDescriptor.encoder.maxBytesPerChar() | |
| 367 | + + 4]; | |
| 368 | + } | |
| 369 | + | |
| 370 | + convertedDataIndex = 4; | |
| 371 | + | |
| 372 | + lastFontDescriptor = theChar.fontDescriptor; | |
| 373 | + } | |
| 374 | + | |
| 375 | + byte[] ba = theChar.bb.array(); | |
| 376 | + int size = theChar.bb.position(); | |
| 377 | + if(size == 1) { | |
| 378 | + convertedData[convertedDataIndex++] = ba[0]; | |
| 379 | + } | |
| 380 | + else if(size == 2) { | |
| 381 | + convertedData[convertedDataIndex++] = ba[0]; | |
| 382 | + convertedData[convertedDataIndex++] = ba[1]; | |
| 383 | + } else if(size == 3) { | |
| 384 | + convertedData[convertedDataIndex++] = ba[0]; | |
| 385 | + convertedData[convertedDataIndex++] = ba[1]; | |
| 386 | + convertedData[convertedDataIndex++] = ba[2]; | |
| 387 | + } else if(size == 4) { | |
| 388 | + convertedData[convertedDataIndex++] = ba[0]; | |
| 389 | + convertedData[convertedDataIndex++] = ba[1]; | |
| 390 | + convertedData[convertedDataIndex++] = ba[2]; | |
| 391 | + convertedData[convertedDataIndex++] = ba[3]; | |
| 392 | + } | |
| 393 | + stringIndex++; | |
| 394 | + } | |
| 395 | + | |
| 396 | + result[resultIndex++] = lastFontDescriptor; | |
| 397 | + result[resultIndex] = convertedData; | |
| 398 | + | |
| 399 | + // Add the size to the converted data field. | |
| 400 | + if(convertedData != null) { | |
| 401 | + convertedDataIndex -= 4; | |
| 402 | + convertedData[0] = (byte)(convertedDataIndex >> 24); | |
| 403 | + convertedData[1] = (byte)(convertedDataIndex >> 16); | |
| 404 | + convertedData[2] = (byte)(convertedDataIndex >> 8); | |
| 405 | + convertedData[3] = (byte)convertedDataIndex; | |
| 406 | + } | |
| 407 | + return result; | |
| 408 | + } | |
| 409 | + | |
| 410 | + /* | |
| 411 | + * Create fontCache on demand instead of during construction to | |
| 412 | + * reduce overall memory consumption. | |
| 413 | + * | |
| 414 | + * This method is declared final so that its code can be inlined | |
| 415 | + * by the compiler. | |
| 416 | + */ | |
| 417 | + protected final Object[] getFontCache() { | |
| 418 | + // This method is not MT-safe by design. Since this is just a | |
| 419 | + // cache anyways, it's okay if we occasionally allocate the array | |
| 420 | + // twice or return an array which will be dereferenced and gced | |
| 421 | + // right away. | |
| 422 | + if (fontCache == null) { | |
| 423 | + fontCache = new Object[this.FONTCACHESIZE]; | |
| 424 | + } | |
| 425 | + | |
| 426 | + return fontCache; | |
| 427 | + } | |
| 428 | + | |
| 429 | + /** | |
| 430 | + * Initialize JNI field and method IDs | |
| 431 | + */ | |
| 432 | + private static native void initIDs(); | |
| 433 | + | |
| 434 | + class PlatformFontCache | |
| 435 | + { | |
| 436 | + char uniChar; | |
| 437 | + FontDescriptor fontDescriptor; | |
| 438 | + ByteBuffer bb = ByteBuffer.allocate(4); | |
| 439 | + } | |
| 440 | +} | |
Binary file not shown.
| @@ -0,0 +1,312 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1999, 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 | + | |
| 26 | +package sun.awt; | |
| 27 | + | |
| 28 | +import java.awt.Component; | |
| 29 | +import java.awt.Graphics; | |
| 30 | +import java.awt.Rectangle; | |
| 31 | +import java.awt.event.PaintEvent; | |
| 32 | + | |
| 33 | +/** | |
| 34 | + * The <code>RepaintArea</code> is a geometric construct created for the | |
| 35 | + * purpose of holding the geometry of several coalesced paint events. | |
| 36 | + * This geometry is accessed synchronously, although it is written such | |
| 37 | + * that painting may still be executed asynchronously. | |
| 38 | + * | |
| 39 | + * @author Eric Hawkes | |
| 40 | + * @since 1.3 | |
| 41 | + */ | |
| 42 | +public class RepaintArea { | |
| 43 | + | |
| 44 | + /** | |
| 45 | + * Maximum ratio of bounding rectangle to benefit for which | |
| 46 | + * both the vertical and horizontal unions are repainted. | |
| 47 | + * For smaller ratios the whole bounding rectangle is repainted. | |
| 48 | + * @see #paint | |
| 49 | + */ | |
| 50 | + private static final int MAX_BENEFIT_RATIO = 4; | |
| 51 | + | |
| 52 | + private static final int HORIZONTAL = 0; | |
| 53 | + private static final int VERTICAL = 1; | |
| 54 | + private static final int UPDATE = 2; | |
| 55 | + | |
| 56 | + private static final int RECT_COUNT = UPDATE + 1; | |
| 57 | + | |
| 58 | + private Rectangle paintRects[] = new Rectangle[RECT_COUNT]; | |
| 59 | + | |
| 60 | + | |
| 61 | + /** | |
| 62 | + * Constructs a new <code>RepaintArea</code> | |
| 63 | + * @since 1.3 | |
| 64 | + */ | |
| 65 | + public RepaintArea() { | |
| 66 | + } | |
| 67 | + | |
| 68 | + /** | |
| 69 | + * Constructs a new <code>RepaintArea</code> initialized to match | |
| 70 | + * the values of the specified RepaintArea. | |
| 71 | + * | |
| 72 | + * @param ra the <code>RepaintArea</code> from which to copy initial | |
| 73 | + * values to a newly constructed RepaintArea | |
| 74 | + * @since 1.3 | |
| 75 | + */ | |
| 76 | + private RepaintArea(RepaintArea ra) { | |
| 77 | + // This constructor is private because it should only be called | |
| 78 | + // from the cloneAndReset method | |
| 79 | + for (int i = 0; i < RECT_COUNT; i++) { | |
| 80 | + paintRects[i] = ra.paintRects[i]; | |
| 81 | + } | |
| 82 | + } | |
| 83 | + | |
| 84 | + /** | |
| 85 | + * Adds a <code>Rectangle</code> to this <code>RepaintArea</code>. | |
| 86 | + * PAINT Rectangles are divided into mostly vertical and mostly horizontal. | |
| 87 | + * Each group is unioned together. | |
| 88 | + * UPDATE Rectangles are unioned. | |
| 89 | + * | |
| 90 | + * @param r the specified <code>Rectangle</code> | |
| 91 | + * @param id possible values PaintEvent.UPDATE or PaintEvent.PAINT | |
| 92 | + * @since 1.3 | |
| 93 | + */ | |
| 94 | + public synchronized void add(Rectangle r, int id) { | |
| 95 | + // Make sure this new rectangle has positive dimensions | |
| 96 | + if (r.isEmpty()) { | |
| 97 | + return; | |
| 98 | + } | |
| 99 | + int addTo = UPDATE; | |
| 100 | + if (id == PaintEvent.PAINT) { | |
| 101 | + addTo = (r.width > r.height) ? HORIZONTAL : VERTICAL; | |
| 102 | + } | |
| 103 | + if (paintRects[addTo] != null) { | |
| 104 | + paintRects[addTo].add(r); | |
| 105 | + } else { | |
| 106 | + paintRects[addTo] = new Rectangle(r); | |
| 107 | + } | |
| 108 | + } | |
| 109 | + | |
| 110 | + | |
| 111 | + /** | |
| 112 | + * Creates a new <code>RepaintArea</code> with the same geometry as this | |
| 113 | + * RepaintArea, then removes all of the geometry from this | |
| 114 | + * RepaintArea and restores it to an empty RepaintArea. | |
| 115 | + * | |
| 116 | + * @return ra a new <code>RepaintArea</code> having the same geometry as | |
| 117 | + * this RepaintArea. | |
| 118 | + * @since 1.3 | |
| 119 | + */ | |
| 120 | + private synchronized RepaintArea cloneAndReset() { | |
| 121 | + RepaintArea ra = new RepaintArea(this); | |
| 122 | + for (int i = 0; i < RECT_COUNT; i++) { | |
| 123 | + paintRects[i] = null; | |
| 124 | + } | |
| 125 | + return ra; | |
| 126 | + } | |
| 127 | + | |
| 128 | + public boolean isEmpty() { | |
| 129 | + for (int i = 0; i < RECT_COUNT; i++) { | |
| 130 | + if (paintRects[i] != null) { | |
| 131 | + return false; | |
| 132 | + } | |
| 133 | + } | |
| 134 | + return true; | |
| 135 | + } | |
| 136 | + | |
| 137 | + /** | |
| 138 | + * Constrains the size of the repaint area to the passed in bounds. | |
| 139 | + */ | |
| 140 | + public synchronized void constrain(int x, int y, int w, int h) { | |
| 141 | + for (int i = 0; i < RECT_COUNT; i++) { | |
| 142 | + Rectangle rect = paintRects[i]; | |
| 143 | + if (rect != null) { | |
| 144 | + if (rect.x < x) { | |
| 145 | + rect.width -= (x - rect.x); | |
| 146 | + rect.x = x; | |
| 147 | + } | |
| 148 | + if (rect.y < y) { | |
| 149 | + rect.height -= (y - rect.y); | |
| 150 | + rect.y = y; | |
| 151 | + } | |
| 152 | + int xDelta = rect.x + rect.width - x - w; | |
| 153 | + if (xDelta > 0) { | |
| 154 | + rect.width -= xDelta; | |
| 155 | + } | |
| 156 | + int yDelta = rect.y + rect.height - y - h; | |
| 157 | + if (yDelta > 0) { | |
| 158 | + rect.height -= yDelta; | |
| 159 | + } | |
| 160 | + if (rect.width <= 0 || rect.height <= 0) { | |
| 161 | + paintRects[i] = null; | |
| 162 | + } | |
| 163 | + } | |
| 164 | + } | |
| 165 | + } | |
| 166 | + | |
| 167 | + /** | |
| 168 | + * Marks the passed in region as not needing to be painted. It's possible | |
| 169 | + * this will do nothing. | |
| 170 | + */ | |
| 171 | + public synchronized void subtract(int x, int y, int w, int h) { | |
| 172 | + Rectangle subtract = new Rectangle(x, y, w, h); | |
| 173 | + for (int i = 0; i < RECT_COUNT; i++) { | |
| 174 | + if (subtract(paintRects[i], subtract)) { | |
| 175 | + if (paintRects[i] != null && paintRects[i].isEmpty()) { | |
| 176 | + paintRects[i] = null; | |
| 177 | + } | |
| 178 | + } | |
| 179 | + } | |
| 180 | + } | |
| 181 | + | |
| 182 | + /** | |
| 183 | + * Invokes paint and update on target Component with optimal | |
| 184 | + * rectangular clip region. | |
| 185 | + * If PAINT bounding rectangle is less than | |
| 186 | + * MAX_BENEFIT_RATIO times the benefit, then the vertical and horizontal unions are | |
| 187 | + * painted separately. Otherwise the entire bounding rectangle is painted. | |
| 188 | + * | |
| 189 | + * @param target Component to <code>paint</code> or <code>update</code> | |
| 190 | + * @since 1.4 | |
| 191 | + */ | |
| 192 | + public void paint(Object target, boolean shouldClearRectBeforePaint) { | |
| 193 | + Component comp = (Component)target; | |
| 194 | + | |
| 195 | + if (isEmpty()) { | |
| 196 | + return; | |
| 197 | + } | |
| 198 | + | |
| 199 | + if (!comp.isVisible()) { | |
| 200 | + return; | |
| 201 | + } | |
| 202 | + | |
| 203 | + RepaintArea ra = this.cloneAndReset(); | |
| 204 | + | |
| 205 | + if (!subtract(ra.paintRects[VERTICAL], ra.paintRects[HORIZONTAL])) { | |
| 206 | + subtract(ra.paintRects[HORIZONTAL], ra.paintRects[VERTICAL]); | |
| 207 | + } | |
| 208 | + | |
| 209 | + if (ra.paintRects[HORIZONTAL] != null && ra.paintRects[VERTICAL] != null) { | |
| 210 | + Rectangle paintRect = ra.paintRects[HORIZONTAL].union(ra.paintRects[VERTICAL]); | |
| 211 | + int square = paintRect.width * paintRect.height; | |
| 212 | + int benefit = square - ra.paintRects[HORIZONTAL].width | |
| 213 | + * ra.paintRects[HORIZONTAL].height - ra.paintRects[VERTICAL].width | |
| 214 | + * ra.paintRects[VERTICAL].height; | |
| 215 | + // if benefit is comparable with bounding box | |
| 216 | + if (MAX_BENEFIT_RATIO * benefit < square) { | |
| 217 | + ra.paintRects[HORIZONTAL] = paintRect; | |
| 218 | + ra.paintRects[VERTICAL] = null; | |
| 219 | + } | |
| 220 | + } | |
| 221 | + for (int i = 0; i < paintRects.length; i++) { | |
| 222 | + if (ra.paintRects[i] != null | |
| 223 | + && !ra.paintRects[i].isEmpty()) | |
| 224 | + { | |
| 225 | + // Should use separate Graphics for each paint() call, | |
| 226 | + // since paint() can change Graphics state for next call. | |
| 227 | + Graphics g = comp.getGraphics(); | |
| 228 | + if (g != null) { | |
| 229 | + try { | |
| 230 | + g.setClip(ra.paintRects[i]); | |
| 231 | + if (i == UPDATE) { | |
| 232 | + updateComponent(comp, g); | |
| 233 | + } else { | |
| 234 | + if (shouldClearRectBeforePaint) { | |
| 235 | + g.clearRect( ra.paintRects[i].x, | |
| 236 | + ra.paintRects[i].y, | |
| 237 | + ra.paintRects[i].width, | |
| 238 | + ra.paintRects[i].height); | |
| 239 | + } | |
| 240 | + paintComponent(comp, g); | |
| 241 | + } | |
| 242 | + } finally { | |
| 243 | + g.dispose(); | |
| 244 | + } | |
| 245 | + } | |
| 246 | + } | |
| 247 | + } | |
| 248 | + } | |
| 249 | + | |
| 250 | + /** | |
| 251 | + * Calls <code>Component.update(Graphics)</code> with given Graphics. | |
61 more lines aren’t shown here.
Binary file not shown.
This diff is large: its 35 lines aren’t shown here.
Binary file not shown.
This diff is large: its 188 lines aren’t shown here.
Binary file not shown.
This diff is large: its 50 lines aren’t shown here.
Binary file not shown.
This diff is large: its 190 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 159 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 481 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 2149 lines aren’t shown here.
This diff is large: its 192 lines aren’t shown here.
This diff is large: its 92 lines aren’t shown here.
Binary file not shown.
This diff is large: its 53 lines aren’t shown here.
This diff is large: its 232 lines aren’t shown here.
This diff is large: its 159 lines aren’t shown here.
Binary file not shown.
This diff is large: its 54 lines aren’t shown here.
Binary file not shown.
This diff is large: its 36 lines aren’t shown here.
This diff is large: its 35 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 175 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 3091 lines aren’t shown here.
This diff is large: its 473 lines aren’t shown here.
Binary file not shown.
This diff is large: its 34 lines aren’t shown here.
Binary file not shown.
This diff is large: its 213 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 506 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 925 lines aren’t shown here.
Binary file not shown.
This diff is large: its 78 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
Binary file not shown.
This diff is large: its 43 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 562 lines aren’t shown here.
Binary file not shown.
This diff is large: its 118 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 523 lines aren’t shown here.
Binary file not shown.
This diff is large: its 1207 lines aren’t shown here.
Binary file not shown.
This diff is large: its 115 lines aren’t shown here.
Binary file not shown.
This diff is large: its 126 lines aren’t shown here.
Binary file not shown.
This diff is large: its 143 lines aren’t shown here.
Binary file not shown.
This diff is large: its 313 lines aren’t shown here.
Binary file not shown.
This diff is large: its 454 lines aren’t shown here.
Binary file not shown.
This diff is large: its 635 lines aren’t shown here.
Binary file not shown.
This diff is large: its 79 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 317 lines aren’t shown here.
Binary file not shown.
This diff is large: its 352 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 1064 lines aren’t shown here.
Binary file not shown.
This diff is large: its 119 lines aren’t shown here.
Binary file not shown.
This diff is large: its 379 lines aren’t shown here.
Binary file not shown.
This diff is large: its 72 lines aren’t shown here.
Binary file not shown.
This diff is large: its 172 lines aren’t shown here.
Binary file not shown.
This diff is large: its 807 lines aren’t shown here.
Binary file not shown.
This diff is large: its 276 lines aren’t shown here.
Binary file not shown.
This diff is large: its 43 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 65 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 430 lines aren’t shown here.
Binary file not shown.
This diff is large: its 70 lines aren’t shown here.
Binary file not shown.
This diff is large: its 69 lines aren’t shown here.
Binary file not shown.
This diff is large: its 82 lines aren’t shown here.
Binary file not shown.
This diff is large: its 174 lines aren’t shown here.
Binary file not shown.
This diff is large: its 62 lines aren’t shown here.
Binary file not shown.
This diff is large: its 792 lines aren’t shown here.
Binary file not shown.
This diff is large: its 927 lines aren’t shown here.
Binary file not shown.
This diff is large: its 1352 lines aren’t shown here.
Binary file not shown.
This diff is large: its 1397 lines aren’t shown here.
This diff is large: its 93 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 76 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 754 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
Binary file not shown.
This diff is large: its 95 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 184 lines aren’t shown here.
Binary file not shown.
This diff is large: its 49 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 365 lines aren’t shown here.
Binary file not shown.
This diff is large: its 33 lines aren’t shown here.
Binary file not shown.
This diff is large: its 947 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 177 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 279 lines aren’t shown here.
Binary file not shown.
This diff is large: its 353 lines aren’t shown here.
Binary file not shown.
This diff is large: its 693 lines aren’t shown here.
Binary file not shown.
This diff is large: its 596 lines aren’t shown here.
Binary file not shown.
This diff is large: its 156 lines aren’t shown here.
Binary file not shown.
This diff is large: its 60 lines aren’t shown here.
This diff is large: its 116 lines aren’t shown here.
Binary file not shown.
This diff is large: its 196 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 841 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 448 lines aren’t shown here.
Binary file not shown.
This diff is large: its 778 lines aren’t shown here.
Binary file not shown.
This diff is large: its 837 lines aren’t shown here.
Binary file not shown.
This diff is large: its 800 lines aren’t shown here.
Binary file not shown.
This diff is large: its 271 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 140 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 291 lines aren’t shown here.
Binary file not shown.
This diff is large: its 332 lines aren’t shown here.
Binary file not shown.
This diff is large: its 175 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 122 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 410 lines aren’t shown here.
This diff is large: its 126 lines aren’t shown here.
Binary file not shown.
This diff is large: its 179 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 79 lines aren’t shown here.
This diff is large: its 196 lines aren’t shown here.
This diff is large: its 193 lines aren’t shown here.
This diff is large: its 193 lines aren’t shown here.
This diff is large: its 193 lines aren’t shown here.
This diff is large: its 193 lines aren’t shown here.
This diff is large: its 193 lines aren’t shown here.
This diff is large: its 193 lines aren’t shown here.
This diff is large: its 193 lines aren’t shown here.
This diff is large: its 193 lines aren’t shown here.
This diff is large: its 193 lines aren’t shown here.
This diff is large: its 193 lines aren’t shown here.
This diff is large: its 3 lines aren’t shown here.
Binary file not shown.
This diff is large: its 124 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 616 lines aren’t shown here.
Binary file not shown.
This diff is large: its 134 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 117 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
Binary file not shown.
This diff is large: its 542 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 878 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
Binary file not shown.
This diff is large: its 77 lines aren’t shown here.
Binary file not shown.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 215 lines aren’t shown here.
Binary file not shown.
This diff is large: its 42 lines aren’t shown here.
Binary file not shown.
This diff is large: its 144 lines aren’t shown here.
Binary file not shown.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 220 lines aren’t shown here.
Binary file not shown.
This diff is large: its 43 lines aren’t shown here.
Binary file not shown.
This diff is large: its 49 lines aren’t shown here.
Binary file not shown.
This diff is large: its 45 lines aren’t shown here.
Binary file not shown.
This diff is large: its 50 lines aren’t shown here.
This diff is large: its 75 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 63 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 837 lines aren’t shown here.
This diff is large: its 7 lines aren’t shown here.
This diff is large: its 3 lines aren’t shown here.
This diff is large: its 3 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
Binary file not shown.
This diff is large: its 102 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 908 lines aren’t shown here.
Binary file not shown.
This diff is large: its 387 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 1066 lines aren’t shown here.
Binary file not shown.
This diff is large: its 92 lines aren’t shown here.
Binary file not shown.
This diff is large: its 460 lines aren’t shown here.
Binary file not shown.
This diff is large: its 93 lines aren’t shown here.
Binary file not shown.
This diff is large: its 274 lines aren’t shown here.
Binary file not shown.
This diff is large: its 216 lines aren’t shown here.
Binary file not shown.
This diff is large: its 132 lines aren’t shown here.
Binary file not shown.
This diff is large: its 55 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 444 lines aren’t shown here.
Binary file not shown.
This diff is large: its 87 lines aren’t shown here.
Binary file not shown.
This diff is large: its 93 lines aren’t shown here.
Binary file not shown.
This diff is large: its 147 lines aren’t shown here.
Binary file not shown.
This diff is large: its 1041 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 326 lines aren’t shown here.
Binary file not shown.
This diff is large: its 952 lines aren’t shown here.
Binary file not shown.
This diff is large: its 535 lines aren’t shown here.
Binary file not shown.
This diff is large: its 73 lines aren’t shown here.
Binary file not shown.
This diff is large: its 49 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 591 lines aren’t shown here.
Binary file not shown.
This diff is large: its 298 lines aren’t shown here.
Binary file not shown.
This diff is large: its 120 lines aren’t shown here.
Binary file not shown.
This diff is large: its 146 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 103 lines aren’t shown here.
Binary file not shown.
This diff is large: its 65 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 78 lines aren’t shown here.
Binary file not shown.
This diff is large: its 247 lines aren’t shown here.
Binary file not shown.
This diff is large: its 172 lines aren’t shown here.
Binary file not shown.
This diff is large: its 257 lines aren’t shown here.
Binary file not shown.
This diff is large: its 37 lines aren’t shown here.
Binary file not shown.
This diff is large: its 81 lines aren’t shown here.
Binary file not shown.
This diff is large: its 247 lines aren’t shown here.
Binary file not shown.
This diff is large: its 103 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 513 lines aren’t shown here.
This diff is large: its 263 lines aren’t shown here.
Binary file not shown.
This diff is large: its 33 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 669 lines aren’t shown here.
Binary file not shown.
This diff is large: its 507 lines aren’t shown here.
Binary file not shown.
This diff is large: its 377 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 999 lines aren’t shown here.
Binary file not shown.
This diff is large: its 107 lines aren’t shown here.
Binary file not shown.
This diff is large: its 108 lines aren’t shown here.
Binary file not shown.
This diff is large: its 148 lines aren’t shown here.
Binary file not shown.
This diff is large: its 86 lines aren’t shown here.
Binary file not shown.
This diff is large: its 381 lines aren’t shown here.
Binary file not shown.
This diff is large: its 796 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 1936 lines aren’t shown here.
Binary file not shown.
This diff is large: its 254 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 445 lines aren’t shown here.
Binary file not shown.
This diff is large: its 200 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 3913 lines aren’t shown here.
Binary file not shown.
This diff is large: its 172 lines aren’t shown here.
Binary file not shown.
This diff is large: its 125 lines aren’t shown here.
Binary file not shown.
This diff is large: its 182 lines aren’t shown here.
Binary file not shown.
This diff is large: its 127 lines aren’t shown here.
Binary file not shown.
This diff is large: its 51 lines aren’t shown here.
Binary file not shown.
This diff is large: its 89 lines aren’t shown here.
Binary file not shown.
This diff is large: its 174 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 1687 lines aren’t shown here.
Binary file not shown.
This diff is large: its 270 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 683 lines aren’t shown here.
Binary file not shown.
This diff is large: its 178 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 309 lines aren’t shown here.
This diff is large: its 73 lines aren’t shown here.
This diff is large: its 432 lines aren’t shown here.
This diff is large: its 254 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
Binary file not shown.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 291 lines aren’t shown here.
This diff is large: its 369 lines aren’t shown here.
This diff is large: its 504 lines aren’t shown here.
This diff is large: its 193 lines aren’t shown here.
This diff is large: its 46 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
Binary file not shown.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
Binary file not shown.
This diff is large: its 138 lines aren’t shown here.
This diff is large: its 628 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 1238 lines aren’t shown here.
Binary file not shown.
This diff is large: its 237 lines aren’t shown here.
Binary file not shown.
This diff is large: its 232 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 662 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 93 lines aren’t shown here.
This diff is large: its 50 lines aren’t shown here.
This diff is large: its 53 lines aren’t shown here.
This diff is large: its 44 lines aren’t shown here.
This diff is large: its 295 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 48 lines aren’t shown here.
This diff is large: its 48 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 48 lines aren’t shown here.
This diff is large: its 48 lines aren’t shown here.
This diff is large: its 48 lines aren’t shown here.
This diff is large: its 48 lines aren’t shown here.
This diff is large: its 48 lines aren’t shown here.
This diff is large: its 48 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 48 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 192 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 43 lines aren’t shown here.
This diff is large: its 39 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 47 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 48 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 208 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 134 lines aren’t shown here.
This diff is large: its 197 lines aren’t shown here.
This diff is large: its 192 lines aren’t shown here.
This diff is large: its 151 lines aren’t shown here.
This diff is large: its 139 lines aren’t shown here.
This diff is large: its 43 lines aren’t shown here.
This diff is large: its 193 lines aren’t shown here.
This diff is large: its 191 lines aren’t shown here.
This diff is large: its 210 lines aren’t shown here.
This diff is large: its 44 lines aren’t shown here.
This diff is large: its 177 lines aren’t shown here.
This diff is large: its 301 lines aren’t shown here.
This diff is large: its 54 lines aren’t shown here.
This diff is large: its 44 lines aren’t shown here.
This diff is large: its 234 lines aren’t shown here.
This diff is large: its 277 lines aren’t shown here.
This diff is large: its 301 lines aren’t shown here.
This diff is large: its 314 lines aren’t shown here.
This diff is large: its 48 lines aren’t shown here.
This diff is large: its 88 lines aren’t shown here.
This diff is large: its 48 lines aren’t shown here.
This diff is large: its 53 lines aren’t shown here.
This diff is large: its 48 lines aren’t shown here.
This diff is large: its 48 lines aren’t shown here.
This diff is large: its 48 lines aren’t shown here.
This diff is large: its 48 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 48 lines aren’t shown here.
This diff is large: its 48 lines aren’t shown here.
This diff is large: its 80 lines aren’t shown here.
This diff is large: its 55 lines aren’t shown here.
This diff is large: its 59 lines aren’t shown here.
This diff is large: its 55 lines aren’t shown here.
This diff is large: its 56 lines aren’t shown here.
This diff is large: its 240 lines aren’t shown here.
This diff is large: its 44 lines aren’t shown here.
This diff is large: its 48 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 44 lines aren’t shown here.
This diff is large: its 43 lines aren’t shown here.
This diff is large: its 45 lines aren’t shown here.
This diff is large: its 44 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 80 lines aren’t shown here.
This diff is large: its 66 lines aren’t shown here.
This diff is large: its 138 lines aren’t shown here.
This diff is large: its 48 lines aren’t shown here.
This diff is large: its 45 lines aren’t shown here.
This diff is large: its 201 lines aren’t shown here.
This diff is large: its 221 lines aren’t shown here.
This diff is large: its 44 lines aren’t shown here.
This diff is large: its 45 lines aren’t shown here.
This diff is large: its 44 lines aren’t shown here.
This diff is large: its 45 lines aren’t shown here.
This diff is large: its 184 lines aren’t shown here.
This diff is large: its 50 lines aren’t shown here.
This diff is large: its 43 lines aren’t shown here.
This diff is large: its 44 lines aren’t shown here.
This diff is large: its 420 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 57 lines aren’t shown here.
This diff is large: its 57 lines aren’t shown here.
This diff is large: its 57 lines aren’t shown here.
This diff is large: its 57 lines aren’t shown here.
This diff is large: its 57 lines aren’t shown here.
This diff is large: its 57 lines aren’t shown here.
This diff is large: its 57 lines aren’t shown here.
This diff is large: its 57 lines aren’t shown here.
This diff is large: its 57 lines aren’t shown here.
This diff is large: its 57 lines aren’t shown here.
This diff is large: its 53 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 53 lines aren’t shown here.
This diff is large: its 53 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 53 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 62 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 47 lines aren’t shown here.
This diff is large: its 46 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 57 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 63 lines aren’t shown here.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 196 lines aren’t shown here.
This diff is large: its 254 lines aren’t shown here.
This diff is large: its 233 lines aren’t shown here.
This diff is large: its 257 lines aren’t shown here.
This diff is large: its 43 lines aren’t shown here.
This diff is large: its 202 lines aren’t shown here.
This diff is large: its 194 lines aren’t shown here.
This diff is large: its 214 lines aren’t shown here.
This diff is large: its 43 lines aren’t shown here.
This diff is large: its 113 lines aren’t shown here.
This diff is large: its 262 lines aren’t shown here.
This diff is large: its 44 lines aren’t shown here.
This diff is large: its 201 lines aren’t shown here.
This diff is large: its 222 lines aren’t shown here.
This diff is large: its 60 lines aren’t shown here.
This diff is large: its 59 lines aren’t shown here.
This diff is large: its 320 lines aren’t shown here.
This diff is large: its 55 lines aren’t shown here.
This diff is large: its 196 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 57 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 53 lines aren’t shown here.
This diff is large: its 53 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 182 lines aren’t shown here.
This diff is large: its 48 lines aren’t shown here.
This diff is large: its 53 lines aren’t shown here.
This diff is large: its 46 lines aren’t shown here.
This diff is large: its 48 lines aren’t shown here.
This diff is large: its 44 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 53 lines aren’t shown here.
This diff is large: its 43 lines aren’t shown here.
This diff is large: its 43 lines aren’t shown here.
This diff is large: its 44 lines aren’t shown here.
This diff is large: its 44 lines aren’t shown here.
This diff is large: its 44 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 97 lines aren’t shown here.
This diff is large: its 78 lines aren’t shown here.
This diff is large: its 266 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 45 lines aren’t shown here.
This diff is large: its 160 lines aren’t shown here.
This diff is large: its 154 lines aren’t shown here.
This diff is large: its 43 lines aren’t shown here.
This diff is large: its 45 lines aren’t shown here.
This diff is large: its 43 lines aren’t shown here.
This diff is large: its 45 lines aren’t shown here.
This diff is large: its 901 lines aren’t shown here.
This diff is large: its 61 lines aren’t shown here.
This diff is large: its 342 lines aren’t shown here.
This diff is large: its 61 lines aren’t shown here.
This diff is large: its 61 lines aren’t shown here.
This diff is large: its 333 lines aren’t shown here.
Binary file not shown.
This diff is large: its 57 lines aren’t shown here.
Binary file not shown.
This diff is large: its 42 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 263 lines aren’t shown here.
Binary file not shown.
This diff is large: its 35 lines aren’t shown here.
Binary file not shown.
This diff is large: its 39 lines aren’t shown here.
Binary file not shown.
This diff is large: its 40 lines aren’t shown here.
Binary file not shown.
This diff is large: its 104 lines aren’t shown here.
Binary file not shown.
This diff is large: its 56 lines aren’t shown here.
Binary file not shown.
This diff is large: its 160 lines aren’t shown here.
This diff is large: its 394 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 257 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 257 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 105 lines aren’t shown here.
Binary file not shown.
This diff is large: its 130 lines aren’t shown here.
Binary file not shown.
This diff is large: its 3311 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 338 lines aren’t shown here.
Binary file not shown.
This diff is large: its 35 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 1061 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 529 lines aren’t shown here.
Binary file not shown.
This diff is large: its 92 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 171 lines aren’t shown here.
Binary file not shown.
This diff is large: its 54 lines aren’t shown here.
Binary file not shown.
This diff is large: its 49 lines aren’t shown here.
Binary file not shown.
This diff is large: its 42 lines aren’t shown here.
Binary file not shown.
This diff is large: its 62 lines aren’t shown here.
Binary file not shown.
This diff is large: its 120 lines aren’t shown here.
This diff is large: its 105 lines aren’t shown here.
This diff is large: its 236 lines aren’t shown here.
This diff is large: its 610 lines aren’t shown here.
This diff is large: its 7 lines aren’t shown here.
This diff is large: its 3 lines aren’t shown here.
This diff is large: its 3 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 333 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 218 lines aren’t shown here.
Binary file not shown.
This diff is large: its 296 lines aren’t shown here.
Binary file not shown.
This diff is large: its 330 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 162 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 160 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 118 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 115 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 124 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 115 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 121 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 116 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 119 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 115 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 136 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 123 lines aren’t shown here.
Binary file not shown.
This diff is large: its 90 lines aren’t shown here.
Binary file not shown.
This diff is large: its 1126 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 624 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 331 lines aren’t shown here.
Binary file not shown.
This diff is large: its 115 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 265 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 274 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 2129 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 104 lines aren’t shown here.
Binary file not shown.
This diff is large: its 56 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 157 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 461 lines aren’t shown here.
This diff is large: its 158 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 141 lines aren’t shown here.
Binary file not shown.
This diff is large: its 73 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 39 lines aren’t shown here.
This diff is large: its 36 lines aren’t shown here.
This diff is large: its 763 lines aren’t shown here.
This diff is large: its 116 lines aren’t shown here.
This diff is large: its 221 lines aren’t shown here.
This diff is large: its 114 lines aren’t shown here.
This diff is large: its 45 lines aren’t shown here.
This diff is large: its 70 lines aren’t shown here.
This diff is large: its 76 lines aren’t shown here.
This diff is large: its 210 lines aren’t shown here.
This diff is large: its 240 lines aren’t shown here.
This diff is large: its 207 lines aren’t shown here.
This diff is large: its 654 lines aren’t shown here.
This diff is large: its 82 lines aren’t shown here.
This diff is large: its 72 lines aren’t shown here.
This diff is large: its 339 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
Binary file not shown.
This diff is large: its 216 lines aren’t shown here.
Binary file not shown.
This diff is large: its 46 lines aren’t shown here.
Binary file not shown.
This diff is large: its 112 lines aren’t shown here.
Binary file not shown.
This diff is large: its 91 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 207 lines aren’t shown here.
This diff is large: its 394 lines aren’t shown here.
Binary file not shown.
This diff is large: its 471 lines aren’t shown here.
This diff is large: its 164 lines aren’t shown here.
This diff is large: its 154 lines aren’t shown here.
Binary file not shown.
This diff is large: its 100 lines aren’t shown here.
Binary file not shown.
This diff is large: its 534 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 602 lines aren’t shown here.
This diff is large: its 169 lines aren’t shown here.
Binary file not shown.
This diff is large: its 51 lines aren’t shown here.
Binary file not shown.
This diff is large: its 1111 lines aren’t shown here.
Binary file not shown.
This diff is large: its 87 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 155 lines aren’t shown here.
Binary file not shown.
This diff is large: its 61 lines aren’t shown here.
Binary file not shown.
This diff is large: its 148 lines aren’t shown here.
Binary file not shown.
This diff is large: its 45 lines aren’t shown here.
Binary file not shown.
This diff is large: its 38 lines aren’t shown here.
Binary file not shown.
This diff is large: its 379 lines aren’t shown here.
Binary file not shown.
This diff is large: its 156 lines aren’t shown here.
Binary file not shown.
This diff is large: its 146 lines aren’t shown here.
Binary file not shown.
This diff is large: its 77 lines aren’t shown here.
Binary file not shown.
This diff is large: its 68 lines aren’t shown here.
Binary file not shown.
This diff is large: its 62 lines aren’t shown here.
Binary file not shown.
This diff is large: its 430 lines aren’t shown here.
Binary file not shown.
This diff is large: its 134 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 1256 lines aren’t shown here.
Binary file not shown.
This diff is large: its 393 lines aren’t shown here.
Binary file not shown.
This diff is large: its 102 lines aren’t shown here.
Binary file not shown.
This diff is large: its 211 lines aren’t shown here.
Binary file not shown.
This diff is large: its 295 lines aren’t shown here.
Binary file not shown.
This diff is large: its 224 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 483 lines aren’t shown here.
Binary file not shown.
This diff is large: its 41 lines aren’t shown here.
Binary file not shown.
This diff is large: its 202 lines aren’t shown here.
Binary file not shown.
This diff is large: its 45 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 142 lines aren’t shown here.
Binary file not shown.
This diff is large: its 96 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 217 lines aren’t shown here.
Binary file not shown.
This diff is large: its 50 lines aren’t shown here.
Binary file not shown.
This diff is large: its 99 lines aren’t shown here.
Binary file not shown.
This diff is large: its 242 lines aren’t shown here.
Binary file not shown.
This diff is large: its 60 lines aren’t shown here.
This diff is large: its 168 lines aren’t shown here.
Binary file not shown.
This diff is large: its 96 lines aren’t shown here.
Binary file not shown.
This diff is large: its 137 lines aren’t shown here.
This diff is large: its 75 lines aren’t shown here.
Binary file not shown.
This diff is large: its 46 lines aren’t shown here.
Binary file not shown.
This diff is large: its 129 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 155 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 57 lines aren’t shown here.
This diff is large: its 291 lines aren’t shown here.
This diff is large: its 576 lines aren’t shown here.
This diff is large: its 459 lines aren’t shown here.
This diff is large: its 7 lines aren’t shown here.
This diff is large: its 3 lines aren’t shown here.
This diff is large: its 3 lines aren’t shown here.
This diff is large: its 187 lines aren’t shown here.
This diff is large: its 657 lines aren’t shown here.
This diff is large: its 253 lines aren’t shown here.
This diff is large: its 572 lines aren’t shown here.
This diff is large: its 1224 lines aren’t shown here.
This diff is large: its 394 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 131 lines aren’t shown here.
This diff is large: its 58 lines aren’t shown here.
This diff is large: its 570 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 44 lines aren’t shown here.
This diff is large: its 94 lines aren’t shown here.
This diff is large: its 72 lines aren’t shown here.
This diff is large: its 423 lines aren’t shown here.
This diff is large: its 193 lines aren’t shown here.
This diff is large: its 183 lines aren’t shown here.
This diff is large: its 45 lines aren’t shown here.
This diff is large: its 129 lines aren’t shown here.
This diff is large: its 112 lines aren’t shown here.
This diff is large: its 454 lines aren’t shown here.
This diff is large: its 57 lines aren’t shown here.
This diff is large: its 54 lines aren’t shown here.
This diff is large: its 93 lines aren’t shown here.
This diff is large: its 57 lines aren’t shown here.
This diff is large: its 64 lines aren’t shown here.
This diff is large: its 126 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 65 lines aren’t shown here.
This diff is large: its 58 lines aren’t shown here.
This diff is large: its 86 lines aren’t shown here.
This diff is large: its 77 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 194 lines aren’t shown here.
This diff is large: its 212 lines aren’t shown here.
This diff is large: its 301 lines aren’t shown here.
This diff is large: its 166 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 88 lines aren’t shown here.
This diff is large: its 59 lines aren’t shown here.
This diff is large: its 78 lines aren’t shown here.
This diff is large: its 59 lines aren’t shown here.
This diff is large: its 59 lines aren’t shown here.
This diff is large: its 56 lines aren’t shown here.
This diff is large: its 117 lines aren’t shown here.
This diff is large: its 357 lines aren’t shown here.
This diff is large: its 82 lines aren’t shown here.
This diff is large: its 81 lines aren’t shown here.
This diff is large: its 75 lines aren’t shown here.
This diff is large: its 104 lines aren’t shown here.
This diff is large: its 69 lines aren’t shown here.
This diff is large: its 50 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 76 lines aren’t shown here.
This diff is large: its 117 lines aren’t shown here.
This diff is large: its 81 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 39 lines aren’t shown here.
This diff is large: its 63 lines aren’t shown here.
This diff is large: its 214 lines aren’t shown here.
This diff is large: its 199 lines aren’t shown here.
This diff is large: its 224 lines aren’t shown here.
This diff is large: its 96 lines aren’t shown here.
This diff is large: its 328 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 51 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 342 lines aren’t shown here.
This diff is large: its 93 lines aren’t shown here.
This diff is large: its 299 lines aren’t shown here.
This diff is large: its 115 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 48 lines aren’t shown here.
This diff is large: its 101 lines aren’t shown here.
This diff is large: its 651 lines aren’t shown here.
This diff is large: its 210 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 617 lines aren’t shown here.
This diff is large: its 258 lines aren’t shown here.
This diff is large: its 111 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 594 lines aren’t shown here.
This diff is large: its 3 lines aren’t shown here.
This diff is large: its 528 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 128 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 3 lines aren’t shown here.
Binary file not shown.
This diff is large: its 400 lines aren’t shown here.
Binary file not shown.
This diff is large: its 152 lines aren’t shown here.
Binary file not shown.
This diff is large: its 77 lines aren’t shown here.
Binary file not shown.
This diff is large: its 78 lines aren’t shown here.
Binary file not shown.
This diff is large: its 92 lines aren’t shown here.
Binary file not shown.
This diff is large: its 182 lines aren’t shown here.
Binary file not shown.
This diff is large: its 75 lines aren’t shown here.
Binary file not shown.
This diff is large: its 121 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 220 lines aren’t shown here.
This diff is large: its 196 lines aren’t shown here.
Binary file not shown.
This diff is large: its 206 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 294 lines aren’t shown here.
Binary file not shown.
This diff is large: its 123 lines aren’t shown here.
Binary file not shown.
This diff is large: its 87 lines aren’t shown here.
Binary file not shown.
This diff is large: its 109 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 237 lines aren’t shown here.
Binary file not shown.
This diff is large: its 117 lines aren’t shown here.
This diff is large: its 73 lines aren’t shown here.
This diff is large: its 37 lines aren’t shown here.
Binary file not shown.
This diff is large: its 61 lines aren’t shown here.
Binary file not shown.
This diff is large: its 43 lines aren’t shown here.
Binary file not shown.
This diff is large: its 78 lines aren’t shown here.
Binary file not shown.
This diff is large: its 72 lines aren’t shown here.
Binary file not shown.
This diff is large: its 80 lines aren’t shown here.
Binary file not shown.
This diff is large: its 67 lines aren’t shown here.
Binary file not shown.
This diff is large: its 198 lines aren’t shown here.
Binary file not shown.
This diff is large: its 112 lines aren’t shown here.
Binary file not shown.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 56 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 447 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 861 lines aren’t shown here.
Binary file not shown.
This diff is large: its 176 lines aren’t shown here.
This diff is large: its 96 lines aren’t shown here.
Binary file not shown.
This diff is large: its 132 lines aren’t shown here.
This diff is large: its 348 lines aren’t shown here.
Binary file not shown.
This diff is large: its 132 lines aren’t shown here.
Binary file not shown.
This diff is large: its 80 lines aren’t shown here.
Binary file not shown.
This diff is large: its 149 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 199 lines aren’t shown here.
Binary file not shown.
This diff is large: its 81 lines aren’t shown here.
Binary file not shown.
This diff is large: its 150 lines aren’t shown here.
This diff is large: its 173 lines aren’t shown here.
Binary file not shown.
This diff is large: its 126 lines aren’t shown here.
Binary file not shown.
This diff is large: its 477 lines aren’t shown here.
Binary file not shown.
This diff is large: its 416 lines aren’t shown here.
Binary file not shown.
This diff is large: its 88 lines aren’t shown here.
Binary file not shown.
This diff is large: its 107 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 272 lines aren’t shown here.
Binary file not shown.
This diff is large: its 134 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 122 lines aren’t shown here.
Binary file not shown.
This diff is large: its 45 lines aren’t shown here.
Binary file not shown.
This diff is large: its 75 lines aren’t shown here.
Binary file not shown.
This diff is large: its 44 lines aren’t shown here.
Binary file not shown.
This diff is large: its 41 lines aren’t shown here.
Binary file not shown.
This diff is large: its 40 lines aren’t shown here.
Binary file not shown.
This diff is large: its 129 lines aren’t shown here.
Binary file not shown.
This diff is large: its 112 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
Binary file not shown.
This diff is large: its 59 lines aren’t shown here.
Binary file not shown.
This diff is large: its 48 lines aren’t shown here.
Binary file not shown.
This diff is large: its 59 lines aren’t shown here.
Binary file not shown.
This diff is large: its 58 lines aren’t shown here.
Binary file not shown.
This diff is large: its 94 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 212 lines aren’t shown here.
Binary file not shown.
This diff is large: its 100 lines aren’t shown here.
Binary file not shown.
This diff is large: its 188 lines aren’t shown here.
Binary file not shown.
This diff is large: its 86 lines aren’t shown here.
Binary file not shown.
This diff is large: its 68 lines aren’t shown here.
Binary file not shown.
This diff is large: its 91 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 165 lines aren’t shown here.
Binary file not shown.
This diff is large: its 55 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 786 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 136 lines aren’t shown here.
Binary file not shown.
This diff is large: its 92 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 4 lines aren’t shown here.
This diff is large: its 64 lines aren’t shown here.
This diff is large: its 93 lines aren’t shown here.
This diff is large: its 93 lines aren’t shown here.
This diff is large: its 93 lines aren’t shown here.
This diff is large: its 93 lines aren’t shown here.
This diff is large: its 93 lines aren’t shown here.
This diff is large: its 93 lines aren’t shown here.
This diff is large: its 93 lines aren’t shown here.
This diff is large: its 93 lines aren’t shown here.
This diff is large: its 93 lines aren’t shown here.
This diff is large: its 93 lines aren’t shown here.
This diff is large: its 93 lines aren’t shown here.
This diff is large: its 3 lines aren’t shown here.
This diff is large: its 396 lines aren’t shown here.
This diff is large: its 695 lines aren’t shown here.
This diff is large: its 150 lines aren’t shown here.
This diff is large: its 130 lines aren’t shown here.
This diff is large: its 92 lines aren’t shown here.
This diff is large: its 361 lines aren’t shown here.
This diff is large: its 102 lines aren’t shown here.
This diff is large: its 299 lines aren’t shown here.
This diff is large: its 106 lines aren’t shown here.
This diff is large: its 520 lines aren’t shown here.
This diff is large: its 507 lines aren’t shown here.
This diff is large: its 307 lines aren’t shown here.
This diff is large: its 392 lines aren’t shown here.
This diff is large: its 150 lines aren’t shown here.
This diff is large: its 109 lines aren’t shown here.
This diff is large: its 77 lines aren’t shown here.
This diff is large: its 301 lines aren’t shown here.
This diff is large: its 77 lines aren’t shown here.
This diff is large: its 299 lines aren’t shown here.
This diff is large: its 77 lines aren’t shown here.
This diff is large: its 295 lines aren’t shown here.
This diff is large: its 77 lines aren’t shown here.
This diff is large: its 299 lines aren’t shown here.
This diff is large: its 287 lines aren’t shown here.
This diff is large: its 175 lines aren’t shown here.
This diff is large: its 329 lines aren’t shown here.
This diff is large: its 402 lines aren’t shown here.
This diff is large: its 365 lines aren’t shown here.
This diff is large: its 101 lines aren’t shown here.
This diff is large: its 37 lines aren’t shown here.
This diff is large: its 132 lines aren’t shown here.
This diff is large: its 245 lines aren’t shown here.
This diff is large: its 38 lines aren’t shown here.
This diff is large: its 39 lines aren’t shown here.
This diff is large: its 82 lines aren’t shown here.
This diff is large: its 82 lines aren’t shown here.
This diff is large: its 82 lines aren’t shown here.
This diff is large: its 82 lines aren’t shown here.
This diff is large: its 82 lines aren’t shown here.
This diff is large: its 82 lines aren’t shown here.
This diff is large: its 82 lines aren’t shown here.
This diff is large: its 88 lines aren’t shown here.
This diff is large: its 82 lines aren’t shown here.
This diff is large: its 82 lines aren’t shown here.
This diff is large: its 84 lines aren’t shown here.
This diff is large: its 84 lines aren’t shown here.
This diff is large: its 687 lines aren’t shown here.
This diff is large: its 168 lines aren’t shown here.
This diff is large: its 73 lines aren’t shown here.
This diff is large: its 329 lines aren’t shown here.
This diff is large: its 58 lines aren’t shown here.
This diff is large: its 295 lines aren’t shown here.
This diff is large: its 58 lines aren’t shown here.
This diff is large: its 255 lines aren’t shown here.
This diff is large: its 265 lines aren’t shown here.
This diff is large: its 58 lines aren’t shown here.
This diff is large: its 265 lines aren’t shown here.
This diff is large: its 265 lines aren’t shown here.
This diff is large: its 63 lines aren’t shown here.
This diff is large: its 247 lines aren’t shown here.
This diff is large: its 265 lines aren’t shown here.
This diff is large: its 178 lines aren’t shown here.
This diff is large: its 584 lines aren’t shown here.
This diff is large: its 265 lines aren’t shown here.
This diff is large: its 118 lines aren’t shown here.
This diff is large: its 656 lines aren’t shown here.
This diff is large: its 63 lines aren’t shown here.
This diff is large: its 303 lines aren’t shown here.
This diff is large: its 53 lines aren’t shown here.
This diff is large: its 250 lines aren’t shown here.
This diff is large: its 265 lines aren’t shown here.
This diff is large: its 53 lines aren’t shown here.
This diff is large: its 250 lines aren’t shown here.
This diff is large: its 265 lines aren’t shown here.
This diff is large: its 53 lines aren’t shown here.
This diff is large: its 250 lines aren’t shown here.
This diff is large: its 265 lines aren’t shown here.
This diff is large: its 53 lines aren’t shown here.
This diff is large: its 250 lines aren’t shown here.
This diff is large: its 265 lines aren’t shown here.
This diff is large: its 103 lines aren’t shown here.
This diff is large: its 628 lines aren’t shown here.
This diff is large: its 98 lines aren’t shown here.
This diff is large: its 393 lines aren’t shown here.
This diff is large: its 265 lines aren’t shown here.
This diff is large: its 108 lines aren’t shown here.
This diff is large: its 455 lines aren’t shown here.
This diff is large: its 61 lines aren’t shown here.
This diff is large: its 39 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 44 lines aren’t shown here.
This diff is large: its 111 lines aren’t shown here.
This diff is large: its 204 lines aren’t shown here.
This diff is large: its 169 lines aren’t shown here.
This diff is large: its 118 lines aren’t shown here.
This diff is large: its 107 lines aren’t shown here.
This diff is large: its 267 lines aren’t shown here.
This diff is large: its 120 lines aren’t shown here.
This diff is large: its 60 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 38 lines aren’t shown here.
Binary file not shown.
This diff is large: its 100 lines aren’t shown here.
Binary file not shown.
This diff is large: its 163 lines aren’t shown here.
Binary file not shown.
This diff is large: its 113 lines aren’t shown here.
Binary file not shown.
This diff is large: its 35 lines aren’t shown here.
Binary file not shown.
This diff is large: its 31 lines aren’t shown here.
This diff is large: its 66 lines aren’t shown here.
This diff is large: its 347 lines aren’t shown here.
Binary file not shown.
This diff is large: its 223 lines aren’t shown here.
Binary file not shown.
This diff is large: its 355 lines aren’t shown here.
Binary file not shown.
This diff is large: its 94 lines aren’t shown here.
This diff is large: its 173 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 156 lines aren’t shown here.
This diff is large: its 47 lines aren’t shown here.
Binary file not shown.
This diff is large: its 64 lines aren’t shown here.
This diff is large: its 83 lines aren’t shown here.
Binary file not shown.
This diff is large: its 118 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 569 lines aren’t shown here.
Binary file not shown.
This diff is large: its 417 lines aren’t shown here.
Binary file not shown.
This diff is large: its 46 lines aren’t shown here.
Binary file not shown.
This diff is large: its 55 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This diff is large: its 113 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
This diff is large: its 2879 lines aren’t shown here.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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.