mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-16 01:40:31 +00:00
Merge
This commit is contained in:
commit
c7e190348d
@ -50,6 +50,7 @@ BUG_SUBMIT_LINE = <a href="$(BUG_SUBMIT_URL)">Submit a bug or feature</a>
|
||||
DEV_DOCS_URL-5 = http://java.sun.com/j2se/1.5.0/docs/index.html
|
||||
DEV_DOCS_URL-6 = http://download.oracle.com/javase/6/docs/index.html
|
||||
DEV_DOCS_URL-7 = http://download.oracle.com/javase/7/docs/index.html
|
||||
DEV_DOCS_URL-8 = http://download.oracle.com/javase/8/docs/index.html
|
||||
DEV_DOCS_URL = $(DEV_DOCS_URL-$(JDK_MINOR_VERSION))
|
||||
DOCS_BASE_URL = http://download.oracle.com/javase/7/docs
|
||||
|
||||
|
||||
@ -33,6 +33,7 @@ FILES_c = \
|
||||
Console_md.c \
|
||||
Double.c \
|
||||
Executable.c \
|
||||
Field.c \
|
||||
FileDescriptor_md.c \
|
||||
FileInputStream.c \
|
||||
FileInputStream_md.c \
|
||||
|
||||
@ -190,6 +190,8 @@ SUNWprivate_1.1 {
|
||||
Java_java_lang_reflect_Array_setLong;
|
||||
Java_java_lang_reflect_Array_setShort;
|
||||
Java_java_lang_reflect_Executable_getParameters0;
|
||||
Java_java_lang_reflect_Executable_getTypeAnnotationBytes0;
|
||||
Java_java_lang_reflect_Field_getTypeAnnotationBytes0;
|
||||
Java_java_lang_Runtime_freeMemory;
|
||||
Java_java_lang_Runtime_maxMemory;
|
||||
Java_java_lang_Runtime_gc;
|
||||
|
||||
@ -31,14 +31,14 @@
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
|
||||
<java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/3">
|
||||
<java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/4">
|
||||
<compilation-unit>
|
||||
<package-root>${root}/src/share/classes</package-root>
|
||||
<package-root>${root}/src/macosx/classes</package-root>
|
||||
<package-root>${root}/src/solaris/classes</package-root>
|
||||
<package-root>${root}/src/windows/classes</package-root>
|
||||
<classpath mode="boot">${bootstrap.jdk}/jre/lib/rt.jar</classpath>
|
||||
<built-to>${root}/build/${platform}-${arch}/classes</built-to>
|
||||
<built-to>${root}/../build/${platform}-${arch}/jdk/classes</built-to>
|
||||
<javadoc-built-to>${root}/build/${platform}-${arch}/docs/api</javadoc-built-to>
|
||||
<source-level>1.8</source-level>
|
||||
</compilation-unit>
|
||||
|
||||
@ -31,11 +31,11 @@
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
|
||||
<java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/3">
|
||||
<java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/4">
|
||||
<compilation-unit>
|
||||
<package-root>${root}/src/share/classes</package-root>
|
||||
<classpath mode="boot">${bootstrap.jdk}/jre/lib/rt.jar</classpath>
|
||||
<built-to>${root}/build/${platform}-${arch}/classes</built-to>
|
||||
<built-to>${root}/../build/${platform}-${arch}/jdk/classes</built-to>
|
||||
<javadoc-built-to>${root}/build/${platform}-${arch}/docs/api</javadoc-built-to>
|
||||
<source-level>1.8</source-level>
|
||||
</compilation-unit>
|
||||
|
||||
@ -173,6 +173,44 @@ class JarMetaIndex {
|
||||
*/
|
||||
private HashMap<String, HashSet<String>> knownPrefixMap = new HashMap<>();
|
||||
|
||||
/*
|
||||
* A class for mapping package prefixes to the number of
|
||||
* levels of package elements to include.
|
||||
*/
|
||||
static class ExtraLevel {
|
||||
public ExtraLevel(String prefix, int levels) {
|
||||
this.prefix = prefix;
|
||||
this.levels = levels;
|
||||
}
|
||||
String prefix;
|
||||
int levels;
|
||||
}
|
||||
|
||||
/*
|
||||
* A list of the special-cased package names.
|
||||
*/
|
||||
private static ArrayList<ExtraLevel> extraLevels = new ArrayList<>();
|
||||
|
||||
static {
|
||||
// The order of these statements is significant,
|
||||
// since we stop looking after the first match.
|
||||
|
||||
// Need more precise information to disambiguate
|
||||
// (illegal) references from applications to
|
||||
// obsolete backported collections classes in
|
||||
// com/sun/java/util
|
||||
extraLevels.add(new ExtraLevel("com/sun/java/util/", Integer.MAX_VALUE));
|
||||
extraLevels.add(new ExtraLevel("com/sun/java/", 4));
|
||||
// Need more information than just first two package
|
||||
// name elements to determine that classes in
|
||||
// deploy.jar are not in rt.jar
|
||||
extraLevels.add(new ExtraLevel("com/sun/", 3));
|
||||
// Need to make sure things in jfr.jar aren't
|
||||
// confused with other com/oracle/** packages
|
||||
extraLevels.add(new ExtraLevel("com/oracle/jrockit", 3));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* We add maximum 5 second level entries to "sun", "java" and
|
||||
* "javax" entries. Tune this parameter to get a balance on the
|
||||
@ -237,39 +275,25 @@ class JarMetaIndex {
|
||||
String[] pkgElements = name.split("/");
|
||||
// Last one is the class name; definitely ignoring that
|
||||
if (pkgElements.length > 2) {
|
||||
String meta = null;
|
||||
// Need more information than just first two package
|
||||
// name elements to determine that classes in
|
||||
// deploy.jar are not in rt.jar
|
||||
if (pkgElements.length > 3 &&
|
||||
pkgElements[0].equals("com") &&
|
||||
pkgElements[1].equals("sun")) {
|
||||
// Need more precise information to disambiguate
|
||||
// (illegal) references from applications to
|
||||
// obsolete backported collections classes in
|
||||
// com/sun/java/util
|
||||
if (pkgElements.length > 4 &&
|
||||
pkgElements[2].equals("java")) {
|
||||
int bound = 0;
|
||||
if (pkgElements[3].equals("util")) {
|
||||
// Take all of the packages
|
||||
bound = pkgElements.length - 1;
|
||||
} else {
|
||||
// Trim it somewhat more
|
||||
bound = 4;
|
||||
}
|
||||
meta = "";
|
||||
for (int j = 0; j < bound; j++) {
|
||||
meta += pkgElements[j] + "/";
|
||||
}
|
||||
} else {
|
||||
meta = pkgElements[0] + "/" + pkgElements[1]
|
||||
+ "/" + pkgElements[2] + "/";
|
||||
String meta = "";
|
||||
|
||||
// Default is 2 levels of package elements
|
||||
int levels = 2;
|
||||
|
||||
// But for some packages we add more elements
|
||||
for(ExtraLevel el : extraLevels) {
|
||||
if (name.startsWith(el.prefix)) {
|
||||
levels = el.levels;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
meta = pkgElements[0] + "/" + pkgElements[1] + "/";
|
||||
}
|
||||
indexSet.add(meta);
|
||||
for (int i = 0; i < levels && i < pkgElements.length - 1; i++) {
|
||||
meta += pkgElements[i] + "/";
|
||||
}
|
||||
|
||||
if (!meta.equals("")) {
|
||||
indexSet.add(meta);
|
||||
}
|
||||
}
|
||||
|
||||
} // end of "while" loop;
|
||||
|
||||
@ -237,10 +237,10 @@ endif
|
||||
|
||||
# These files do not appear in the build result of the old build. This
|
||||
# is because they are generated sources, but the AUTO_JAVA_FILES won't
|
||||
# pick them up since they aren't generated when the source dirs are
|
||||
# pick them up since they aren't generated when the source dirs are
|
||||
# searched and they aren't referenced by any other classes so they won't
|
||||
# be picked up by implicit compilation. On a rebuild, they are picked up
|
||||
# and compiled. Exclude them here to produce the same rt.jar as the old
|
||||
# and compiled. Exclude them here to produce the same rt.jar as the old
|
||||
# build does when building just once.
|
||||
EXFILES+=javax/swing/plaf/nimbus/InternalFrameTitlePanePainter.java \
|
||||
javax/swing/plaf/nimbus/OptionPaneMessageAreaPainter.java \
|
||||
@ -308,19 +308,6 @@ $(eval $(call SetupJavaCompilation,BUILD_JDK,\
|
||||
|
||||
##########################################################################################
|
||||
|
||||
ifndef OPENJDK
|
||||
|
||||
$(eval $(call SetupJavaCompilation,BUILD_ALTCLASSES,\
|
||||
SETUP:=GENERATE_JDKBYTECODE,\
|
||||
SRC:=$(JDK_TOPDIR)/src/closed/share/altclasses, \
|
||||
BIN:=$(JDK_OUTPUTDIR)/altclasses_classes))
|
||||
|
||||
$(BUILD_ALTCLASSES): $(BUILD_JDK)
|
||||
|
||||
endif
|
||||
|
||||
##########################################################################################
|
||||
|
||||
$(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin:
|
||||
$(MKDIR) -p $(@D)
|
||||
$(TOUCH) $@
|
||||
@ -403,7 +390,7 @@ endif
|
||||
|
||||
##########################################################################################
|
||||
|
||||
all: $(BUILD_JDK) $(BUILD_ALTCLASSES) $(BUILD_JOBJC) $(BUILD_JOBJC_HEADERS) $(COPY_EXTRA) \
|
||||
all: $(BUILD_JDK) $(BUILD_JOBJC) $(BUILD_JOBJC_HEADERS) $(COPY_EXTRA) \
|
||||
$(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin \
|
||||
$(BUILD_ACCESSBRIDGE_32) $(BUILD_ACCESSBRIDGE_64) \
|
||||
$(BUILD_ACCESSBRIDGE_LEGACY)
|
||||
|
||||
@ -990,15 +990,6 @@ endif
|
||||
|
||||
##########################################################################################
|
||||
|
||||
ifndef OPENJDK
|
||||
$(eval $(call SetupArchive,BUILD_ALT_RT_JAR,,\
|
||||
SRCS:=$(JDK_OUTPUTDIR)/altclasses_classes,\
|
||||
JAR:=$(IMAGES_OUTPUTDIR)/lib/alt-rt.jar))
|
||||
|
||||
endif
|
||||
|
||||
##########################################################################################
|
||||
|
||||
# This file is imported from hotspot in Import.gmk. Copying it into images/lib so that
|
||||
# all jars can be found in one place when creating images in Images.gmk. It needs to be
|
||||
# done here so that clean targets can be simple and accurate.
|
||||
|
||||
@ -40,8 +40,8 @@ include profile-includes.txt
|
||||
# imported (signed jars) rather than built.
|
||||
#
|
||||
# The incoming lists, eg PROFILE_1_JRE_JARS_FILES, are the jars to be
|
||||
# included in this profile. They have the jar name relative to the lib
|
||||
# directory. We have to turn these into targets by adding the
|
||||
# included in this profile. They have the jar name relative to the lib
|
||||
# directory. We have to turn these into targets by adding the
|
||||
# $(IMAGES_OUTPUTDIR)/lib prefix
|
||||
#
|
||||
# Note that some jars may be optional depending on the type of build (jdk vs.
|
||||
@ -69,10 +69,6 @@ PROFILE_3_JARS := \
|
||||
$(addprefix $(IMAGES_OUTPUTDIR)/lib/, $(PROFILE_3_JRE_JAR_FILES)) \
|
||||
$(PROFILE_2_JARS)
|
||||
|
||||
ifdef OPENJDK
|
||||
FULL_JRE_JAR_FILES := $(filter-out alt-rt.jar, $(FULL_JRE_JAR_FILES))
|
||||
endif
|
||||
|
||||
ifneq ($(ENABLE_JFR), true)
|
||||
FULL_JRE_JAR_FILES := $(filter-out jfr.jar, $(FULL_JRE_JAR_FILES))
|
||||
endif
|
||||
@ -107,7 +103,7 @@ endif
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS),windows)
|
||||
ALL_JARS += $(IMAGES_OUTPUTDIR)/lib/ext/sunmscapi.jar
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS),macosx)
|
||||
ALL_JARS += $(IMAGES_OUTPUTDIR)/lib/JObjC.jar
|
||||
@ -142,7 +138,7 @@ ALL_JRE_BIN_FILES := \
|
||||
$(PROFILE_1_JRE_BIN_FILES) \
|
||||
$(PROFILE_2_JRE_BIN_FILES) \
|
||||
$(PROFILE_3_JRE_BIN_FILES) \
|
||||
$(FULL_JRE_BIN_FILES)
|
||||
$(FULL_JRE_BIN_FILES)
|
||||
|
||||
NOT_JRE_BIN_FILES := $(filter-out $(ALL_JRE_BIN_FILES), $(NEW_ALL_BIN_LIST))
|
||||
|
||||
@ -151,18 +147,18 @@ ifeq ($(PROFILE), profile_1)
|
||||
NOT_JRE_BIN_FILES += \
|
||||
$(PROFILE_2_JRE_BIN_FILES) \
|
||||
$(PROFILE_3_JRE_BIN_FILES) \
|
||||
$(FULL_JRE_BIN_FILES)
|
||||
$(FULL_JRE_BIN_FILES)
|
||||
endif
|
||||
|
||||
ifeq ($(PROFILE), profile_2)
|
||||
NOT_JRE_BIN_FILES += \
|
||||
$(PROFILE_3_JRE_BIN_FILES) \
|
||||
$(FULL_JRE_BIN_FILES)
|
||||
$(FULL_JRE_BIN_FILES)
|
||||
endif
|
||||
|
||||
ifeq ($(PROFILE), profile_3)
|
||||
NOT_JRE_BIN_FILES += \
|
||||
$(FULL_JRE_BIN_FILES)
|
||||
$(FULL_JRE_BIN_FILES)
|
||||
endif
|
||||
|
||||
NOT_JRE_BIN_FILES := $(addprefix $(JDK_OUTPUTDIR)/bin/, $(NOT_JRE_BIN_FILES))
|
||||
@ -175,7 +171,7 @@ ALL_JRE_LIB_FILES := \
|
||||
$(PROFILE_1_JRE_LIB_FILES) \
|
||||
$(PROFILE_2_JRE_LIB_FILES) \
|
||||
$(PROFILE_3_JRE_LIB_FILES) \
|
||||
$(FULL_JRE_LIB_FILES)
|
||||
$(FULL_JRE_LIB_FILES)
|
||||
|
||||
NOT_JRE_LIB_FILES := $(filter-out $(ALL_JRE_LIB_FILES), $(NEW_ALL_LIB_LIST))
|
||||
|
||||
@ -191,18 +187,18 @@ ifeq ($(PROFILE), profile_1)
|
||||
NOT_JRE_LIB_FILES += \
|
||||
$(PROFILE_2_JRE_LIB_FILES) \
|
||||
$(PROFILE_3_JRE_LIB_FILES) \
|
||||
$(FULL_JRE_LIB_FILES)
|
||||
$(FULL_JRE_LIB_FILES)
|
||||
endif
|
||||
|
||||
ifeq ($(PROFILE), profile_2)
|
||||
NOT_JRE_LIB_FILES += \
|
||||
$(PROFILE_3_JRE_LIB_FILES) \
|
||||
$(FULL_JRE_LIB_FILES)
|
||||
$(FULL_JRE_LIB_FILES)
|
||||
endif
|
||||
|
||||
ifeq ($(PROFILE), profile_3)
|
||||
NOT_JRE_LIB_FILES += \
|
||||
$(FULL_JRE_LIB_FILES)
|
||||
$(FULL_JRE_LIB_FILES)
|
||||
endif
|
||||
|
||||
# Exclude the custom jar files as these will be added back via a special rule
|
||||
@ -210,7 +206,7 @@ NOT_JRE_LIB_FILES += $(CUSTOM_JARS)
|
||||
|
||||
###############################################################################
|
||||
# Customization of rt.jar file contents
|
||||
# These are expressed as exclusions from everything found in the
|
||||
# These are expressed as exclusions from everything found in the
|
||||
# JDK_OUTPUTDIR/classes directory
|
||||
###############################################################################
|
||||
|
||||
@ -231,8 +227,8 @@ NOT_JRE_LIB_FILES += $(CUSTOM_JARS)
|
||||
#
|
||||
# These are specific types that must be included within a package.
|
||||
# There are two cases:
|
||||
# - individual types in a package that is otherwise excluded at this
|
||||
# profile level. The only arises if there are split packages.
|
||||
# - individual types in a package that is otherwise excluded at this
|
||||
# profile level. The only arises if there are split packages.
|
||||
#
|
||||
# - A higher-level package is included in a high profile where a subpackage
|
||||
# is included in a lower profile. Including the package in the high profile
|
||||
@ -247,7 +243,7 @@ NOT_JRE_LIB_FILES += $(CUSTOM_JARS)
|
||||
# containing package is include. Again this occurs with split packges.
|
||||
#
|
||||
# So the exclude list for each profile consists of the include lists
|
||||
# for all profiles above it, together with any explicitly excluded types.
|
||||
# for all profiles above it, together with any explicitly excluded types.
|
||||
# This is then combined with the overall RT_JAR_EXCLUDES list (which covers
|
||||
# things that go into other jar files).
|
||||
#
|
||||
@ -257,7 +253,7 @@ NOT_JRE_LIB_FILES += $(CUSTOM_JARS)
|
||||
# profile 3 includes the entire package, but it is harmless to add them
|
||||
# explicitly, and complex to determine if we still need to include them.
|
||||
#
|
||||
# Need a way to express:
|
||||
# Need a way to express:
|
||||
# for (int i = profile+1; i < 4; i++)
|
||||
# RT_JAR_EXCLUDES += PROFILE_$i_RTJAR_INCLUDE_PACKAGES
|
||||
#
|
||||
@ -267,7 +263,7 @@ NOT_JRE_LIB_FILES += $(CUSTOM_JARS)
|
||||
#
|
||||
# These are META-INF/services/ entries found in resources.jar. Together
|
||||
# resources.jar and rt.jar hold the contents of the classes directory, (the
|
||||
# classes in rt.jar and everything else in resources.jar).Hence the
|
||||
# classes in rt.jar and everything else in resources.jar).Hence the
|
||||
# include/exclude information for resources.jar is tied to that of rt.jar
|
||||
|
||||
include profile-rtjar-includes.txt
|
||||
@ -324,7 +320,7 @@ endif
|
||||
|
||||
# Filter out non-OpenJDK services
|
||||
ifdef OPENJDK
|
||||
EXCLUDED_SERVICES := META-INF/services/javax.script.ScriptEngineFactory
|
||||
EXCLUDED_SERVICES := META-INF/services/javax.script.ScriptEngineFactory
|
||||
PROFILE_INCLUDE_METAINF_SERVICES := $(filter-out $(EXCLUDED_SERVICES),$(PROFILE_INCLUDE_METAINF_SERVICES))
|
||||
endif
|
||||
|
||||
|
||||
@ -190,6 +190,8 @@ SUNWprivate_1.1 {
|
||||
Java_java_lang_reflect_Array_setLong;
|
||||
Java_java_lang_reflect_Array_setShort;
|
||||
Java_java_lang_reflect_Executable_getParameters0;
|
||||
Java_java_lang_reflect_Executable_getTypeAnnotationBytes0;
|
||||
Java_java_lang_reflect_Field_getTypeAnnotationBytes0;
|
||||
Java_java_lang_Runtime_freeMemory;
|
||||
Java_java_lang_Runtime_maxMemory;
|
||||
Java_java_lang_Runtime_gc;
|
||||
|
||||
@ -107,14 +107,14 @@ PROFILE_2_JRE_BIN_FILES := \
|
||||
rmid$(EXE_SUFFIX) \
|
||||
rmiregistry$(EXE_SUFFIX)
|
||||
|
||||
PROFILE_2_JRE_LIB_FILES :=
|
||||
PROFILE_2_JRE_LIB_FILES :=
|
||||
|
||||
PROFILE_2_JRE_OTHER_FILES :=
|
||||
PROFILE_2_JRE_OTHER_FILES :=
|
||||
|
||||
PROFILE_2_JRE_JAR_FILES :=
|
||||
PROFILE_2_JRE_JAR_FILES :=
|
||||
|
||||
|
||||
PROFILE_3_JRE_BIN_FILES :=
|
||||
PROFILE_3_JRE_BIN_FILES :=
|
||||
|
||||
PROFILE_3_JRE_LIB_FILES := \
|
||||
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)hprof$(SHARED_LIBRARY_SUFFIX) \
|
||||
@ -138,7 +138,7 @@ PROFILE_3_JRE_LIB_FILES := \
|
||||
management/management.properties \
|
||||
management/snmp.acl.template
|
||||
|
||||
PROFILE_3_JRE_OTHER_FILES :=
|
||||
PROFILE_3_JRE_OTHER_FILES :=
|
||||
|
||||
PROFILE_3_JRE_JAR_FILES := \
|
||||
management-agent.jar
|
||||
@ -171,7 +171,6 @@ FULL_JRE_LIB_FILES := \
|
||||
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)splashscreen$(SHARED_LIBRARY_SUFFIX) \
|
||||
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)t2k$(SHARED_LIBRARY_SUFFIX) \
|
||||
$(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)unpack$(SHARED_LIBRARY_SUFFIX) \
|
||||
alt-rt.jar \
|
||||
charsets.jar \
|
||||
cmm/CIEXYZ.pf \
|
||||
cmm/GRAY.pf \
|
||||
@ -248,7 +247,6 @@ FULL_JRE_OTHER_FILES := \
|
||||
man/man1/unpack200.1
|
||||
|
||||
FULL_JRE_JAR_FILES := \
|
||||
alt-rt.jar \
|
||||
charsets.jar \
|
||||
ext/cldrdata.jar \
|
||||
ext/dnsns.jar \
|
||||
|
||||
@ -155,7 +155,7 @@ public class AppleScriptEngine implements ScriptEngine {
|
||||
TRACE("init()");
|
||||
// set up our context
|
||||
/* TODO -- name of current executable? bad java documentation at:
|
||||
* http://java.sun.com/javase/6/docs/api/javax/script/ScriptEngine.html#FILENAME */
|
||||
* http://docs.oracle.com/javase/6/docs/api/javax/script/ScriptEngine.html#FILENAME */
|
||||
put(ScriptEngine.FILENAME, "");
|
||||
put(ScriptEngine.ENGINE, getEngine());
|
||||
put(ScriptEngine.ENGINE_VERSION, getEngineVersion());
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -43,7 +43,7 @@ public final class AppleProvider extends Provider {
|
||||
|
||||
public AppleProvider() {
|
||||
/* We are the Apple provider */
|
||||
super("Apple", 1.1, info);
|
||||
super("Apple", 1.8d, info);
|
||||
|
||||
AccessController.<Object>doPrivileged(new java.security.PrivilegedAction<Object>() {
|
||||
public Object run() {
|
||||
|
||||
@ -31,10 +31,6 @@ import java.util.*;
|
||||
|
||||
import com.apple.eawt.AppEvent.*;
|
||||
|
||||
interface _OpenAppHandler {
|
||||
void handleOpenApp();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
class _AppEventLegacyHandler implements AboutHandler, PreferencesHandler, _OpenAppHandler, AppReOpenedListener, OpenFilesHandler, PrintFilesHandler, QuitHandler {
|
||||
final _AppEventHandler parent;
|
||||
|
||||
30
jdk/src/macosx/classes/com/apple/eawt/_OpenAppHandler.java
Normal file
30
jdk/src/macosx/classes/com/apple/eawt/_OpenAppHandler.java
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.apple.eawt;
|
||||
|
||||
interface _OpenAppHandler {
|
||||
void handleOpenApp();
|
||||
}
|
||||
@ -25,141 +25,11 @@
|
||||
|
||||
package com.apple.laf;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.plaf.UIResource;
|
||||
|
||||
import sun.swing.SwingUtilities2;
|
||||
|
||||
class AquaComboBoxRenderer extends AquaComboBoxRendererInternal implements UIResource {
|
||||
public AquaComboBoxRenderer(final JComboBox comboBox) {
|
||||
super(comboBox);
|
||||
}
|
||||
}
|
||||
|
||||
class AquaComboBoxRendererInternal extends JLabel implements ListCellRenderer {
|
||||
final JComboBox fComboBox;
|
||||
boolean fSelected;
|
||||
boolean fChecked;
|
||||
boolean fInList;
|
||||
boolean fEditable;
|
||||
boolean fDrawCheckedItem = true;
|
||||
|
||||
// Provides space for a checkbox, and is translucent
|
||||
public AquaComboBoxRendererInternal(final JComboBox comboBox) {
|
||||
super();
|
||||
fComboBox = comboBox;
|
||||
}
|
||||
|
||||
// Don't include checkIcon space, because this is also used for button size calculations
|
||||
// - the popup-size calc will get checkIcon space from getInsets
|
||||
public Dimension getPreferredSize() {
|
||||
// From BasicComboBoxRenderer - trick to avoid zero-height items
|
||||
final Dimension size;
|
||||
|
||||
final String text = getText();
|
||||
if ((text == null) || ("".equals(text))) {
|
||||
setText(" ");
|
||||
size = super.getPreferredSize();
|
||||
setText("");
|
||||
} else {
|
||||
size = super.getPreferredSize();
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
// Don't paint the border here, it gets painted by the UI
|
||||
protected void paintBorder(final Graphics g) {
|
||||
|
||||
}
|
||||
|
||||
public int getBaseline(int width, int height) {
|
||||
return super.getBaseline(width, height) - 1;
|
||||
}
|
||||
|
||||
// Really means is the one with the mouse over it
|
||||
public Component getListCellRendererComponent(final JList list, final Object value, int index, final boolean isSelected, final boolean cellHasFocus) {
|
||||
fInList = (index >= 0); // When the button wants the item painted, it passes in -1
|
||||
fSelected = isSelected;
|
||||
if (index < 0) {
|
||||
index = fComboBox.getSelectedIndex();
|
||||
}
|
||||
|
||||
// changed this to not ask for selected index but directly compare the current item and selected item
|
||||
// different from basic because basic has no concept of checked, just has the last one selected,
|
||||
// and the user changes selection. We have selection and a check mark.
|
||||
// we used to call fComboBox.getSelectedIndex which ends up being a very bad call for large checkboxes
|
||||
// it does a linear compare of every object in the checkbox until it finds the selected one, so if
|
||||
// we have a 5000 element list we will 5000 * (selected index) .equals() of objects.
|
||||
// See Radar #3141307
|
||||
|
||||
// Fix for Radar # 3204287 where we ask for an item at a negative index!
|
||||
if (index >= 0) {
|
||||
final Object item = fComboBox.getItemAt(index);
|
||||
fChecked = fInList && item != null && item.equals(fComboBox.getSelectedItem());
|
||||
} else {
|
||||
fChecked = false;
|
||||
}
|
||||
|
||||
fEditable = fComboBox.isEditable();
|
||||
if (isSelected) {
|
||||
if (fEditable) {
|
||||
setBackground(UIManager.getColor("List.selectionBackground"));
|
||||
setForeground(UIManager.getColor("List.selectionForeground"));
|
||||
} else {
|
||||
setBackground(list.getSelectionBackground());
|
||||
setForeground(list.getSelectionForeground());
|
||||
}
|
||||
} else {
|
||||
if (fEditable) {
|
||||
setBackground(UIManager.getColor("List.background"));
|
||||
setForeground(UIManager.getColor("List.foreground"));
|
||||
} else {
|
||||
setBackground(list.getBackground());
|
||||
setForeground(list.getForeground());
|
||||
}
|
||||
}
|
||||
|
||||
setFont(list.getFont());
|
||||
|
||||
if (value instanceof Icon) {
|
||||
setIcon((Icon)value);
|
||||
} else {
|
||||
setText((value == null) ? " " : value.toString());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Insets getInsets(Insets insets) {
|
||||
if (insets == null) insets = new Insets(0, 0, 0, 0);
|
||||
insets.top = 1;
|
||||
insets.bottom = 1;
|
||||
insets.right = 5;
|
||||
insets.left = (fInList && !fEditable ? 16 + 7 : 5);
|
||||
return insets;
|
||||
}
|
||||
|
||||
protected void setDrawCheckedItem(final boolean drawCheckedItem) {
|
||||
this.fDrawCheckedItem = drawCheckedItem;
|
||||
}
|
||||
|
||||
// Paint this component, and a checkbox if it's the selected item and not in the button
|
||||
protected void paintComponent(final Graphics g) {
|
||||
if (fInList) {
|
||||
if (fSelected && !fEditable) {
|
||||
AquaMenuPainter.instance().paintSelectedMenuItemBackground(g, getWidth(), getHeight());
|
||||
} else {
|
||||
g.setColor(getBackground());
|
||||
g.fillRect(0, 0, getWidth(), getHeight());
|
||||
}
|
||||
|
||||
if (fChecked && !fEditable && fDrawCheckedItem) {
|
||||
final int y = getHeight() - 4;
|
||||
g.setColor(getForeground());
|
||||
SwingUtilities2.drawString(fComboBox, g, "\u2713", 6, y);
|
||||
}
|
||||
}
|
||||
super.paintComponent(g);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,157 @@
|
||||
/*
|
||||
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.apple.laf;
|
||||
|
||||
import sun.swing.SwingUtilities2;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
class AquaComboBoxRendererInternal extends JLabel implements ListCellRenderer {
|
||||
final JComboBox fComboBox;
|
||||
boolean fSelected;
|
||||
boolean fChecked;
|
||||
boolean fInList;
|
||||
boolean fEditable;
|
||||
boolean fDrawCheckedItem = true;
|
||||
|
||||
// Provides space for a checkbox, and is translucent
|
||||
public AquaComboBoxRendererInternal(final JComboBox comboBox) {
|
||||
super();
|
||||
fComboBox = comboBox;
|
||||
}
|
||||
|
||||
// Don't include checkIcon space, because this is also used for button size calculations
|
||||
// - the popup-size calc will get checkIcon space from getInsets
|
||||
public Dimension getPreferredSize() {
|
||||
// From BasicComboBoxRenderer - trick to avoid zero-height items
|
||||
final Dimension size;
|
||||
|
||||
final String text = getText();
|
||||
if ((text == null) || ("".equals(text))) {
|
||||
setText(" ");
|
||||
size = super.getPreferredSize();
|
||||
setText("");
|
||||
} else {
|
||||
size = super.getPreferredSize();
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
// Don't paint the border here, it gets painted by the UI
|
||||
protected void paintBorder(final Graphics g) {
|
||||
|
||||
}
|
||||
|
||||
public int getBaseline(int width, int height) {
|
||||
return super.getBaseline(width, height) - 1;
|
||||
}
|
||||
|
||||
// Really means is the one with the mouse over it
|
||||
public Component getListCellRendererComponent(final JList list, final Object value, int index, final boolean isSelected, final boolean cellHasFocus) {
|
||||
fInList = (index >= 0); // When the button wants the item painted, it passes in -1
|
||||
fSelected = isSelected;
|
||||
if (index < 0) {
|
||||
index = fComboBox.getSelectedIndex();
|
||||
}
|
||||
|
||||
// changed this to not ask for selected index but directly compare the current item and selected item
|
||||
// different from basic because basic has no concept of checked, just has the last one selected,
|
||||
// and the user changes selection. We have selection and a check mark.
|
||||
// we used to call fComboBox.getSelectedIndex which ends up being a very bad call for large checkboxes
|
||||
// it does a linear compare of every object in the checkbox until it finds the selected one, so if
|
||||
// we have a 5000 element list we will 5000 * (selected index) .equals() of objects.
|
||||
// See Radar #3141307
|
||||
|
||||
// Fix for Radar # 3204287 where we ask for an item at a negative index!
|
||||
if (index >= 0) {
|
||||
final Object item = fComboBox.getItemAt(index);
|
||||
fChecked = fInList && item != null && item.equals(fComboBox.getSelectedItem());
|
||||
} else {
|
||||
fChecked = false;
|
||||
}
|
||||
|
||||
fEditable = fComboBox.isEditable();
|
||||
if (isSelected) {
|
||||
if (fEditable) {
|
||||
setBackground(UIManager.getColor("List.selectionBackground"));
|
||||
setForeground(UIManager.getColor("List.selectionForeground"));
|
||||
} else {
|
||||
setBackground(list.getSelectionBackground());
|
||||
setForeground(list.getSelectionForeground());
|
||||
}
|
||||
} else {
|
||||
if (fEditable) {
|
||||
setBackground(UIManager.getColor("List.background"));
|
||||
setForeground(UIManager.getColor("List.foreground"));
|
||||
} else {
|
||||
setBackground(list.getBackground());
|
||||
setForeground(list.getForeground());
|
||||
}
|
||||
}
|
||||
|
||||
setFont(list.getFont());
|
||||
|
||||
if (value instanceof Icon) {
|
||||
setIcon((Icon)value);
|
||||
} else {
|
||||
setText((value == null) ? " " : value.toString());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Insets getInsets(Insets insets) {
|
||||
if (insets == null) insets = new Insets(0, 0, 0, 0);
|
||||
insets.top = 1;
|
||||
insets.bottom = 1;
|
||||
insets.right = 5;
|
||||
insets.left = (fInList && !fEditable ? 16 + 7 : 5);
|
||||
return insets;
|
||||
}
|
||||
|
||||
protected void setDrawCheckedItem(final boolean drawCheckedItem) {
|
||||
this.fDrawCheckedItem = drawCheckedItem;
|
||||
}
|
||||
|
||||
// Paint this component, and a checkbox if it's the selected item and not in the button
|
||||
protected void paintComponent(final Graphics g) {
|
||||
if (fInList) {
|
||||
if (fSelected && !fEditable) {
|
||||
AquaMenuPainter.instance().paintSelectedMenuItemBackground(g, getWidth(), getHeight());
|
||||
} else {
|
||||
g.setColor(getBackground());
|
||||
g.fillRect(0, 0, getWidth(), getHeight());
|
||||
}
|
||||
|
||||
if (fChecked && !fEditable && fDrawCheckedItem) {
|
||||
final int y = getHeight() - 4;
|
||||
g.setColor(getForeground());
|
||||
SwingUtilities2.drawString(fComboBox, g, "\u2713", 6, y);
|
||||
}
|
||||
}
|
||||
super.paintComponent(g);
|
||||
}
|
||||
}
|
||||
@ -281,12 +281,16 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
|
||||
actionMap.put("aquaSelectPageUp", highlightPageUpAction);
|
||||
actionMap.put("aquaSelectPageDown", highlightPageDownAction);
|
||||
|
||||
actionMap.put("aquaHidePopup", hideAction);
|
||||
|
||||
SwingUtilities.replaceUIActionMap(comboBox, actionMap);
|
||||
}
|
||||
|
||||
abstract class ComboBoxAction extends AbstractAction {
|
||||
private abstract class ComboBoxAction extends AbstractAction {
|
||||
public void actionPerformed(final ActionEvent e) {
|
||||
if (!comboBox.isEnabled() || !comboBox.isShowing()) return;
|
||||
if (!comboBox.isEnabled() || !comboBox.isShowing()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (comboBox.isPopupVisible()) {
|
||||
final AquaComboBoxUI ui = (AquaComboBoxUI)comboBox.getUI();
|
||||
@ -302,7 +306,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
|
||||
/**
|
||||
* Hilight _but do not select_ the next item in the list.
|
||||
*/
|
||||
Action highlightNextAction = new ComboBoxAction() {
|
||||
private Action highlightNextAction = new ComboBoxAction() {
|
||||
@Override
|
||||
public void performComboBoxAction(AquaComboBoxUI ui) {
|
||||
final int si = listBox.getSelectedIndex();
|
||||
@ -318,7 +322,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
|
||||
/**
|
||||
* Hilight _but do not select_ the previous item in the list.
|
||||
*/
|
||||
Action highlightPreviousAction = new ComboBoxAction() {
|
||||
private Action highlightPreviousAction = new ComboBoxAction() {
|
||||
@Override
|
||||
void performComboBoxAction(final AquaComboBoxUI ui) {
|
||||
final int si = listBox.getSelectedIndex();
|
||||
@ -330,7 +334,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
|
||||
}
|
||||
};
|
||||
|
||||
Action highlightFirstAction = new ComboBoxAction() {
|
||||
private Action highlightFirstAction = new ComboBoxAction() {
|
||||
@Override
|
||||
void performComboBoxAction(final AquaComboBoxUI ui) {
|
||||
listBox.setSelectedIndex(0);
|
||||
@ -338,7 +342,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
|
||||
}
|
||||
};
|
||||
|
||||
Action highlightLastAction = new ComboBoxAction() {
|
||||
private Action highlightLastAction = new ComboBoxAction() {
|
||||
@Override
|
||||
void performComboBoxAction(final AquaComboBoxUI ui) {
|
||||
final int size = listBox.getModel().getSize();
|
||||
@ -347,7 +351,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
|
||||
}
|
||||
};
|
||||
|
||||
Action highlightPageUpAction = new ComboBoxAction() {
|
||||
private Action highlightPageUpAction = new ComboBoxAction() {
|
||||
@Override
|
||||
void performComboBoxAction(final AquaComboBoxUI ui) {
|
||||
final int current = listBox.getSelectedIndex();
|
||||
@ -367,7 +371,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
|
||||
}
|
||||
};
|
||||
|
||||
Action highlightPageDownAction = new ComboBoxAction() {
|
||||
private Action highlightPageDownAction = new ComboBoxAction() {
|
||||
@Override
|
||||
void performComboBoxAction(final AquaComboBoxUI ui) {
|
||||
final int current = listBox.getSelectedIndex();
|
||||
@ -482,13 +486,13 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
|
||||
|
||||
// This is somewhat messy. The difference here from BasicComboBoxUI.EnterAction is that
|
||||
// arrow up or down does not automatically select the
|
||||
static final Action triggerSelectionAction = new AbstractAction() {
|
||||
private static final Action triggerSelectionAction = new AbstractAction() {
|
||||
public void actionPerformed(final ActionEvent e) {
|
||||
triggerSelectionEvent((JComboBox)e.getSource(), e);
|
||||
}
|
||||
};
|
||||
|
||||
static final Action toggleSelectionAction = new AbstractAction() {
|
||||
private static final Action toggleSelectionAction = new AbstractAction() {
|
||||
public void actionPerformed(final ActionEvent e) {
|
||||
final JComboBox comboBox = (JComboBox)e.getSource();
|
||||
if (!comboBox.isEnabled()) return;
|
||||
@ -506,6 +510,18 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
|
||||
}
|
||||
};
|
||||
|
||||
private static Action hideAction = new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(final ActionEvent e) {
|
||||
final JComboBox comboBox = (JComboBox)e.getSource();
|
||||
|
||||
if (comboBox.isPopupVisible()) {
|
||||
comboBox.firePopupMenuCanceled();
|
||||
comboBox.setPopupVisible(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public void applySizeFor(final JComponent c, final Size size) {
|
||||
if (arrowButton == null) return;
|
||||
final Border border = arrowButton.getBorder();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -209,7 +209,7 @@ public class AquaKeyBindings {
|
||||
|
||||
LateBoundInputMap getComboBoxInputMap() {
|
||||
return new LateBoundInputMap(new SimpleBinding(new String[] {
|
||||
"ESCAPE", "hidePopup",
|
||||
"ESCAPE", "aquaHidePopup",
|
||||
"PAGE_UP", "aquaSelectPageUp",
|
||||
"PAGE_DOWN", "aquaSelectPageDown",
|
||||
"HOME", "aquaSelectHome",
|
||||
|
||||
@ -73,8 +73,9 @@ public class AquaMenuBarUI extends BasicMenuBarUI implements ScreenMenuBarProvid
|
||||
|
||||
public Dimension getPreferredSize(final JComponent c) {
|
||||
if (isScreenMenuBar((JMenuBar)c)) {
|
||||
if (setScreenMenuBar((JFrame)(c.getTopLevelAncestor()))) ;
|
||||
return new Dimension(0, 0);
|
||||
if (setScreenMenuBar((JFrame)(c.getTopLevelAncestor()))) {
|
||||
return new Dimension(0, 0);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -181,6 +181,9 @@ public final class CGraphicsEnvironment extends SunGraphicsEnvironment {
|
||||
initDevices();
|
||||
|
||||
d = devices.get(mainDisplayID);
|
||||
if (d == null) {
|
||||
throw new AWTError("no screen devices");
|
||||
}
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
@ -385,11 +385,6 @@ public abstract class LWComponentPeer<T extends Component, D extends JComponent>
|
||||
|
||||
// ---- PEER METHODS ---- //
|
||||
|
||||
@Override
|
||||
public Toolkit getToolkit() {
|
||||
return LWToolkit.getLWToolkit();
|
||||
}
|
||||
|
||||
// Just a helper method
|
||||
public LWToolkit getLWToolkit() {
|
||||
return LWToolkit.getLWToolkit();
|
||||
@ -1010,13 +1005,13 @@ public abstract class LWComponentPeer<T extends Component, D extends JComponent>
|
||||
@Override
|
||||
public boolean prepareImage(Image img, int w, int h, ImageObserver o) {
|
||||
// TODO: is it a right/complete implementation?
|
||||
return getToolkit().prepareImage(img, w, h, o);
|
||||
return Toolkit.getDefaultToolkit().prepareImage(img, w, h, o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int checkImage(Image img, int w, int h, ImageObserver o) {
|
||||
// TODO: is it a right/complete implementation?
|
||||
return getToolkit().checkImage(img, w, h, o);
|
||||
return Toolkit.getDefaultToolkit().checkImage(img, w, h, o);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -71,13 +71,14 @@ abstract class LWTextComponentPeer<T extends TextComponent, D extends JComponent
|
||||
}
|
||||
setEditable(getTarget().isEditable());
|
||||
setText(getTarget().getText());
|
||||
setCaretPosition(getTarget().getCaretPosition());
|
||||
getTarget().addInputMethodListener(this);
|
||||
final int start = getTarget().getSelectionStart();
|
||||
final int end = getTarget().getSelectionEnd();
|
||||
if (end > start) {
|
||||
// Should be called after setText() and setCaretPosition()
|
||||
select(start, end);
|
||||
}
|
||||
setCaretPosition(getTarget().getCaretPosition());
|
||||
firstChangeSkipped = true;
|
||||
}
|
||||
|
||||
@ -122,7 +123,7 @@ abstract class LWTextComponentPeer<T extends TextComponent, D extends JComponent
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void setText(final String l) {
|
||||
public final void setText(final String text) {
|
||||
synchronized (getDelegateLock()) {
|
||||
// JTextArea.setText() posts two different events (remove & insert).
|
||||
// Since we make no differences between text events,
|
||||
@ -130,7 +131,7 @@ abstract class LWTextComponentPeer<T extends TextComponent, D extends JComponent
|
||||
// JTextArea.setText() is called.
|
||||
final Document document = getTextComponent().getDocument();
|
||||
document.removeDocumentListener(this);
|
||||
getTextComponent().setText(l);
|
||||
getTextComponent().setText(text);
|
||||
revalidate();
|
||||
if (firstChangeSkipped) {
|
||||
postEvent(new TextEvent(getTarget(),
|
||||
|
||||
@ -317,9 +317,25 @@ public class LWWindowPeer
|
||||
op |= SET_SIZE;
|
||||
}
|
||||
|
||||
// Don't post ComponentMoved/Resized and Paint events
|
||||
// until we've got a notification from the delegate
|
||||
Rectangle cb = constrainBounds(x, y, w, h);
|
||||
setBounds(cb.x, cb.y, cb.width, cb.height, op, false, false);
|
||||
// Get updated bounds, so we don't have to handle 'op' here manually
|
||||
Rectangle r = getBounds();
|
||||
platformWindow.setBounds(r.x, r.y, r.width, r.height);
|
||||
}
|
||||
|
||||
public Rectangle constrainBounds(Rectangle bounds) {
|
||||
return constrainBounds(bounds.x, bounds.y, bounds.width, bounds.height);
|
||||
}
|
||||
|
||||
public Rectangle constrainBounds(int x, int y, int w, int h) {
|
||||
|
||||
if (w < MINIMUM_WIDTH) {
|
||||
w = MINIMUM_WIDTH;
|
||||
}
|
||||
|
||||
if (h < MINIMUM_HEIGHT) {
|
||||
h = MINIMUM_HEIGHT;
|
||||
}
|
||||
@ -334,12 +350,7 @@ public class LWWindowPeer
|
||||
h = maxH;
|
||||
}
|
||||
|
||||
// Don't post ComponentMoved/Resized and Paint events
|
||||
// until we've got a notification from the delegate
|
||||
setBounds(x, y, w, h, op, false, false);
|
||||
// Get updated bounds, so we don't have to handle 'op' here manually
|
||||
Rectangle r = getBounds();
|
||||
platformWindow.setBounds(r.x, r.y, r.width, r.height);
|
||||
return new Rectangle(x, y, w, h);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -393,8 +404,12 @@ public class LWWindowPeer
|
||||
@Override
|
||||
public void setModalBlocked(Dialog blocker, boolean blocked) {
|
||||
synchronized (getPeerTreeLock()) {
|
||||
this.blocker = !blocked ? null :
|
||||
(LWWindowPeer) AWTAccessor.getComponentAccessor().getPeer(blocker);
|
||||
ComponentPeer peer = AWTAccessor.getComponentAccessor().getPeer(blocker);
|
||||
if (blocked && (peer instanceof LWWindowPeer)) {
|
||||
this.blocker = (LWWindowPeer) peer;
|
||||
} else {
|
||||
this.blocker = null;
|
||||
}
|
||||
}
|
||||
|
||||
platformWindow.setModalBlocked(blocked);
|
||||
@ -1146,8 +1161,11 @@ public class LWWindowPeer
|
||||
return false;
|
||||
}
|
||||
|
||||
Window currentActive = KeyboardFocusManager.
|
||||
getCurrentKeyboardFocusManager().getActiveWindow();
|
||||
AppContext targetAppContext = AWTAccessor.getComponentAccessor().getAppContext(getTarget());
|
||||
KeyboardFocusManager kfm = AWTAccessor.getKeyboardFocusManagerAccessor()
|
||||
.getCurrentKeyboardFocusManager(targetAppContext);
|
||||
Window currentActive = kfm.getActiveWindow();
|
||||
|
||||
|
||||
Window opposite = LWKeyboardFocusManagerPeer.getInstance().
|
||||
getCurrentFocusedWindow();
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
package sun.lwawt.macosx;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.dnd.DropTarget;
|
||||
|
||||
import sun.awt.dnd.SunDropTargetContextPeer;
|
||||
import sun.awt.dnd.SunDropTargetEvent;
|
||||
@ -38,7 +39,7 @@ final class CDropTargetContextPeer extends SunDropTargetContextPeer {
|
||||
private long fNativeDropTransfer = 0;
|
||||
private long fNativeDataAvailable = 0;
|
||||
private Object fNativeData = null;
|
||||
private boolean insideTarget = true;
|
||||
private DropTarget insideTarget = null;
|
||||
|
||||
Object awtLockAccess = new Object();
|
||||
|
||||
@ -88,26 +89,19 @@ final class CDropTargetContextPeer extends SunDropTargetContextPeer {
|
||||
return fNativeData;
|
||||
}
|
||||
|
||||
// We need to take care of dragExit message because for some reason it is not being
|
||||
// generated for lightweight components
|
||||
// We need to take care of dragEnter and dragExit messages because
|
||||
// native system generates them only for heavyweights
|
||||
@Override
|
||||
protected void processMotionMessage(SunDropTargetEvent event, boolean operationChanged) {
|
||||
Component eventSource = (Component)event.getComponent();
|
||||
Point screenPoint = event.getPoint();
|
||||
SwingUtilities.convertPointToScreen(screenPoint, eventSource);
|
||||
Rectangle screenBounds = new Rectangle(eventSource.getLocationOnScreen().x,
|
||||
eventSource.getLocationOnScreen().y,
|
||||
eventSource.getWidth(), eventSource.getHeight());
|
||||
if(insideTarget) {
|
||||
if(!screenBounds.contains(screenPoint)) {
|
||||
boolean eventInsideTarget = isEventInsideTarget(event);
|
||||
if (event.getComponent().getDropTarget() == insideTarget) {
|
||||
if (!eventInsideTarget) {
|
||||
processExitMessage(event);
|
||||
insideTarget = false;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if(screenBounds.contains(screenPoint)) {
|
||||
if (eventInsideTarget) {
|
||||
processEnterMessage(event);
|
||||
insideTarget = true;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
@ -115,17 +109,52 @@ final class CDropTargetContextPeer extends SunDropTargetContextPeer {
|
||||
super.processMotionMessage(event, operationChanged);
|
||||
}
|
||||
|
||||
/**
|
||||
* Could be called when DnD enters a heavyweight or synthesized in processMotionMessage
|
||||
*/
|
||||
@Override
|
||||
protected void processEnterMessage(SunDropTargetEvent event) {
|
||||
Component c = event.getComponent();
|
||||
DropTarget dt = event.getComponent().getDropTarget();
|
||||
if (isEventInsideTarget(event)
|
||||
&& dt != insideTarget
|
||||
&& c.isShowing()
|
||||
&& dt != null
|
||||
&& dt.isActive()) {
|
||||
insideTarget = dt;
|
||||
super.processEnterMessage(event);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Could be called when DnD exits a heavyweight or synthesized in processMotionMessage
|
||||
*/
|
||||
@Override
|
||||
protected void processExitMessage(SunDropTargetEvent event) {
|
||||
if (event.getComponent().getDropTarget() == insideTarget) {
|
||||
insideTarget = null;
|
||||
super.processExitMessage(event);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void processDropMessage(SunDropTargetEvent event) {
|
||||
Component eventSource = (Component)event.getComponent();
|
||||
if (isEventInsideTarget(event)) {
|
||||
super.processDropMessage(event);
|
||||
insideTarget = null;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isEventInsideTarget(SunDropTargetEvent event) {
|
||||
Component eventSource = event.getComponent();
|
||||
Point screenPoint = event.getPoint();
|
||||
SwingUtilities.convertPointToScreen(screenPoint, eventSource);
|
||||
Rectangle screenBounds = new Rectangle(eventSource.getLocationOnScreen().x,
|
||||
eventSource.getLocationOnScreen().y,
|
||||
eventSource.getWidth(), eventSource.getHeight());
|
||||
if(screenBounds.contains(screenPoint)) {
|
||||
super.processDropMessage(event);
|
||||
}
|
||||
Point locationOnScreen = eventSource.getLocationOnScreen();
|
||||
Rectangle screenBounds = new Rectangle(locationOnScreen.x,
|
||||
locationOnScreen.y,
|
||||
eventSource.getWidth(),
|
||||
eventSource.getHeight());
|
||||
return screenBounds.contains(screenPoint);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -326,11 +326,6 @@ class CFileDialog implements FileDialogPeer {
|
||||
return getMinimumSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Toolkit getToolkit() {
|
||||
return Toolkit.getDefaultToolkit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleEvent(AWTEvent e) {
|
||||
}
|
||||
|
||||
@ -210,7 +210,6 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
|
||||
private boolean undecorated; // initialized in getInitialStyleBits()
|
||||
private Rectangle normalBounds = null; // not-null only for undecorated maximized windows
|
||||
private CPlatformResponder responder;
|
||||
private volatile boolean zoomed = false; // from native perspective
|
||||
|
||||
public CPlatformWindow() {
|
||||
super(0, true);
|
||||
@ -231,7 +230,9 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
|
||||
contentView.initialize(peer, responder);
|
||||
|
||||
final long ownerPtr = owner != null ? owner.getNSWindowPtr() : 0L;
|
||||
final long nativeWindowPtr = nativeCreateNSWindow(contentView.getAWTView(), ownerPtr, styleBits, 0, 0, 0, 0);
|
||||
Rectangle bounds = _peer.constrainBounds(_target.getBounds());
|
||||
final long nativeWindowPtr = nativeCreateNSWindow(contentView.getAWTView(),
|
||||
ownerPtr, styleBits, bounds.x, bounds.y, bounds.width, bounds.height);
|
||||
setPtr(nativeWindowPtr);
|
||||
|
||||
if (target instanceof javax.swing.RootPaneContainer) {
|
||||
@ -466,7 +467,8 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
|
||||
}
|
||||
|
||||
private boolean isMaximized() {
|
||||
return undecorated ? this.normalBounds != null : zoomed;
|
||||
return undecorated ? this.normalBounds != null
|
||||
: CWrapper.NSWindow.isZoomed(getNSWindowPtr());
|
||||
}
|
||||
|
||||
private void maximize() {
|
||||
@ -474,7 +476,6 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
|
||||
return;
|
||||
}
|
||||
if (!undecorated) {
|
||||
zoomed = true;
|
||||
CWrapper.NSWindow.zoom(getNSWindowPtr());
|
||||
} else {
|
||||
deliverZoom(true);
|
||||
@ -496,7 +497,6 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
|
||||
return;
|
||||
}
|
||||
if (!undecorated) {
|
||||
zoomed = false;
|
||||
CWrapper.NSWindow.zoom(getNSWindowPtr());
|
||||
} else {
|
||||
deliverZoom(false);
|
||||
|
||||
@ -68,6 +68,7 @@ public final class CWrapper {
|
||||
|
||||
public static native void miniaturize(long window);
|
||||
public static native void deminiaturize(long window);
|
||||
public static native boolean isZoomed(long window);
|
||||
public static native void zoom(long window);
|
||||
|
||||
public static native void makeFirstResponder(long window, long responder);
|
||||
|
||||
@ -76,5 +76,6 @@ FILE_NAME=application/x-java-file-list;class=java.util.List
|
||||
text/uri-list=application/x-java-file-list;class=java.util.List
|
||||
PNG=image/x-java-image;class=java.awt.Image
|
||||
JFIF=image/x-java-image;class=java.awt.Image
|
||||
TIFF=image/x-java-image;class=java.awt.Image
|
||||
RICH_TEXT=text/rtf
|
||||
HTML=text/html;charset=utf-8;eoln="\r\n";terminators=1
|
||||
|
||||
@ -366,7 +366,7 @@ AWT_ASSERT_APPKIT_THREAD;
|
||||
|
||||
- (BOOL) canBecomeMainWindow {
|
||||
AWT_ASSERT_APPKIT_THREAD;
|
||||
if(!self.isEnabled){
|
||||
if (!self.isEnabled) {
|
||||
// Native system can bring up the NSWindow to
|
||||
// the top even if the window is not main.
|
||||
// We should bring up the modal dialog manually
|
||||
@ -377,7 +377,7 @@ AWT_ASSERT_APPKIT_THREAD;
|
||||
if (platformWindow != NULL) {
|
||||
static JNF_MEMBER_CACHE(jm_checkBlockingAndOrder, jc_CPlatformWindow,
|
||||
"checkBlockingAndOrder", "()Z");
|
||||
JNFCallVoidMethod(env, platformWindow, jm_checkBlockingAndOrder);
|
||||
JNFCallBooleanMethod(env, platformWindow, jm_checkBlockingAndOrder);
|
||||
(*env)->DeleteLocalRef(env, platformWindow);
|
||||
}
|
||||
}
|
||||
|
||||
@ -477,6 +477,8 @@ extern JNFClassInfo jc_CDropTargetContextPeer;
|
||||
sDraggingExited = FALSE;
|
||||
sDraggingLocation = [sender draggingLocation];
|
||||
NSPoint javaLocation = [fView convertPoint:sDraggingLocation fromView:nil];
|
||||
javaLocation.y = fView.window.frame.size.height - javaLocation.y;
|
||||
|
||||
DLog5(@"+ dragEnter: loc native %f, %f, java %f, %f\n", sDraggingLocation.x, sDraggingLocation.y, javaLocation.x, javaLocation.y);
|
||||
|
||||
////////// BEGIN Calculate the current drag actions //////////
|
||||
@ -570,8 +572,7 @@ extern JNFClassInfo jc_CDropTargetContextPeer;
|
||||
// Should we notify Java things have changed?
|
||||
if (sDraggingError == FALSE && notifyJava) {
|
||||
NSPoint javaLocation = [fView convertPoint:sDraggingLocation fromView:nil];
|
||||
// For some reason even after the convertPoint drag events come with the y coordinate reverted
|
||||
javaLocation.y = fView.window.frame.size.height - javaLocation.y;
|
||||
javaLocation.y = fView.window.frame.size.height - javaLocation.y;
|
||||
//DLog5(@" : dragMoved: loc native %f, %f, java %f, %f\n", sDraggingLocation.x, sDraggingLocation.y, javaLocation.x, javaLocation.y);
|
||||
|
||||
jlongArray formats = sDraggingFormats;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -93,6 +93,14 @@ canChooseDirectories:(BOOL)inChooseDirectories
|
||||
- (void)safeSaveOrLoad {
|
||||
NSSavePanel *thePanel = nil;
|
||||
|
||||
/*
|
||||
* 8013553: turns off extension hiding for the native file dialog.
|
||||
* This way is used because setExtensionHidden(NO) doesn't work
|
||||
* as expected.
|
||||
*/
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
[defaults setBool:NO forKey:@"NSNavLastUserSetHideExtensionButtonState"];
|
||||
|
||||
if (fMode == java_awt_FileDialog_SAVE) {
|
||||
thePanel = [NSSavePanel savePanel];
|
||||
[thePanel setAllowsOtherFileTypes:YES];
|
||||
@ -110,7 +118,7 @@ canChooseDirectories:(BOOL)inChooseDirectories
|
||||
if (fMode == java_awt_FileDialog_LOAD) {
|
||||
NSOpenPanel *openPanel = (NSOpenPanel *)thePanel;
|
||||
[openPanel setAllowsMultipleSelection:fMultipleMode];
|
||||
[openPanel setCanChooseFiles:YES];
|
||||
[openPanel setCanChooseFiles:!fChooseDirectories];
|
||||
[openPanel setCanChooseDirectories:fChooseDirectories];
|
||||
[openPanel setCanCreateDirectories:YES];
|
||||
}
|
||||
|
||||
@ -435,6 +435,29 @@ JNF_COCOA_ENTER(env);
|
||||
JNF_COCOA_EXIT(env);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: sun_lwawt_macosx_CWrapper$NSWindow
|
||||
* Method: isZoomed
|
||||
* Signature: (J)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_sun_lwawt_macosx_CWrapper_00024NSWindow_isZoomed
|
||||
(JNIEnv *env, jclass cls, jlong windowPtr)
|
||||
{
|
||||
__block jboolean isZoomed = JNI_FALSE;
|
||||
|
||||
JNF_COCOA_ENTER(env);
|
||||
|
||||
NSWindow *window = (NSWindow *)jlong_to_ptr(windowPtr);
|
||||
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){
|
||||
isZoomed = [window isZoomed];
|
||||
}];
|
||||
|
||||
JNF_COCOA_EXIT(env);
|
||||
|
||||
return isZoomed;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: sun_lwawt_macosx_CWrapper$NSWindow
|
||||
* Method: zoom
|
||||
|
||||
@ -227,7 +227,7 @@ static void AWT_NSUncaughtExceptionHandler(NSException *exception) {
|
||||
id jrsAppKitAWTClass = objc_getClass("JRSAppKitAWT");
|
||||
SEL markAppSel = @selector(markAppIsDaemon);
|
||||
if (![jrsAppKitAWTClass respondsToSelector:markAppSel]) return NO;
|
||||
return (BOOL)[jrsAppKitAWTClass performSelector:markAppSel];
|
||||
return [jrsAppKitAWTClass performSelector:markAppSel] ? YES : NO;
|
||||
}
|
||||
|
||||
+ (void)appKitIsRunning:(id)arg {
|
||||
@ -337,6 +337,8 @@ AWT_ASSERT_APPKIT_THREAD;
|
||||
|
||||
// Headless mode trumps either ordinary AWT or SWT-in-AWT mode. Declare us a daemon and return.
|
||||
if (headless) {
|
||||
// Note that we don't install run loop observers in headless mode
|
||||
// because we don't need them (see 7174704)
|
||||
if (!forceEmbeddedMode) {
|
||||
setUpAppKitThreadName();
|
||||
}
|
||||
|
||||
@ -104,7 +104,7 @@ public final class SunJCE extends Provider {
|
||||
|
||||
public SunJCE() {
|
||||
/* We are the "SunJCE" provider */
|
||||
super("SunJCE", 1.7d, info);
|
||||
super("SunJCE", 1.8d, info);
|
||||
|
||||
final String BLOCK_MODES = "ECB|CBC|PCBC|CTR|CTS|CFB|OFB" +
|
||||
"|CFB8|CFB16|CFB24|CFB32|CFB40|CFB48|CFB56|CFB64" +
|
||||
|
||||
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.imageio.plugins.bmp;
|
||||
|
||||
public class BMPCompressionTypes {
|
||||
|
||||
private static final String[] compressionTypeNames =
|
||||
{"BI_RGB", "BI_RLE8", "BI_RLE4", "BI_BITFIELDS", "BI_JPEG", "BI_PNG"};
|
||||
|
||||
static int getType(String typeString) {
|
||||
for (int i = 0; i < compressionTypeNames.length; i++)
|
||||
if (compressionTypeNames[i].equals(typeString))
|
||||
return i;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static String getName(int type) {
|
||||
return compressionTypeNames[type];
|
||||
}
|
||||
|
||||
public static String[] getCompressionTypes() {
|
||||
return compressionTypeNames.clone();
|
||||
}
|
||||
}
|
||||
@ -47,7 +47,4 @@ public interface BMPConstants {
|
||||
static final int BI_BITFIELDS = 3;
|
||||
static final int BI_JPEG = 4;
|
||||
static final int BI_PNG = 5;
|
||||
|
||||
static final String[] compressionTypeNames =
|
||||
{"BI_RGB", "BI_RLE8", "BI_RLE4", "BI_BITFIELDS", "BI_JPEG", "BI_PNG"};
|
||||
}
|
||||
|
||||
@ -25,7 +25,6 @@
|
||||
|
||||
package com.sun.imageio.plugins.bmp;
|
||||
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.image.ColorModel;
|
||||
import java.awt.image.ComponentSampleModel;
|
||||
@ -42,7 +41,6 @@ import java.awt.image.Raster;
|
||||
import java.awt.image.RenderedImage;
|
||||
import java.awt.image.SampleModel;
|
||||
import java.awt.image.SinglePixelPackedSampleModel;
|
||||
import java.awt.image.WritableRaster;
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -51,22 +49,16 @@ import java.nio.ByteOrder;
|
||||
import java.util.Iterator;
|
||||
|
||||
import javax.imageio.IIOImage;
|
||||
import javax.imageio.IIOException;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.imageio.ImageTypeSpecifier;
|
||||
import javax.imageio.ImageWriteParam;
|
||||
import javax.imageio.ImageWriter;
|
||||
import javax.imageio.metadata.IIOMetadata;
|
||||
import javax.imageio.metadata.IIOMetadataNode;
|
||||
import javax.imageio.metadata.IIOMetadataFormatImpl;
|
||||
import javax.imageio.metadata.IIOInvalidTreeException;
|
||||
import javax.imageio.spi.ImageWriterSpi;
|
||||
import javax.imageio.stream.ImageOutputStream;
|
||||
import javax.imageio.event.IIOWriteProgressListener;
|
||||
import javax.imageio.event.IIOWriteWarningListener;
|
||||
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import javax.imageio.plugins.bmp.BMPImageWriteParam;
|
||||
import com.sun.imageio.plugins.common.ImageUtil;
|
||||
@ -129,7 +121,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
|
||||
meta.compression = getPreferredCompressionType(imageType);
|
||||
if (param != null
|
||||
&& param.getCompressionMode() == ImageWriteParam.MODE_EXPLICIT) {
|
||||
meta.compression = getCompressionType(param.getCompressionType());
|
||||
meta.compression = BMPCompressionTypes.getType(param.getCompressionType());
|
||||
}
|
||||
meta.bitsPerPixel = (short)imageType.getColorModel().getPixelSize();
|
||||
return meta;
|
||||
@ -308,7 +300,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
|
||||
|
||||
switch(bmpParam.getCompressionMode()) {
|
||||
case ImageWriteParam.MODE_EXPLICIT:
|
||||
compressionType = getCompressionType(bmpParam.getCompressionType());
|
||||
compressionType = BMPCompressionTypes.getType(bmpParam.getCompressionType());
|
||||
break;
|
||||
case ImageWriteParam.MODE_COPY_FROM_METADATA:
|
||||
compressionType = bmpImageMetadata.compression;
|
||||
@ -323,12 +315,12 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
|
||||
|
||||
if (!canEncodeImage(compressionType, colorModel, sampleModel)) {
|
||||
throw new IOException("Image can not be encoded with compression type "
|
||||
+ compressionTypeNames[compressionType]);
|
||||
+ BMPCompressionTypes.getName(compressionType));
|
||||
}
|
||||
|
||||
byte r[] = null, g[] = null, b[] = null, a[] = null;
|
||||
|
||||
if (compressionType == BMPConstants.BI_BITFIELDS) {
|
||||
if (compressionType == BI_BITFIELDS) {
|
||||
bitsPerPixel =
|
||||
DataBuffer.getDataTypeSize(sampleModel.getDataType());
|
||||
|
||||
@ -372,7 +364,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
|
||||
// an exception related to unsupported image format
|
||||
throw new IOException("Image can not be encoded with " +
|
||||
"compression type " +
|
||||
compressionTypeNames[compressionType]);
|
||||
BMPCompressionTypes.getName(compressionType));
|
||||
}
|
||||
}
|
||||
writeMaskToPalette(rmask, 0, r, g, b, a);
|
||||
@ -511,8 +503,8 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
|
||||
* Images with any other compression type must be wrote in the
|
||||
* bottom-up layout.
|
||||
*/
|
||||
if (compressionType == BMPConstants.BI_RGB ||
|
||||
compressionType == BMPConstants.BI_BITFIELDS)
|
||||
if (compressionType == BI_RGB ||
|
||||
compressionType == BI_BITFIELDS)
|
||||
{
|
||||
isTopDown = bmpParam.isTopDown();
|
||||
} else {
|
||||
@ -543,7 +535,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
|
||||
if (isPalette == true) {
|
||||
|
||||
// write palette
|
||||
if (compressionType == BMPConstants.BI_BITFIELDS) {
|
||||
if (compressionType == BI_BITFIELDS) {
|
||||
// write masks for red, green and blue components.
|
||||
for (int i=0; i<3; i++) {
|
||||
int mask = (a[i]&0xFF) + ((r[i]&0xFF)*0x100) + ((g[i]&0xFF)*0x10000) + ((b[i]&0xFF)*0x1000000);
|
||||
@ -571,8 +563,8 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
|
||||
|
||||
int l;
|
||||
|
||||
if (compressionType == BMPConstants.BI_JPEG ||
|
||||
compressionType == BMPConstants.BI_PNG) {
|
||||
if (compressionType == BI_JPEG ||
|
||||
compressionType == BI_PNG) {
|
||||
|
||||
// prepare embedded buffer
|
||||
embedded_stream = new ByteArrayOutputStream();
|
||||
@ -657,7 +649,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
|
||||
pos = sppsm.getOffset(startX, startY);
|
||||
}
|
||||
|
||||
if (compressionType == BMPConstants.BI_RGB || compressionType == BMPConstants.BI_BITFIELDS){
|
||||
if (compressionType == BI_RGB || compressionType == BI_BITFIELDS){
|
||||
switch(dataType) {
|
||||
case DataBuffer.TYPE_BYTE:
|
||||
byte[] bdata =
|
||||
@ -687,7 +679,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
|
||||
for(int k=0; k<padding; k++) {
|
||||
stream.writeByte(0);
|
||||
}
|
||||
} else if (compressionType == BMPConstants.BI_RLE4) {
|
||||
} else if (compressionType == BI_RLE4) {
|
||||
if (bpixels == null || bpixels.length < scanlineBytes)
|
||||
bpixels = new byte[scanlineBytes];
|
||||
src.getPixels(srcRect.x, srcRect.y,
|
||||
@ -696,7 +688,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
|
||||
bpixels[h] = (byte)pixels[h];
|
||||
}
|
||||
encodeRLE4(bpixels, scanlineBytes);
|
||||
} else if (compressionType == BMPConstants.BI_RLE8) {
|
||||
} else if (compressionType == BI_RLE8) {
|
||||
//byte[] bdata =
|
||||
// ((DataBufferByte)src.getDataBuffer()).getData();
|
||||
//System.out.println("bdata.length="+bdata.length);
|
||||
@ -734,8 +726,8 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
|
||||
processImageProgress(100.0f * (((float)i) / ((float)h)));
|
||||
}
|
||||
|
||||
if (compressionType == BMPConstants.BI_RLE4 ||
|
||||
compressionType == BMPConstants.BI_RLE8) {
|
||||
if (compressionType == BI_RLE4 ||
|
||||
compressionType == BI_RLE8) {
|
||||
// Write the RLE EOF marker and
|
||||
stream.writeByte(0);
|
||||
stream.writeByte(1);
|
||||
@ -793,7 +785,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
|
||||
break;
|
||||
|
||||
case 4:
|
||||
if (compressionType == BMPConstants.BI_RLE4){
|
||||
if (compressionType == BI_RLE4){
|
||||
byte[] bipixels = new byte[scanlineBytes];
|
||||
for (int h=0; h<scanlineBytes; h++) {
|
||||
bipixels[h] = (byte)pixels[l++];
|
||||
@ -814,7 +806,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
|
||||
break;
|
||||
|
||||
case 8:
|
||||
if(compressionType == BMPConstants.BI_RLE8) {
|
||||
if(compressionType == BI_RLE8) {
|
||||
for (int h=0; h<scanlineBytes; h++) {
|
||||
bpixels[h] = (byte)pixels[l++];
|
||||
}
|
||||
@ -841,7 +833,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
|
||||
*/
|
||||
for (int j = 0, m = 0; j < scanlineBytes; m++) {
|
||||
spixels[m] = 0;
|
||||
if (compressionType == BMPConstants.BI_RGB) {
|
||||
if (compressionType == BI_RGB) {
|
||||
/*
|
||||
* please note that despite other cases,
|
||||
* the 16bpp BI_RGB requires the RGB data order
|
||||
@ -910,7 +902,7 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
|
||||
*/
|
||||
for (int j = 0, m = 0; j < scanlineBytes; m++) {
|
||||
ipixels[m] = 0;
|
||||
if (compressionType == BMPConstants.BI_RGB) {
|
||||
if (compressionType == BI_RGB) {
|
||||
ipixels[m] =
|
||||
((0xff & pixels[j + 2]) << 16) |
|
||||
((0xff & pixels[j + 1]) << 8) |
|
||||
@ -945,8 +937,8 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
|
||||
}
|
||||
|
||||
// Write out the padding
|
||||
if (compressionType == BMPConstants.BI_RGB ||
|
||||
compressionType == BMPConstants.BI_BITFIELDS)
|
||||
if (compressionType == BI_RGB ||
|
||||
compressionType == BI_BITFIELDS)
|
||||
{
|
||||
for(k=0; k<padding; k++) {
|
||||
stream.writeByte(0);
|
||||
@ -1329,17 +1321,10 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants {
|
||||
stream = null;
|
||||
}
|
||||
|
||||
private int getCompressionType(String typeString) {
|
||||
for (int i = 0; i < BMPConstants.compressionTypeNames.length; i++)
|
||||
if (BMPConstants.compressionTypeNames[i].equals(typeString))
|
||||
return i;
|
||||
return 0;
|
||||
}
|
||||
|
||||
private void writeEmbedded(IIOImage image,
|
||||
ImageWriteParam bmpParam) throws IOException {
|
||||
String format =
|
||||
compressionType == BMPConstants.BI_JPEG ? "jpeg" : "png";
|
||||
compressionType == BI_JPEG ? "jpeg" : "png";
|
||||
Iterator iterator = ImageIO.getImageWritersByFormatName(format);
|
||||
ImageWriter writer = null;
|
||||
if (iterator.hasNext())
|
||||
|
||||
@ -219,7 +219,7 @@ public class BMPMetadata extends IIOMetadata implements BMPConstants {
|
||||
|
||||
// CompressionTypeName
|
||||
IIOMetadataNode subNode = new IIOMetadataNode("CompressionTypeName");
|
||||
subNode.setAttribute("value", compressionTypeNames[compression]);
|
||||
subNode.setAttribute("value", BMPCompressionTypes.getName(compression));
|
||||
node.appendChild(subNode);
|
||||
return node;
|
||||
}
|
||||
|
||||
@ -25,11 +25,8 @@
|
||||
|
||||
package com.sun.imageio.plugins.gif;
|
||||
|
||||
import javax.imageio.ImageTypeSpecifier;
|
||||
import javax.imageio.metadata.IIOInvalidTreeException;
|
||||
import javax.imageio.metadata.IIOMetadata;
|
||||
import javax.imageio.metadata.IIOMetadataNode;
|
||||
import javax.imageio.metadata.IIOMetadataFormat;
|
||||
import javax.imageio.metadata.IIOMetadataFormatImpl;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
@ -41,7 +38,7 @@ public class GIFStreamMetadata extends GIFMetadata {
|
||||
static final String
|
||||
nativeMetadataFormatName = "javax_imageio_gif_stream_1.0";
|
||||
|
||||
public static final String[] versionStrings = { "87a", "89a" };
|
||||
static final String[] versionStrings = { "87a", "89a" };
|
||||
|
||||
public String version; // 87a or 89a
|
||||
public int logicalScreenWidth;
|
||||
@ -52,7 +49,7 @@ public class GIFStreamMetadata extends GIFMetadata {
|
||||
public int backgroundColorIndex; // Valid if globalColorTable != null
|
||||
public boolean sortFlag; // Valid if globalColorTable != null
|
||||
|
||||
public static final String[] colorTableSizes = {
|
||||
static final String[] colorTableSizes = {
|
||||
"2", "4", "8", "16", "32", "64", "128", "256"
|
||||
};
|
||||
|
||||
|
||||
@ -25,14 +25,11 @@
|
||||
|
||||
package com.sun.imageio.plugins.jpeg;
|
||||
|
||||
import javax.imageio.metadata.IIOMetadataFormatImpl;
|
||||
import javax.imageio.ImageTypeSpecifier;
|
||||
import javax.imageio.plugins.jpeg.JPEGQTable;
|
||||
import javax.imageio.plugins.jpeg.JPEGHuffmanTable;
|
||||
|
||||
import java.awt.image.ColorModel;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.DataBuffer;
|
||||
import java.awt.color.ColorSpace;
|
||||
import java.awt.color.ICC_ColorSpace;
|
||||
|
||||
@ -172,9 +169,9 @@ public class JPEG {
|
||||
public static final String vendor = "Oracle Corporation";
|
||||
public static final String version = "0.5";
|
||||
// Names of the formats we can read or write
|
||||
public static final String [] names = {"JPEG", "jpeg", "JPG", "jpg"};
|
||||
public static final String [] suffixes = {"jpg", "jpeg"};
|
||||
public static final String [] MIMETypes = {"image/jpeg"};
|
||||
static final String [] names = {"JPEG", "jpeg", "JPG", "jpg"};
|
||||
static final String [] suffixes = {"jpg", "jpeg"};
|
||||
static final String [] MIMETypes = {"image/jpeg"};
|
||||
public static final String nativeImageMetadataFormatName =
|
||||
"javax_imageio_jpeg_image_1.0";
|
||||
public static final String nativeImageMetadataFormatClassName =
|
||||
@ -201,12 +198,12 @@ public class JPEG {
|
||||
public static final int NUM_JCS_CODES = JCS_YCCK+1;
|
||||
|
||||
/** IJG can handle up to 4-channel JPEGs */
|
||||
public static final int [] [] bandOffsets = {{0},
|
||||
static final int [] [] bandOffsets = {{0},
|
||||
{0, 1},
|
||||
{0, 1, 2},
|
||||
{0, 1, 2, 3}};
|
||||
|
||||
public static final int [] bOffsRGB = { 2, 1, 0 };
|
||||
static final int [] bOffsRGB = { 2, 1, 0 };
|
||||
|
||||
/* These are kept in the inner class to avoid static initialization
|
||||
* of the CMM class until someone actually needs it.
|
||||
|
||||
@ -29,12 +29,10 @@ import java.awt.image.ColorModel;
|
||||
import java.awt.image.IndexColorModel;
|
||||
import java.awt.image.SampleModel;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.StringTokenizer;
|
||||
import javax.imageio.ImageTypeSpecifier;
|
||||
import javax.imageio.metadata.IIOInvalidTreeException;
|
||||
import javax.imageio.metadata.IIOMetadata;
|
||||
import javax.imageio.metadata.IIOMetadataFormat;
|
||||
import javax.imageio.metadata.IIOMetadataFormatImpl;
|
||||
import javax.imageio.metadata.IIOMetadataNode;
|
||||
import org.w3c.dom.Node;
|
||||
@ -49,42 +47,42 @@ public class PNGMetadata extends IIOMetadata implements Cloneable {
|
||||
= "com.sun.imageio.plugins.png.PNGMetadataFormat";
|
||||
|
||||
// Color types for IHDR chunk
|
||||
public static final String[] IHDR_colorTypeNames = {
|
||||
static final String[] IHDR_colorTypeNames = {
|
||||
"Grayscale", null, "RGB", "Palette",
|
||||
"GrayAlpha", null, "RGBAlpha"
|
||||
};
|
||||
|
||||
public static final int[] IHDR_numChannels = {
|
||||
static final int[] IHDR_numChannels = {
|
||||
1, 0, 3, 3, 2, 0, 4
|
||||
};
|
||||
|
||||
// Bit depths for IHDR chunk
|
||||
public static final String[] IHDR_bitDepths = {
|
||||
static final String[] IHDR_bitDepths = {
|
||||
"1", "2", "4", "8", "16"
|
||||
};
|
||||
|
||||
// Compression methods for IHDR chunk
|
||||
public static final String[] IHDR_compressionMethodNames = {
|
||||
static final String[] IHDR_compressionMethodNames = {
|
||||
"deflate"
|
||||
};
|
||||
|
||||
// Filter methods for IHDR chunk
|
||||
public static final String[] IHDR_filterMethodNames = {
|
||||
static final String[] IHDR_filterMethodNames = {
|
||||
"adaptive"
|
||||
};
|
||||
|
||||
// Interlace methods for IHDR chunk
|
||||
public static final String[] IHDR_interlaceMethodNames = {
|
||||
static final String[] IHDR_interlaceMethodNames = {
|
||||
"none", "adam7"
|
||||
};
|
||||
|
||||
// Compression methods for iCCP chunk
|
||||
public static final String[] iCCP_compressionMethodNames = {
|
||||
static final String[] iCCP_compressionMethodNames = {
|
||||
"deflate"
|
||||
};
|
||||
|
||||
// Compression methods for zTXt chunk
|
||||
public static final String[] zTXt_compressionMethodNames = {
|
||||
static final String[] zTXt_compressionMethodNames = {
|
||||
"deflate"
|
||||
};
|
||||
|
||||
@ -95,12 +93,12 @@ public class PNGMetadata extends IIOMetadata implements Cloneable {
|
||||
public static final int PHYS_UNIT_METER = 1;
|
||||
|
||||
// Unit specifiers for pHYs chunk
|
||||
public static final String[] unitSpecifierNames = {
|
||||
static final String[] unitSpecifierNames = {
|
||||
"unknown", "meter"
|
||||
};
|
||||
|
||||
// Rendering intents for sRGB chunk
|
||||
public static final String[] renderingIntentNames = {
|
||||
static final String[] renderingIntentNames = {
|
||||
"Perceptual", // 0
|
||||
"Relative colorimetric", // 1
|
||||
"Saturation", // 2
|
||||
@ -109,7 +107,7 @@ public class PNGMetadata extends IIOMetadata implements Cloneable {
|
||||
};
|
||||
|
||||
// Color space types for Chroma->ColorSpaceType node
|
||||
public static final String[] colorSpaceTypeNames = {
|
||||
static final String[] colorSpaceTypeNames = {
|
||||
"GRAY", null, "RGB", "RGB",
|
||||
"GRAY", null, "RGB"
|
||||
};
|
||||
|
||||
@ -85,42 +85,42 @@ public class WBMPImageReaderSpi extends ImageReaderSpi {
|
||||
ImageInputStream stream = (ImageInputStream)source;
|
||||
|
||||
stream.mark();
|
||||
int type = stream.readByte(); // TypeField
|
||||
int fixHeaderField = stream.readByte();
|
||||
// check WBMP "header"
|
||||
if (type != 0 || fixHeaderField != 0) {
|
||||
// while WBMP reader does not support ext WBMP headers
|
||||
try {
|
||||
int type = stream.readByte(); // TypeField
|
||||
int fixHeaderField = stream.readByte();
|
||||
// check WBMP "header"
|
||||
if (type != 0 || fixHeaderField != 0) {
|
||||
// while WBMP reader does not support ext WBMP headers
|
||||
return false;
|
||||
}
|
||||
|
||||
int width = ReaderUtil.readMultiByteInteger(stream);
|
||||
int height = ReaderUtil.readMultiByteInteger(stream);
|
||||
// check image dimension
|
||||
if (width <= 0 || height <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
long dataLength = stream.length();
|
||||
if (dataLength == -1) {
|
||||
// We can't verify that amount of data in the stream
|
||||
// corresponds to image dimension because we do not know
|
||||
// the length of the data stream.
|
||||
// Assuming that wbmp image are used for mobile devices,
|
||||
// let's introduce an upper limit for image dimension.
|
||||
// In case if exact amount of raster data is unknown,
|
||||
// let's reject images with dimension above the limit.
|
||||
return (width < MAX_WBMP_WIDTH) && (height < MAX_WBMP_HEIGHT);
|
||||
}
|
||||
|
||||
dataLength -= stream.getStreamPosition();
|
||||
|
||||
long scanSize = (width / 8) + ((width % 8) == 0 ? 0 : 1);
|
||||
|
||||
return (dataLength == scanSize * height);
|
||||
} finally {
|
||||
stream.reset();
|
||||
return false;
|
||||
}
|
||||
|
||||
int width = ReaderUtil.readMultiByteInteger(stream);
|
||||
int height = ReaderUtil.readMultiByteInteger(stream);
|
||||
// check image dimension
|
||||
if (width <= 0 || height <= 0) {
|
||||
stream.reset();
|
||||
return false;
|
||||
}
|
||||
|
||||
long dataLength = stream.length();
|
||||
if (dataLength == -1) {
|
||||
// We can't verify that amount of data in the stream
|
||||
// corresponds to image dimension because we do not know
|
||||
// the length of the data stream.
|
||||
// Assuming that wbmp image are used for mobile devices,
|
||||
// let's introduce an upper limit for image dimension.
|
||||
// In case if exact amount of raster data is unknown,
|
||||
// let's reject images with dimension above the limit.
|
||||
stream.reset();
|
||||
return (width < MAX_WBMP_WIDTH) && (height < MAX_WBMP_HEIGHT);
|
||||
}
|
||||
|
||||
dataLength -= stream.getStreamPosition();
|
||||
stream.reset();
|
||||
|
||||
long scanSize = (width / 8) + ((width % 8) == 0 ? 0 : 1);
|
||||
|
||||
return (dataLength == scanSize * height);
|
||||
}
|
||||
|
||||
public ImageReader createReaderInstance(Object extension)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -303,7 +303,7 @@ class Driver {
|
||||
} else {
|
||||
if (!packfile.toLowerCase().endsWith(".pack") &&
|
||||
!packfile.toLowerCase().endsWith(".pac")) {
|
||||
System.err.println(MessageFormat.format(RESOURCE.getString(DriverResource.WIRTE_PACKGZ_FILE),packfile));
|
||||
System.err.println(MessageFormat.format(RESOURCE.getString(DriverResource.WRITE_PACKGZ_FILE),packfile));
|
||||
printUsage(doPack, false, System.err);
|
||||
System.exit(2);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -22,110 +22,99 @@
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.java.util.jar.pack;
|
||||
|
||||
import java.util.ListResourceBundle;
|
||||
|
||||
public class DriverResource extends ListResourceBundle {
|
||||
public static final String VERSION ="VERSION";
|
||||
public static final String BAD_ARGUMENT ="BAD_ARGUMENT";
|
||||
public static final String BAD_OPTION ="BAD_OPTION";
|
||||
public static final String BAD_REPACK_OUTPUT="BAD_REPACK_OUTPUT";
|
||||
public static final String DETECTED_ZIP_COMMENT="DETECTED_ZIP_COMMENT";
|
||||
public static final String SKIP_FOR_REPACKED ="SKIP_FOR_REPACKED";
|
||||
public static final String WRITE_PACK_FILE ="WRITE_PACK_FILE";
|
||||
public static final String WIRTE_PACKGZ_FILE="WIRTE_PACKGZ_FILE";
|
||||
public static final String SKIP_FOR_MOVE_FAILED="SKIP_FOR_MOVE_FAILED";
|
||||
public static final String PACK_HELP="PACK_HELP";
|
||||
public static final String UNPACK_HELP ="UNPACK_HELP";
|
||||
public static final String MORE_INFO = "MORE_INFO";
|
||||
public static final String DUPLICATE_OPTION = "DUPLICATE_OPTION";
|
||||
public static final String BAD_SPEC = "BAD_SPEC";
|
||||
|
||||
//The following string is duplicate in PACK and UNPACK comment,which was draw out to ruduce translation work.
|
||||
private static final String PARAMETER_V = " -v, --verbose increase program verbosity";
|
||||
private static final String PARAMETER_Q = " -q, --quiet set verbosity to lowest level";
|
||||
private static final String PARAMETER_LF = " -l{F}, --log-file={F} output to the given log file, or '-' for System.out";
|
||||
private static final String PARAMETER_H = " -?, -h, --help print this message";
|
||||
private static final String PARAMETER_VER = " -V, --version print program version";
|
||||
private static final String PARAMETER_J = " -J{X} pass option X to underlying Java VM";
|
||||
|
||||
|
||||
//The following are outputs of command 'pack200' and 'unpack200'.
|
||||
//Don't translate command arguments ,words with a prefix of '-' or '--'.
|
||||
//
|
||||
private static final Object[][] resource= {
|
||||
{VERSION,"{0} version {1}"},//parameter 0:class name;parameter 1: version value
|
||||
{BAD_ARGUMENT,"Bad argument: {0}"},
|
||||
{BAD_OPTION,"Bad option: {0}={1}"},//parameter 0:option name;parameter 1:option value
|
||||
{BAD_REPACK_OUTPUT,"Bad --repack output: {0}"},//parameter 0:filename
|
||||
{DETECTED_ZIP_COMMENT,"Detected ZIP comment: {0}"},//parameter 0:comment
|
||||
{SKIP_FOR_REPACKED,"Skipping because already repacked: {0}"},//parameter 0:filename
|
||||
{WRITE_PACK_FILE,"To write a *.pack file, specify --no-gzip: {0}"},//parameter 0:filename
|
||||
{WIRTE_PACKGZ_FILE,"To write a *.pack.gz file, specify --gzip: {0}"},//parameter 0:filename
|
||||
{SKIP_FOR_MOVE_FAILED,"Skipping unpack because move failed: {0}"},//parameter 0:filename
|
||||
{PACK_HELP,new String[]{
|
||||
"Usage: pack200 [-opt... | --option=value]... x.pack[.gz] y.jar",
|
||||
"",
|
||||
"Packing Options",
|
||||
" -g, --no-gzip output a plain *.pack file with no zipping",
|
||||
" --gzip (default) post-process the pack output with gzip",
|
||||
" -G, --strip-debug remove debugging attributes while packing",
|
||||
" -O, --no-keep-file-order do not transmit file ordering information",
|
||||
" --keep-file-order (default) preserve input file ordering",
|
||||
" -S{N}, --segment-limit={N} output segment limit (default N=1Mb)",
|
||||
" -E{N}, --effort={N} packing effort (default N=5)",
|
||||
" -H{h}, --deflate-hint={h} transmit deflate hint: true, false, or keep (default)",
|
||||
" -m{V}, --modification-time={V} transmit modtimes: latest or keep (default)",
|
||||
" -P{F}, --pass-file={F} transmit the given input element(s) uncompressed",
|
||||
" -U{a}, --unknown-attribute={a} unknown attribute action: error, strip, or pass (default)",
|
||||
" -C{N}={L}, --class-attribute={N}={L} (user-defined attribute)",
|
||||
" -F{N}={L}, --field-attribute={N}={L} (user-defined attribute)",
|
||||
" -M{N}={L}, --method-attribute={N}={L} (user-defined attribute)",
|
||||
" -D{N}={L}, --code-attribute={N}={L} (user-defined attribute)",
|
||||
" -f{F}, --config-file={F} read file F for Pack200.Packer properties",
|
||||
PARAMETER_V ,
|
||||
PARAMETER_Q ,
|
||||
PARAMETER_LF ,
|
||||
PARAMETER_H ,
|
||||
PARAMETER_VER ,
|
||||
PARAMETER_J,
|
||||
"",
|
||||
"Notes:",
|
||||
" The -P, -C, -F, -M, and -D options accumulate.",
|
||||
" Example attribute definition: -C SourceFile=RUH .",
|
||||
" Config. file properties are defined by the Pack200 API.",
|
||||
" For meaning of -S, -E, -H-, -m, -U values, see Pack200 API.",
|
||||
" Layout definitions (like RUH) are defined by JSR 200.",
|
||||
"",
|
||||
"Repacking mode updates the JAR file with a pack/unpack cycle:",
|
||||
" pack200 [-r|--repack] [-opt | --option=value]... [repackedy.jar] y.jar\n"
|
||||
}
|
||||
},
|
||||
{UNPACK_HELP,new String[]{
|
||||
"Usage: unpack200 [-opt... | --option=value]... x.pack[.gz] y.jar\n",
|
||||
"",
|
||||
"Unpacking Options",
|
||||
" -H{h}, --deflate-hint={h} override transmitted deflate hint: true, false, or keep (default)",
|
||||
" -r, --remove-pack-file remove input file after unpacking",
|
||||
PARAMETER_V ,
|
||||
PARAMETER_Q ,
|
||||
PARAMETER_LF ,
|
||||
PARAMETER_H ,
|
||||
PARAMETER_VER ,
|
||||
PARAMETER_J,
|
||||
}
|
||||
},
|
||||
|
||||
{MORE_INFO,"(For more information, run {0} --help .)"},//parameter 0:command name
|
||||
{DUPLICATE_OPTION,"duplicate option: {0}"},//parameter 0:option
|
||||
{BAD_SPEC,"bad spec for {0}: {1}"},//parameter 0:option;parameter 1:specifier
|
||||
};
|
||||
|
||||
protected Object[][] getContents() {
|
||||
return resource;
|
||||
}
|
||||
public static final String VERSION = "VERSION";
|
||||
public static final String BAD_ARGUMENT = "BAD_ARGUMENT";
|
||||
public static final String BAD_OPTION = "BAD_OPTION";
|
||||
public static final String BAD_REPACK_OUTPUT = "BAD_REPACK_OUTPUT";
|
||||
public static final String DETECTED_ZIP_COMMENT = "DETECTED_ZIP_COMMENT";
|
||||
public static final String SKIP_FOR_REPACKED = "SKIP_FOR_REPACKED";
|
||||
public static final String WRITE_PACK_FILE = "WRITE_PACK_FILE";
|
||||
public static final String WRITE_PACKGZ_FILE = "WRITE_PACKGZ_FILE";
|
||||
public static final String SKIP_FOR_MOVE_FAILED = "SKIP_FOR_MOVE_FAILED";
|
||||
public static final String PACK_HELP = "PACK_HELP";
|
||||
public static final String UNPACK_HELP = "UNPACK_HELP";
|
||||
public static final String MORE_INFO = "MORE_INFO";
|
||||
public static final String DUPLICATE_OPTION = "DUPLICATE_OPTION";
|
||||
public static final String BAD_SPEC = "BAD_SPEC";
|
||||
|
||||
/*
|
||||
* The following are the output of 'pack200' and 'unpack200' commands.
|
||||
* Do not translate command arguments and words with a prefix of '-' or '--'.
|
||||
*/
|
||||
private static final Object[][] resource = {
|
||||
{VERSION, "{0} version {1}"}, // parameter 0:class name;parameter 1: version value
|
||||
{BAD_ARGUMENT, "Bad argument: {0}"},
|
||||
{BAD_OPTION, "Bad option: {0}={1}"}, // parameter 0:option name;parameter 1:option value
|
||||
{BAD_REPACK_OUTPUT, "Bad --repack output: {0}"}, // parameter 0:filename
|
||||
{DETECTED_ZIP_COMMENT, "Detected ZIP comment: {0}"}, // parameter 0:comment
|
||||
{SKIP_FOR_REPACKED, "Skipping because already repacked: {0}"}, // parameter 0:filename
|
||||
{WRITE_PACK_FILE, "To write a *.pack file, specify --no-gzip: {0}"}, // parameter 0:filename
|
||||
{WRITE_PACKGZ_FILE, "To write a *.pack.gz file, specify --gzip: {0}"}, // parameter 0:filename
|
||||
{SKIP_FOR_MOVE_FAILED, "Skipping unpack because move failed: {0}"}, // parameter 0:filename
|
||||
{PACK_HELP, new String[] {
|
||||
"Usage: pack200 [-opt... | --option=value]... x.pack[.gz] y.jar",
|
||||
"",
|
||||
"Packing Options",
|
||||
" -g, --no-gzip output a plain *.pack file with no zipping",
|
||||
" --gzip (default) post-process the pack output with gzip",
|
||||
" -G, --strip-debug remove debugging attributes while packing",
|
||||
" -O, --no-keep-file-order do not transmit file ordering information",
|
||||
" --keep-file-order (default) preserve input file ordering",
|
||||
" -S{N}, --segment-limit={N} output segment limit (default N=1Mb)",
|
||||
" -E{N}, --effort={N} packing effort (default N=5)",
|
||||
" -H{h}, --deflate-hint={h} transmit deflate hint: true, false, or keep (default)",
|
||||
" -m{V}, --modification-time={V} transmit modtimes: latest or keep (default)",
|
||||
" -P{F}, --pass-file={F} transmit the given input element(s) uncompressed",
|
||||
" -U{a}, --unknown-attribute={a} unknown attribute action: error, strip, or pass (default)",
|
||||
" -C{N}={L}, --class-attribute={N}={L} (user-defined attribute)",
|
||||
" -F{N}={L}, --field-attribute={N}={L} (user-defined attribute)",
|
||||
" -M{N}={L}, --method-attribute={N}={L} (user-defined attribute)",
|
||||
" -D{N}={L}, --code-attribute={N}={L} (user-defined attribute)",
|
||||
" -f{F}, --config-file={F} read file F for Pack200.Packer properties",
|
||||
" -v, --verbose increase program verbosity",
|
||||
" -q, --quiet set verbosity to lowest level",
|
||||
" -l{F}, --log-file={F} output to the given log file, or '-' for System.out",
|
||||
" -?, -h, --help print this message",
|
||||
" -V, --version print program version",
|
||||
" -J{X} pass option X to underlying Java VM",
|
||||
"",
|
||||
"Notes:",
|
||||
" The -P, -C, -F, -M, and -D options accumulate.",
|
||||
" Example attribute definition: -C SourceFile=RUH .",
|
||||
" Config. file properties are defined by the Pack200 API.",
|
||||
" For meaning of -S, -E, -H-, -m, -U values, see Pack200 API.",
|
||||
" Layout definitions (like RUH) are defined by JSR 200.",
|
||||
"",
|
||||
"Repacking mode updates the JAR file with a pack/unpack cycle:",
|
||||
" pack200 [-r|--repack] [-opt | --option=value]... [repackedy.jar] y.jar\n"
|
||||
}
|
||||
},
|
||||
{UNPACK_HELP, new String[] {
|
||||
"Usage: unpack200 [-opt... | --option=value]... x.pack[.gz] y.jar\n",
|
||||
"",
|
||||
"Unpacking Options",
|
||||
" -H{h}, --deflate-hint={h} override transmitted deflate hint: true, false, or keep (default)",
|
||||
" -r, --remove-pack-file remove input file after unpacking",
|
||||
" -v, --verbose increase program verbosity",
|
||||
" -q, --quiet set verbosity to lowest level",
|
||||
" -l{F}, --log-file={F} output to the given log file, or '-' for System.out",
|
||||
" -?, -h, --help print this message",
|
||||
" -V, --version print program version",
|
||||
" -J{X} pass option X to underlying Java VM"
|
||||
}
|
||||
},
|
||||
{MORE_INFO, "(For more information, run {0} --help .)"}, // parameter 0:command name
|
||||
{DUPLICATE_OPTION, "duplicate option: {0}"}, // parameter 0:option
|
||||
{BAD_SPEC, "bad spec for {0}: {1}"}, // parameter 0:option;parameter 1:specifier
|
||||
};
|
||||
|
||||
protected Object[][] getContents() {
|
||||
return resource;
|
||||
}
|
||||
}
|
||||
|
||||
@ -187,9 +187,18 @@ final class JSSecurityManager {
|
||||
|
||||
static <T> List<T> getProviders(final Class<T> providerClass) {
|
||||
List<T> p = new ArrayList<>();
|
||||
// ServiceLoader creates "lazy" iterator instance, so it doesn't,
|
||||
// require do be called from privileged section
|
||||
final Iterator<T> ps = ServiceLoader.load(providerClass).iterator();
|
||||
// ServiceLoader creates "lazy" iterator instance, but it ensures that
|
||||
// next/hasNext run with permissions that are restricted by whatever
|
||||
// creates the ServiceLoader instance, so it requires to be called from
|
||||
// privileged section
|
||||
final PrivilegedAction<Iterator<T>> psAction =
|
||||
new PrivilegedAction<Iterator<T>>() {
|
||||
@Override
|
||||
public Iterator<T> run() {
|
||||
return ServiceLoader.load(providerClass).iterator();
|
||||
}
|
||||
};
|
||||
final Iterator<T> ps = AccessController.doPrivileged(psAction);
|
||||
|
||||
// the iterator's hasNext() method looks through classpath for
|
||||
// the provider class names, so it requires read permissions
|
||||
|
||||
@ -35,7 +35,7 @@ import org.w3c.dom.Element;
|
||||
/**
|
||||
* Handles SubjectKeyIdentifier (SKI) for X.509v3.
|
||||
*
|
||||
* @see <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/cert/X509Extension.html">
|
||||
* @see <A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/security/cert/X509Extension.html">
|
||||
* Interface X509Extension</A>
|
||||
*/
|
||||
public class XMLX509SKI extends SignatureElementProxy implements XMLX509DataContent {
|
||||
|
||||
@ -56,7 +56,7 @@ import com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverS
|
||||
* </PRE>
|
||||
*
|
||||
* @see <A HREF="http://www.javaworld.com/javaworld/javatips/jw-javatip42_p.html">Java Tip 42: Write Java apps that work with proxy-based firewalls</A>
|
||||
* @see <A HREF="http://java.sun.com/j2se/1.4/docs/guide/net/properties.html">SUN J2SE docs for network properties</A>
|
||||
* @see <A HREF="http://docs.oracle.com/javase/1.4.2/docs/guide/net/properties.html">SUN J2SE docs for network properties</A>
|
||||
* @see <A HREF="http://metalab.unc.edu/javafaq/javafaq.html#proxy">The JAVA FAQ Question 9.5: How do I make Java work with a proxy server?</A>
|
||||
*/
|
||||
public class ResolverDirectHTTP extends ResourceResolverSpi {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -53,7 +53,7 @@ public final class Provider extends java.security.Provider {
|
||||
" server mechanisms for: DIGEST-MD5, GSSAPI, CRAM-MD5, NTLM)";
|
||||
|
||||
public Provider() {
|
||||
super("SunSASL", 1.7d, info);
|
||||
super("SunSASL", 1.8d, info);
|
||||
|
||||
AccessController.doPrivileged(new PrivilegedAction<Void>() {
|
||||
public Void run() {
|
||||
|
||||
@ -143,11 +143,11 @@ public class Applet extends Panel {
|
||||
* For example, suppose an applet is contained
|
||||
* within the document:
|
||||
* <blockquote><pre>
|
||||
* http://java.sun.com/products/jdk/1.2/index.html
|
||||
* http://www.oracle.com/technetwork/java/index.html
|
||||
* </pre></blockquote>
|
||||
* The document base is:
|
||||
* <blockquote><pre>
|
||||
* http://java.sun.com/products/jdk/1.2/index.html
|
||||
* http://www.oracle.com/technetwork/java/index.html
|
||||
* </pre></blockquote>
|
||||
*
|
||||
* @return the {@link java.net.URL} of the document that contains this
|
||||
|
||||
@ -54,11 +54,11 @@ public interface AppletStub {
|
||||
* For example, suppose an applet is contained
|
||||
* within the document:
|
||||
* <blockquote><pre>
|
||||
* http://java.sun.com/products/jdk/1.2/index.html
|
||||
* http://www.oracle.com/technetwork/java/index.html
|
||||
* </pre></blockquote>
|
||||
* The document base is:
|
||||
* <blockquote><pre>
|
||||
* http://java.sun.com/products/jdk/1.2/index.html
|
||||
* http://www.oracle.com/technetwork/java/index.html
|
||||
* </pre></blockquote>
|
||||
*
|
||||
* @return the {@link java.net.URL} of the document that contains the
|
||||
|
||||
@ -96,7 +96,7 @@ import java.util.Hashtable;
|
||||
* alt="Diagram of an applet demonstrating BorderLayout.
|
||||
* Each section of the BorderLayout contains a Button corresponding to its position in the layout, one of:
|
||||
* North, West, Center, East, or South."
|
||||
* ALIGN=center HSPACE=10 VSPACE=7>
|
||||
* style="float:center; margin: 7px 10px;">
|
||||
* <p>
|
||||
* The code for this applet is as follows:
|
||||
* <p>
|
||||
|
||||
@ -40,7 +40,7 @@ import javax.accessibility.*;
|
||||
* under the Solaris operating system:
|
||||
* <p>
|
||||
* <img src="doc-files/Button-1.gif" alt="The following context describes the graphic"
|
||||
* ALIGN=center HSPACE=10 VSPACE=7>
|
||||
* style="float:center; margin: 7px 10px;">
|
||||
* <p>
|
||||
* The first view shows the button as it appears normally.
|
||||
* The second view shows the button
|
||||
|
||||
@ -53,7 +53,7 @@ import javax.accessibility.*;
|
||||
* created by this code example:
|
||||
* <p>
|
||||
* <img src="doc-files/Checkbox-1.gif" alt="The following context describes the graphic."
|
||||
* ALIGN=center HSPACE=10 VSPACE=7>
|
||||
* style="float:center; margin: 7px 10px;">
|
||||
* <p>
|
||||
* The button labeled <code>one</code> is in the "on" state, and the
|
||||
* other two are in the "off" state. In this example, which uses the
|
||||
|
||||
@ -48,7 +48,7 @@ package java.awt;
|
||||
* <p>
|
||||
* <img src="doc-files/CheckboxGroup-1.gif"
|
||||
* alt="Shows three checkboxes, arranged vertically, labeled one, two, and three. Checkbox one is in the on state."
|
||||
* ALIGN=center HSPACE=10 VSPACE=7>
|
||||
* style="float:center; margin: 7px 10px;">
|
||||
* <p>
|
||||
* @author Sami Shaio
|
||||
* @see java.awt.Checkbox
|
||||
|
||||
@ -44,7 +44,7 @@ import sun.awt.AWTAccessor;
|
||||
* <p>
|
||||
* <img src="doc-files/MenuBar-1.gif"
|
||||
* alt="Menu labeled Examples, containing items Basic, Simple, Check, and More Examples. The Check item is a CheckBoxMenuItem instance, in the off state."
|
||||
* ALIGN=center HSPACE=10 VSPACE=7>
|
||||
* style="float:center; margin: 7px 10px;">
|
||||
* <p>
|
||||
* The item labeled <code>Check</code> shows a check box menu item
|
||||
* in its "off" state.
|
||||
|
||||
@ -52,7 +52,7 @@ import javax.accessibility.*;
|
||||
* it appears as follows in its normal state:
|
||||
* <p>
|
||||
* <img src="doc-files/Choice-1.gif" alt="The following text describes the graphic"
|
||||
* ALIGN=center HSPACE=10 VSPACE=7>
|
||||
* style="float:center; margin: 7px 10px;">
|
||||
* <p>
|
||||
* In the picture, <code>"Green"</code> is the current choice.
|
||||
* Pushing the mouse button down on the object causes a menu to
|
||||
|
||||
@ -823,7 +823,7 @@ public class Color implements Paint, java.io.Serializable {
|
||||
* <p>
|
||||
* The integer that is returned by <code>HSBtoRGB</code> encodes the
|
||||
* value of a color in bits 0-23 of an integer value that is the same
|
||||
* format used by the method {@link #getRGB() <code>getRGB</code>}.
|
||||
* format used by the method {@link #getRGB() getRGB}.
|
||||
* This integer can be supplied as an argument to the
|
||||
* <code>Color</code> constructor that takes a single integer argument.
|
||||
* @param hue the hue component of the color
|
||||
|
||||
@ -173,10 +173,10 @@ import sun.util.logging.PlatformLogger;
|
||||
* <b>Note</b>: For more information on the paint mechanisms utilitized
|
||||
* by AWT and Swing, including information on how to write the most
|
||||
* efficient painting code, see
|
||||
* <a href="http://java.sun.com/products/jfc/tsc/articles/painting/index.html">Painting in AWT and Swing</a>.
|
||||
* <a href="http://www.oracle.com/technetwork/java/painting-140037.html">Painting in AWT and Swing</a>.
|
||||
* <p>
|
||||
* For details on the focus subsystem, see
|
||||
* <a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html">
|
||||
* <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
|
||||
* How to Use the Focus Subsystem</a>,
|
||||
* a section in <em>The Java Tutorial</em>, and the
|
||||
* <a href="../../java/awt/doc-files/FocusSpec.html">Focus Specification</a>
|
||||
@ -1223,10 +1223,6 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
* be called on the toolkit thread.
|
||||
*/
|
||||
final Toolkit getToolkitImpl() {
|
||||
ComponentPeer peer = this.peer;
|
||||
if ((peer != null) && ! (peer instanceof LightweightPeer)){
|
||||
return peer.getToolkit();
|
||||
}
|
||||
Container parent = this.parent;
|
||||
if (parent != null) {
|
||||
return parent.getToolkitImpl();
|
||||
@ -3205,7 +3201,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
* <b>Note</b>: For more information on the paint mechanisms utilitized
|
||||
* by AWT and Swing, including information on how to write the most
|
||||
* efficient painting code, see
|
||||
* <a href="http://java.sun.com/products/jfc/tsc/articles/painting/index.html">Painting in AWT and Swing</a>.
|
||||
* <a href="http://www.oracle.com/technetwork/java/painting-140037.html">Painting in AWT and Swing</a>.
|
||||
*
|
||||
* @param g the graphics context to use for painting
|
||||
* @see #update
|
||||
@ -3240,7 +3236,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
* <b>Note</b>: For more information on the paint mechanisms utilitized
|
||||
* by AWT and Swing, including information on how to write the most
|
||||
* efficient painting code, see
|
||||
* <a href="http://java.sun.com/products/jfc/tsc/articles/painting/index.html">Painting in AWT and Swing</a>.
|
||||
* <a href="http://www.oracle.com/technetwork/java/painting-140037.html">Painting in AWT and Swing</a>.
|
||||
*
|
||||
* @param g the specified context to use for updating
|
||||
* @see #paint
|
||||
@ -3301,7 +3297,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
* <b>Note</b>: For more information on the paint mechanisms utilitized
|
||||
* by AWT and Swing, including information on how to write the most
|
||||
* efficient painting code, see
|
||||
* <a href="http://java.sun.com/products/jfc/tsc/articles/painting/index.html">Painting in AWT and Swing</a>.
|
||||
* <a href="http://www.oracle.com/technetwork/java/painting-140037.html">Painting in AWT and Swing</a>.
|
||||
|
||||
*
|
||||
* @see #update(Graphics)
|
||||
@ -3319,7 +3315,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
* <b>Note</b>: For more information on the paint mechanisms utilitized
|
||||
* by AWT and Swing, including information on how to write the most
|
||||
* efficient painting code, see
|
||||
* <a href="http://java.sun.com/products/jfc/tsc/articles/painting/index.html">Painting in AWT and Swing</a>.
|
||||
* <a href="http://www.oracle.com/technetwork/java/painting-140037.html">Painting in AWT and Swing</a>.
|
||||
*
|
||||
* @param tm maximum time in milliseconds before update
|
||||
* @see #paint
|
||||
@ -3341,7 +3337,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
* <b>Note</b>: For more information on the paint mechanisms utilitized
|
||||
* by AWT and Swing, including information on how to write the most
|
||||
* efficient painting code, see
|
||||
* <a href="http://java.sun.com/products/jfc/tsc/articles/painting/index.html">Painting in AWT and Swing</a>.
|
||||
* <a href="http://www.oracle.com/technetwork/java/painting-140037.html">Painting in AWT and Swing</a>.
|
||||
*
|
||||
* @param x the <i>x</i> coordinate
|
||||
* @param y the <i>y</i> coordinate
|
||||
@ -3366,7 +3362,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
* <b>Note</b>: For more information on the paint mechanisms utilitized
|
||||
* by AWT and Swing, including information on how to write the most
|
||||
* efficient painting code, see
|
||||
* <a href="http://java.sun.com/products/jfc/tsc/articles/painting/index.html">Painting in AWT and Swing</a>.
|
||||
* <a href="http://www.oracle.com/technetwork/java/painting-140037.html">Painting in AWT and Swing</a>.
|
||||
*
|
||||
* @param tm maximum time in milliseconds before update
|
||||
* @param x the <i>x</i> coordinate
|
||||
|
||||
@ -75,7 +75,7 @@ import sun.security.action.GetBooleanAction;
|
||||
* (and hence to the bottom of the stacking order).
|
||||
* <p>
|
||||
* <b>Note</b>: For details on the focus subsystem, see
|
||||
* <a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html">
|
||||
* <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
|
||||
* How to Use the Focus Subsystem</a>,
|
||||
* a section in <em>The Java Tutorial</em>, and the
|
||||
* <a href="../../java/awt/doc-files/FocusSpec.html">Focus Specification</a>
|
||||
|
||||
@ -54,7 +54,7 @@ import java.awt.peer.ComponentPeer;
|
||||
* impact, the focusability of the Component itself.
|
||||
* <p>
|
||||
* Please see
|
||||
* <a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html">
|
||||
* <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
|
||||
* How to Use the Focus Subsystem</a>,
|
||||
* a section in <em>The Java Tutorial</em>, and the
|
||||
* <a href="../../java/awt/doc-files/FocusSpec.html">Focus Specification</a>
|
||||
|
||||
@ -49,7 +49,7 @@ import sun.awt.TimedWindowEvent;
|
||||
* Container's FocusTraversalPolicy.
|
||||
* <p>
|
||||
* Please see
|
||||
* <a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html">
|
||||
* <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
|
||||
* How to Use the Focus Subsystem</a>,
|
||||
* a section in <em>The Java Tutorial</em>, and the
|
||||
* <a href="../../java/awt/doc-files/FocusSpec.html">Focus Specification</a>
|
||||
|
||||
@ -35,7 +35,7 @@ import java.lang.annotation.Native;
|
||||
* (see {@link GraphicsDevice#isDisplayChangeSupported}).
|
||||
* <p>
|
||||
* For more information on full-screen exclusive mode API, see the
|
||||
* <a href="http://java.sun.com/docs/books/tutorial/extra/fullscreen/index.html">
|
||||
* <a href="http://docs.oracle.com/javase/tutorial/extra/fullscreen/index.html">
|
||||
* Full-Screen Exclusive Mode API Tutorial</a>.
|
||||
*
|
||||
* @see GraphicsDevice
|
||||
|
||||
@ -652,7 +652,7 @@ public class EventQueue {
|
||||
* Dispatches an event. The manner in which the event is
|
||||
* dispatched depends upon the type of the event and the
|
||||
* type of the event's source object:
|
||||
* <p> </p>
|
||||
* <p>
|
||||
* <table border=1 summary="Event types, source types, and dispatch methods">
|
||||
* <tr>
|
||||
* <th>Event Type</th>
|
||||
@ -680,7 +680,7 @@ public class EventQueue {
|
||||
* <td>No action (ignored)</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
* <p> </p>
|
||||
* <p>
|
||||
* @param event an instance of <code>java.awt.AWTEvent</code>,
|
||||
* or a subclass of it
|
||||
* @throws NullPointerException if <code>event</code> is <code>null</code>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -457,9 +457,16 @@ public class FileDialog extends Dialog {
|
||||
* specified file. This file becomes the default file if it is set
|
||||
* before the file dialog window is first shown.
|
||||
* <p>
|
||||
* When the dialog is shown, the specified file is selected. The kind of
|
||||
* selection depends on the file existence, the dialog type, and the native
|
||||
* platform. E.g., the file could be highlighted in the file list, or a
|
||||
* file name editbox could be populated with the file name.
|
||||
* <p>
|
||||
* This method accepts either a full file path, or a file name with an
|
||||
* extension if used together with the {@code setDirectory} method.
|
||||
* <p>
|
||||
* Specifying "" as the file is exactly equivalent to specifying
|
||||
* <code>null</code>
|
||||
* as the file.
|
||||
* {@code null} as the file.
|
||||
*
|
||||
* @param file the file being set
|
||||
* @see #getFile
|
||||
|
||||
@ -54,7 +54,7 @@ import java.io.IOException;
|
||||
* <p>
|
||||
* <img src="doc-files/FlowLayout-1.gif"
|
||||
* ALT="Graphic of Layout for Three Buttons"
|
||||
* ALIGN=center HSPACE=10 VSPACE=7>
|
||||
* style="float:center; margin: 7px 10px;">
|
||||
* <p>
|
||||
* Here is the code for this applet:
|
||||
* <p>
|
||||
|
||||
@ -49,7 +49,7 @@ package java.awt;
|
||||
* policy is used to perform the search operation.
|
||||
* <p>
|
||||
* Please see
|
||||
* <a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html">
|
||||
* <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
|
||||
* How to Use the Focus Subsystem</a>,
|
||||
* a section in <em>The Java Tutorial</em>, and the
|
||||
* <a href="../../java/awt/doc-files/FocusSpec.html">Focus Specification</a>
|
||||
|
||||
@ -127,7 +127,7 @@ import static sun.font.EAttribute.*;
|
||||
* <p>
|
||||
* For a discussion of the relative advantages and disadvantages of using
|
||||
* physical or logical fonts, see the
|
||||
* <a href="http://java.sun.com/j2se/corejava/intl/reference/faqs/index.html#desktop-rendering">Internationalization FAQ</a>
|
||||
* <a href="http://www.oracle.com/technetwork/java/javase/tech/faq-jsp-138165.html">Internationalization FAQ</a>
|
||||
* document.
|
||||
*
|
||||
* <h4>Font Faces and Names</h4>
|
||||
|
||||
@ -51,8 +51,8 @@ import java.text.CharacterIterator;
|
||||
* <li>{@link #charsWidth(char[], int, int)}
|
||||
* </ul>
|
||||
* <p>
|
||||
* <img src="doc-files/FontMetrics-1.gif" alt="The letter 'p' showing its 'reference point'" border=15 align
|
||||
* ALIGN=right HSPACE=10 VSPACE=7>
|
||||
* <img src="doc-files/FontMetrics-1.gif" alt="The letter 'p' showing its 'reference point'"
|
||||
* style="border:15px; float:right; margin: 7px 10px;">
|
||||
* Note that the implementations of these methods are
|
||||
* inefficient, so they are usually overridden with more efficient
|
||||
* toolkit-specific implementations.
|
||||
|
||||
@ -83,7 +83,7 @@ import javax.accessibility.*;
|
||||
* <img src="doc-files/MultiScreen.gif"
|
||||
* alt="Diagram of virtual device encompassing three physical screens and one primary physical screen. The primary physical screen
|
||||
* shows (0,0) coords while a different physical screen shows (-80,-100) coords."
|
||||
* ALIGN=center HSPACE=10 VSPACE=7>
|
||||
* style="float:center; margin: 7px 10px;">
|
||||
* <p>
|
||||
* In such an environment, when calling <code>setLocation</code>,
|
||||
* you must pass a virtual coordinate to this method. Similarly,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -69,7 +69,7 @@ import sun.awt.SunToolkit;
|
||||
* </pre>
|
||||
* <p>
|
||||
* For more information on full-screen exclusive mode API, see the
|
||||
* <a href="http://java.sun.com/docs/books/tutorial/extra/fullscreen/index.html">
|
||||
* <a href="http://docs.oracle.com/javase/tutorial/extra/fullscreen/index.html">
|
||||
* Full-Screen Exclusive Mode API Tutorial</a>.
|
||||
*
|
||||
* @see GraphicsEnvironment
|
||||
@ -334,11 +334,12 @@ public abstract class GraphicsDevice {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the <code>Window</code> object representing the
|
||||
* Returns the {@code Window} object representing the
|
||||
* full-screen window if the device is in full-screen mode.
|
||||
*
|
||||
* @return the full-screen window, or <code>null</code> if the device is
|
||||
* not in full-screen mode.
|
||||
* @return the full-screen window, or {@code null} if the device is
|
||||
* not in full-screen mode. The {@code Window} object can differ
|
||||
* from the object previously set by {@code setFullScreenWindow}.
|
||||
* @see #setFullScreenWindow(Window)
|
||||
* @since 1.4
|
||||
*/
|
||||
|
||||
@ -125,9 +125,9 @@ import java.util.Arrays;
|
||||
* <center><table BORDER=0 WIDTH=800
|
||||
* SUMMARY="absolute, relative and baseline values as described above">
|
||||
* <tr>
|
||||
* <th><P ALIGN="LEFT">Absolute Values</th>
|
||||
* <th><P ALIGN="LEFT">Orientation Relative Values</th>
|
||||
* <th><P ALIGN="LEFT">Baseline Relative Values</th>
|
||||
* <th><P STYLE="TEXT-ALIGN:LEFT">Absolute Values</th>
|
||||
* <th><P STYLE="TEXT-ALIGN:LEFT">Orientation Relative Values</th>
|
||||
* <th><P STYLE="TEXT-ALIGN:LEFT">Baseline Relative Values</th>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>
|
||||
@ -201,7 +201,7 @@ import java.util.Arrays;
|
||||
* <tr ALIGN=CENTER>
|
||||
* <td>
|
||||
* <img src="doc-files/GridBagLayout-baseline.png"
|
||||
* alt="The following text describes this graphic (Figure 1)." ALIGN=center>
|
||||
* alt="The following text describes this graphic (Figure 1)." style="float:center">
|
||||
* </td>
|
||||
* </table></center>
|
||||
* This layout consists of three components:
|
||||
@ -255,10 +255,10 @@ import java.util.Arrays;
|
||||
* <center><table WIDTH=600 summary="layout">
|
||||
* <tr ALIGN=CENTER>
|
||||
* <td>
|
||||
* <img src="doc-files/GridBagLayout-1.gif" alt="The preceeding text describes this graphic (Figure 1)." ALIGN=center HSPACE=10 VSPACE=7>
|
||||
* <img src="doc-files/GridBagLayout-1.gif" alt="The preceeding text describes this graphic (Figure 1)." style="float:center; margin: 7px 10px;">
|
||||
* </td>
|
||||
* <td>
|
||||
* <img src="doc-files/GridBagLayout-2.gif" alt="The preceeding text describes this graphic (Figure 2)." ALIGN=center HSPACE=10 VSPACE=7>
|
||||
* <img src="doc-files/GridBagLayout-2.gif" alt="The preceeding text describes this graphic (Figure 2)." style="float:center; margin: 7px 10px;">
|
||||
* </td>
|
||||
* <tr ALIGN=CENTER>
|
||||
* <td>Figure 2: Horizontal, Left-to-Right</td>
|
||||
|
||||
@ -55,7 +55,7 @@ package java.awt;
|
||||
* If the container's <code>ComponentOrientation</code> property is horizontal
|
||||
* and right-to-left, the example produces the output shown in Figure 2.
|
||||
* <p>
|
||||
* <center><table WIDTH=600 summary="layout">
|
||||
* <table style="float:center" WIDTH=600 summary="layout">
|
||||
* <tr ALIGN=CENTER>
|
||||
* <td><img SRC="doc-files/GridLayout-1.gif"
|
||||
* alt="Shows 6 buttons in rows of 2. Row 1 shows buttons 1 then 2.
|
||||
@ -73,7 +73,7 @@ package java.awt;
|
||||
*
|
||||
* <td>Figure 2: Horizontal, Right-to-Left</td>
|
||||
* </tr>
|
||||
* </table></center>
|
||||
* </table>
|
||||
* <p>
|
||||
* When both the number of rows and the number of columns have
|
||||
* been set to non-zero values, either by a constructor or
|
||||
|
||||
@ -88,7 +88,7 @@ import sun.awt.AWTAccessor;
|
||||
* ClassLoader.
|
||||
* <p>
|
||||
* Please see
|
||||
* <a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html">
|
||||
* <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html">
|
||||
* How to Use the Focus Subsystem</a>,
|
||||
* a section in <em>The Java Tutorial</em>, and the
|
||||
* <a href="../../java/awt/doc-files/FocusSpec.html">Focus Specification</a>
|
||||
@ -590,6 +590,7 @@ public abstract class KeyboardFocusManager
|
||||
*
|
||||
* @see Component#requestFocus()
|
||||
* @see java.awt.event.FocusEvent#FOCUS_LOST
|
||||
* @since 1.8
|
||||
*/
|
||||
public void clearFocusOwner() {
|
||||
if (getFocusOwner() != null) {
|
||||
|
||||
@ -46,7 +46,7 @@ import javax.accessibility.*;
|
||||
* produces the following labels:
|
||||
* <p>
|
||||
* <img src="doc-files/Label-1.gif" alt="Two labels: 'Hi There!' and 'Another label'"
|
||||
* ALIGN=center HSPACE=10 VSPACE=7>
|
||||
* style="float:center; margin: 7px 10px;">
|
||||
*
|
||||
* @author Sami Shaio
|
||||
* @since JDK1.0
|
||||
|
||||
@ -94,7 +94,7 @@ import java.beans.ConstructorProperties;
|
||||
* of the three cycle methods:
|
||||
* <p>
|
||||
* <center>
|
||||
* <img src = "doc-files/LinearGradientPaint.png">
|
||||
* <img src = "doc-files/LinearGradientPaint.png" alt="LinearGradientPaint">
|
||||
* </center>
|
||||
*
|
||||
* @see java.awt.Paint
|
||||
|
||||
@ -61,7 +61,7 @@ import javax.accessibility.*;
|
||||
* scrolling list:
|
||||
* <p>
|
||||
* <img src="doc-files/List-1.gif"
|
||||
* alt="Shows a list containing: Venus, Earth, JavaSoft, and Mars. Javasoft is selected." ALIGN=center HSPACE=10 VSPACE=7>
|
||||
* alt="Shows a list containing: Venus, Earth, JavaSoft, and Mars. Javasoft is selected." style="float:center; margin: 7px 10px;">
|
||||
* <p>
|
||||
* If the List allows multiple selections, then clicking on
|
||||
* an item that is already selected deselects it. In the preceding
|
||||
|
||||
@ -45,7 +45,7 @@ import javax.accessibility.*;
|
||||
* <img src="doc-files/MenuBar-1.gif"
|
||||
* alt="Diagram of MenuBar containing 2 menus: Examples and Options.
|
||||
* Examples menu is expanded showing items: Basic, Simple, Check, and More Examples."
|
||||
* ALIGN=center HSPACE=10 VSPACE=7>
|
||||
* style="float:center; margin: 7px 10px;">
|
||||
* <p>
|
||||
* A menu bar handles keyboard shortcuts for menu items, passing them
|
||||
* along to its child menus.
|
||||
|
||||
@ -42,8 +42,8 @@ import sun.awt.AWTAccessor;
|
||||
* <p>
|
||||
* This picture of a menu bar shows five menu items:
|
||||
* <IMG SRC="doc-files/MenuBar-1.gif" alt="The following text describes this graphic."
|
||||
* ALIGN=CENTER HSPACE=10 VSPACE=7>
|
||||
* <br CLEAR=LEFT>
|
||||
* style="float:center; margin: 7px 10px;">
|
||||
* <br style="clear:left;">
|
||||
* The first two items are simple menu items, labeled
|
||||
* <code>"Basic"</code> and <code>"Simple"</code>.
|
||||
* Following these two items is a separator, which is itself
|
||||
|
||||
@ -80,14 +80,14 @@ import java.beans.ConstructorProperties;
|
||||
* from the focus point. The following figure shows that the distance AB
|
||||
* is equal to the distance BC, and the distance AD is equal to the distance DE.
|
||||
* <center>
|
||||
* <img src = "doc-files/RadialGradientPaint-3.png">
|
||||
* <img src = "doc-files/RadialGradientPaint-3.png" alt="RadialGradientPaint-3">
|
||||
* </center>
|
||||
* If the gradient and graphics rendering transforms are uniformly scaled and
|
||||
* the user sets the focus so that it coincides with the center of the circle,
|
||||
* the gradient color proportions are equal for any line drawn from the center.
|
||||
* The following figure shows the distances AB, BC, AD, and DE. They are all equal.
|
||||
* <center>
|
||||
* <img src = "doc-files/RadialGradientPaint-4.png">
|
||||
* <img src = "doc-files/RadialGradientPaint-4.png" alt="RadialGradientPaint-4">
|
||||
* </center>
|
||||
* Note that some minor variations in distances may occur due to sampling at
|
||||
* the granularity of a pixel.
|
||||
@ -117,7 +117,7 @@ import java.beans.ConstructorProperties;
|
||||
* (centered) focus for each of the three cycle methods:
|
||||
* <p>
|
||||
* <center>
|
||||
* <img src = "doc-files/RadialGradientPaint-1.png">
|
||||
* <img src = "doc-files/RadialGradientPaint-1.png" alt="RadialGradientPaint-1">
|
||||
* </center>
|
||||
*
|
||||
* <p>
|
||||
@ -141,7 +141,7 @@ import java.beans.ConstructorProperties;
|
||||
* focus for each of the three cycle methods:
|
||||
* <p>
|
||||
* <center>
|
||||
* <img src = "doc-files/RadialGradientPaint-2.png">
|
||||
* <img src = "doc-files/RadialGradientPaint-2.png" alt="RadialGradientPaint-2">
|
||||
* </center>
|
||||
*
|
||||
* @see java.awt.Paint
|
||||
|
||||
@ -42,7 +42,7 @@ import javax.accessibility.*;
|
||||
* the red, green, and blue components of a color:
|
||||
* <p>
|
||||
* <img src="doc-files/Scrollbar-1.gif" alt="Image shows 3 vertical sliders, side-by-side."
|
||||
* ALIGN=center HSPACE=10 VSPACE=7>
|
||||
* style="float:center; margin: 7px 10px;">
|
||||
* <p>
|
||||
* Each scroll bar in this example could be created with
|
||||
* code similar to the following:
|
||||
@ -60,7 +60,7 @@ import javax.accessibility.*;
|
||||
* <p>
|
||||
* <img src="doc-files/Scrollbar-2.gif"
|
||||
* alt="Image shows horizontal slider with starting range of 0 and ending range of 300. The slider thumb is labeled 60."
|
||||
* ALIGN=center HSPACE=10 VSPACE=7>
|
||||
* style="float:center; margin: 7px 10px;">
|
||||
* <p>
|
||||
* The value range represented by the bubble in this example
|
||||
* is the <em>visible amount</em>. The horizontal scroll bar
|
||||
@ -295,7 +295,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible {
|
||||
* Constructs a new vertical scroll bar.
|
||||
* The default properties of the scroll bar are listed in
|
||||
* the following table:
|
||||
* <p> </p>
|
||||
* <p>
|
||||
* <table border=1 summary="Scrollbar default properties">
|
||||
* <tr>
|
||||
* <th>Property</th>
|
||||
|
||||
@ -361,7 +361,7 @@ public class SystemTray {
|
||||
/**
|
||||
* Adds a {@code PropertyChangeListener} to the list of listeners for the
|
||||
* specific property. The following properties are currently supported:
|
||||
* <p> </p>
|
||||
* <p>
|
||||
* <table border=1 summary="SystemTray properties">
|
||||
* <tr>
|
||||
* <th>Property</th>
|
||||
@ -384,7 +384,7 @@ public class SystemTray {
|
||||
* The property is accessed by the {@link #getSystemTray} method.</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
* <p> </p>
|
||||
* <p>
|
||||
* The {@code listener} listens to property changes only in this context.
|
||||
* <p>
|
||||
* If {@code listener} is {@code null}, no exception is thrown
|
||||
|
||||
@ -42,7 +42,7 @@ import javax.accessibility.*;
|
||||
* The following image shows the appearance of a text area:
|
||||
* <p>
|
||||
* <img src="doc-files/TextArea-1.gif" alt="A TextArea showing the word 'Hello!'"
|
||||
* ALIGN=center HSPACE=10 VSPACE=7>
|
||||
* style="float:center; margin: 7px 10px;">
|
||||
* <p>
|
||||
* This text area could be created by the following line of code:
|
||||
* <p>
|
||||
|
||||
@ -822,37 +822,6 @@ public class TextComponent extends Component implements Accessible {
|
||||
// Accessibility support
|
||||
////////////////
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
int getIndexAtPoint(Point p) {
|
||||
return -1;
|
||||
/* To be fully implemented in a future release
|
||||
if (peer == null) {
|
||||
return -1;
|
||||
}
|
||||
TextComponentPeer peer = (TextComponentPeer)this.peer;
|
||||
return peer.getIndexAtPoint(p.x, p.y);
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
Rectangle getCharacterBounds(int i) {
|
||||
return null;
|
||||
/* To be fully implemented in a future release
|
||||
if (peer == null) {
|
||||
return null;
|
||||
}
|
||||
TextComponentPeer peer = (TextComponentPeer)this.peer;
|
||||
return peer.getCharacterBounds(i);
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the AccessibleContext associated with this TextComponent.
|
||||
* For text components, the AccessibleContext takes the form of an
|
||||
@ -963,7 +932,7 @@ public class TextComponent extends Component implements Accessible {
|
||||
* @return the zero-based index of the character under Point p.
|
||||
*/
|
||||
public int getIndexAtPoint(Point p) {
|
||||
return TextComponent.this.getIndexAtPoint(p);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -976,7 +945,7 @@ public class TextComponent extends Component implements Accessible {
|
||||
* @return the screen coordinates of the character's bounding box
|
||||
*/
|
||||
public Rectangle getCharacterBounds(int i) {
|
||||
return TextComponent.this.getCharacterBounds(i);
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -42,7 +42,7 @@ import javax.accessibility.*;
|
||||
* display the predefined text <code>"Hello"</code>.
|
||||
* <p>
|
||||
* <img src="doc-files/TextField-1.gif" alt="The preceding text describes this image."
|
||||
* ALIGN=center HSPACE=10 VSPACE=7>
|
||||
* style="float:center; margin: 7px 10px;">
|
||||
* <p>
|
||||
* Here is the code that produces these four text fields:
|
||||
* <p>
|
||||
|
||||
@ -83,7 +83,7 @@ import sun.util.CoreResourceBundleControl;
|
||||
* <p>
|
||||
* <li>Moving the focus from one component to another.
|
||||
* <br>For more information, see
|
||||
* <a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html#transferTiming">Timing
|
||||
* <a href="http://docs.oracle.com/javase/tutorial/uiswing/misc/focus.html#transferTiming">Timing
|
||||
* Focus Transfers</a>, a section in
|
||||
* <a href="http://java.sun.com/docs/books/tutorial/uiswing/">The Swing
|
||||
* Tutorial</a>.
|
||||
|
||||
@ -85,7 +85,7 @@ import sun.util.logging.PlatformLogger;
|
||||
* <p>
|
||||
* <img src="doc-files/MultiScreen.gif"
|
||||
* alt="Diagram shows virtual device containing 4 physical screens. Primary physical screen shows coords (0,0), other screen shows (-80,-100)."
|
||||
* ALIGN=center HSPACE=10 VSPACE=7>
|
||||
* style="float:center; margin: 7px 10px;">
|
||||
* <p>
|
||||
* In such an environment, when calling {@code setLocation},
|
||||
* you must pass a virtual coordinate to this method. Similarly,
|
||||
@ -226,6 +226,7 @@ public class Window extends Container implements Accessible {
|
||||
boolean syncLWRequests = false;
|
||||
transient boolean beforeFirstShow = true;
|
||||
private transient boolean disposing = false;
|
||||
transient WindowDisposerRecord disposerRecord = null;
|
||||
|
||||
static final int OPENED = 0x01;
|
||||
|
||||
@ -437,18 +438,28 @@ public class Window extends Container implements Accessible {
|
||||
|
||||
transient Object anchor = new Object();
|
||||
static class WindowDisposerRecord implements sun.java2d.DisposerRecord {
|
||||
final WeakReference<Window> owner;
|
||||
WeakReference<Window> owner;
|
||||
final WeakReference<Window> weakThis;
|
||||
final WeakReference<AppContext> context;
|
||||
|
||||
WindowDisposerRecord(AppContext context, Window victim) {
|
||||
owner = new WeakReference<Window>(victim.getOwner());
|
||||
weakThis = victim.weakThis;
|
||||
this.context = new WeakReference<AppContext>(context);
|
||||
}
|
||||
|
||||
public void updateOwner() {
|
||||
Window victim = weakThis.get();
|
||||
owner = (victim == null)
|
||||
? null
|
||||
: new WeakReference<Window>(victim.getOwner());
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
Window parent = owner.get();
|
||||
if (parent != null) {
|
||||
parent.removeOwnedWindow(weakThis);
|
||||
if (owner != null) {
|
||||
Window parent = owner.get();
|
||||
if (parent != null) {
|
||||
parent.removeOwnedWindow(weakThis);
|
||||
}
|
||||
}
|
||||
AppContext ac = context.get();
|
||||
if (null != ac) {
|
||||
@ -502,6 +513,8 @@ public class Window extends Container implements Accessible {
|
||||
}
|
||||
|
||||
modalExclusionType = Dialog.ModalExclusionType.NO_EXCLUDE;
|
||||
disposerRecord = new WindowDisposerRecord(appContext, this);
|
||||
sun.java2d.Disposer.addRecord(anchor, disposerRecord);
|
||||
|
||||
SunToolkit.checkAndSetPolicy(this);
|
||||
}
|
||||
@ -617,11 +630,16 @@ public class Window extends Container implements Accessible {
|
||||
this.parent = owner;
|
||||
if (owner != null) {
|
||||
owner.addOwnedWindow(weakThis);
|
||||
if (owner.isAlwaysOnTop()) {
|
||||
try {
|
||||
setAlwaysOnTop(true);
|
||||
} catch (SecurityException ignore) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Fix for 6758673: this call is moved here from init(gc), because
|
||||
// WindowDisposerRecord requires a proper value of parent field.
|
||||
Disposer.addRecord(anchor, new WindowDisposerRecord(appContext, this));
|
||||
disposerRecord.updateOwner();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1022,7 +1040,9 @@ public class Window extends Container implements Accessible {
|
||||
closeSplashScreen();
|
||||
Dialog.checkShouldBeBlocked(this);
|
||||
super.show();
|
||||
locationByPlatform = false;
|
||||
synchronized (getTreeLock()) {
|
||||
this.locationByPlatform = false;
|
||||
}
|
||||
for (int i = 0; i < ownedWindowList.size(); i++) {
|
||||
Window child = ownedWindowList.elementAt(i).get();
|
||||
if ((child != null) && child.showWithParent) {
|
||||
@ -1095,6 +1115,9 @@ public class Window extends Container implements Accessible {
|
||||
modalBlocker.unblockWindow(this);
|
||||
}
|
||||
super.hide();
|
||||
synchronized (getTreeLock()) {
|
||||
this.locationByPlatform = false;
|
||||
}
|
||||
}
|
||||
|
||||
final void clearMostRecentFocusOwnerOnHide() {
|
||||
@ -2180,8 +2203,8 @@ public class Window extends Container implements Accessible {
|
||||
* windows. To detect if always-on-top windows are supported by the
|
||||
* current platform, use {@link Toolkit#isAlwaysOnTopSupported()} and
|
||||
* {@link Window#isAlwaysOnTopSupported()}. If always-on-top mode
|
||||
* isn't supported by the toolkit or for this window, calling this
|
||||
* method has no effect.
|
||||
* isn't supported for this window or this window's toolkit does not
|
||||
* support always-on-top windows, calling this method has no effect.
|
||||
* <p>
|
||||
* If a SecurityManager is installed, the calling thread must be
|
||||
* granted the AWTPermission "setWindowAlwaysOnTop" in
|
||||
@ -2194,11 +2217,13 @@ public class Window extends Container implements Accessible {
|
||||
* windows
|
||||
* @throws SecurityException if the calling thread does not have
|
||||
* permission to set the value of always-on-top property
|
||||
*
|
||||
* @see #isAlwaysOnTop
|
||||
* @see #toFront
|
||||
* @see #toBack
|
||||
* @see AWTPermission
|
||||
* @see #isAlwaysOnTopSupported
|
||||
* @see #getToolkit
|
||||
* @see Toolkit#isAlwaysOnTopSupported
|
||||
* @since 1.5
|
||||
*/
|
||||
@ -2224,6 +2249,15 @@ public class Window extends Container implements Accessible {
|
||||
}
|
||||
firePropertyChange("alwaysOnTop", oldAlwaysOnTop, alwaysOnTop);
|
||||
}
|
||||
for (WeakReference<Window> ref : ownedWindowList) {
|
||||
Window window = ref.get();
|
||||
if (window != null) {
|
||||
try {
|
||||
window.setAlwaysOnTop(alwaysOnTop);
|
||||
} catch (SecurityException ignore) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2231,11 +2265,13 @@ public class Window extends Container implements Accessible {
|
||||
* window. Some platforms may not support always-on-top windows, some
|
||||
* may support only some kinds of top-level windows; for example,
|
||||
* a platform may not support always-on-top modal dialogs.
|
||||
* @return {@code true}, if the always-on-top mode is
|
||||
* supported by the toolkit and for this window,
|
||||
* {@code false}, if always-on-top mode is not supported
|
||||
* for this window or toolkit doesn't support always-on-top windows.
|
||||
*
|
||||
* @return {@code true}, if the always-on-top mode is supported for
|
||||
* this window and this window's toolkit supports always-on-top windows,
|
||||
* {@code false} otherwise
|
||||
*
|
||||
* @see #setAlwaysOnTop(boolean)
|
||||
* @see #getToolkit
|
||||
* @see Toolkit#isAlwaysOnTopSupported
|
||||
* @since 1.6
|
||||
*/
|
||||
@ -2774,6 +2810,7 @@ public class Window extends Container implements Accessible {
|
||||
void connectOwnedWindow(Window child) {
|
||||
child.parent = this;
|
||||
addOwnedWindow(child.weakThis);
|
||||
child.disposerRecord.updateOwner();
|
||||
}
|
||||
|
||||
private void addToWindowList() {
|
||||
@ -2936,7 +2973,8 @@ public class Window extends Container implements Accessible {
|
||||
weakThis = new WeakReference<>(this);
|
||||
|
||||
anchor = new Object();
|
||||
sun.java2d.Disposer.addRecord(anchor, new WindowDisposerRecord(appContext, this));
|
||||
disposerRecord = new WindowDisposerRecord(appContext, this);
|
||||
sun.java2d.Disposer.addRecord(anchor, disposerRecord);
|
||||
|
||||
addToWindowList();
|
||||
initGC(null);
|
||||
|
||||
@ -90,7 +90,7 @@ import sun.awt.datatransfer.DataTransferer;
|
||||
* the same results.
|
||||
* <p>
|
||||
* For more information on the using data transfer with Swing see
|
||||
* the <a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/dnd.html">
|
||||
* the <a href="http://docs.oracle.com/javase/tutorial/uiswing/dnd/index.html">
|
||||
* How to Use Drag and Drop and Data Transfer</a>,
|
||||
* section in <em>Java Tutorial</em>.
|
||||
*
|
||||
|
||||
@ -32,7 +32,7 @@ import java.io.IOException;
|
||||
* for a transfer operation.
|
||||
* <p>
|
||||
* For information on using data transfer with Swing, see
|
||||
* <a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/dnd.html">
|
||||
* <a href="http://docs.oracle.com/javase/tutorial/uiswing/dnd/index.html">
|
||||
* How to Use Drag and Drop and Data Transfer</a>,
|
||||
* a section in <em>The Java Tutorial</em>, for more information.
|
||||
*
|
||||
|
||||
@ -52,7 +52,7 @@ import java.lang.annotation.Native;
|
||||
* in the range from {@code ACTION_FIRST} to {@code ACTION_LAST}.
|
||||
*
|
||||
* @see ActionListener
|
||||
* @see <a href="http://java.sun.com/docs/books/tutorial/uiswing/events/actionlistener.html">Tutorial: How to Write an Action Listener</a>
|
||||
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/actionlistener.html">Tutorial: How to Write an Action Listener</a>
|
||||
*
|
||||
* @author Carl Quinn
|
||||
* @since 1.1
|
||||
|
||||
@ -37,7 +37,7 @@ import java.util.EventListener;
|
||||
* invoked.
|
||||
*
|
||||
* @see ActionEvent
|
||||
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/eventmodel.html">Tutorial: Java 1.1 Event Model</a>
|
||||
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/actionlistener.html">How to Write an Action Listener</a>
|
||||
*
|
||||
* @author Carl Quinn
|
||||
* @since 1.1
|
||||
|
||||
@ -44,7 +44,7 @@ package java.awt.event;
|
||||
*
|
||||
* @see ComponentEvent
|
||||
* @see ComponentListener
|
||||
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/componentlistener.html">Tutorial: Writing a Component Listener</a>
|
||||
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/componentlistener.html">Tutorial: Writing a Component Listener</a>
|
||||
*
|
||||
* @author Carl Quinn
|
||||
* @since 1.1
|
||||
|
||||
@ -60,7 +60,7 @@ import java.lang.annotation.Native;
|
||||
*
|
||||
* @see ComponentAdapter
|
||||
* @see ComponentListener
|
||||
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/componentlistener.html">Tutorial: Writing a Component Listener</a>
|
||||
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/componentlistener.html">Tutorial: Writing a Component Listener</a>
|
||||
*
|
||||
* @author Carl Quinn
|
||||
* @since 1.1
|
||||
|
||||
@ -46,7 +46,7 @@ import java.util.EventListener;
|
||||
*
|
||||
* @see ComponentAdapter
|
||||
* @see ComponentEvent
|
||||
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/componentlistener.html">Tutorial: Writing a Component Listener</a>
|
||||
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/componentlistener.html">Tutorial: Writing a Component Listener</a>
|
||||
*
|
||||
* @author Carl Quinn
|
||||
* @since 1.1
|
||||
|
||||
@ -44,7 +44,7 @@ package java.awt.event;
|
||||
*
|
||||
* @see ContainerEvent
|
||||
* @see ContainerListener
|
||||
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/containerlistener.html">Tutorial: Writing a Container Listener</a>
|
||||
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/containerlistener.html">Tutorial: Writing a Container Listener</a>
|
||||
*
|
||||
* @author Amy Fowler
|
||||
* @since 1.1
|
||||
|
||||
@ -52,7 +52,7 @@ import java.awt.Component;
|
||||
*
|
||||
* @see ContainerAdapter
|
||||
* @see ContainerListener
|
||||
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/containerlistener.html">Tutorial: Writing a Container Listener</a>
|
||||
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/containerlistener.html">Tutorial: Writing a Container Listener</a>
|
||||
*
|
||||
* @author Tim Prinzing
|
||||
* @author Amy Fowler
|
||||
|
||||
@ -46,7 +46,7 @@ import java.util.EventListener;
|
||||
*
|
||||
* @see ContainerAdapter
|
||||
* @see ContainerEvent
|
||||
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/containerlistener.html">Tutorial: Writing a Container Listener</a>
|
||||
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/containerlistener.html">Tutorial: Writing a Container Listener</a>
|
||||
*
|
||||
* @author Tim Prinzing
|
||||
* @author Amy Fowler
|
||||
|
||||
@ -44,7 +44,7 @@ package java.awt.event;
|
||||
*
|
||||
* @see FocusEvent
|
||||
* @see FocusListener
|
||||
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/focuslistener.html">Tutorial: Writing a Focus Listener</a>
|
||||
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/focuslistener.html">Tutorial: Writing a Focus Listener</a>
|
||||
*
|
||||
* @author Carl Quinn
|
||||
* @since 1.1
|
||||
|
||||
@ -57,7 +57,7 @@ import sun.awt.SunToolkit;
|
||||
*
|
||||
* @see FocusAdapter
|
||||
* @see FocusListener
|
||||
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/focuslistener.html">Tutorial: Writing a Focus Listener</a>
|
||||
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/focuslistener.html">Tutorial: Writing a Focus Listener</a>
|
||||
*
|
||||
* @author Carl Quinn
|
||||
* @author Amy Fowler
|
||||
|
||||
@ -42,7 +42,7 @@ import java.util.EventListener;
|
||||
*
|
||||
* @see FocusAdapter
|
||||
* @see FocusEvent
|
||||
* @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/focuslistener.html">Tutorial: Writing a Focus Listener</a>
|
||||
* @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/focuslistener.html">Tutorial: Writing a Focus Listener</a>
|
||||
*
|
||||
* @author Carl Quinn
|
||||
* @since 1.1
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user