提交 8a6dc55c 编写于 作者: M mduigou

Merge

...@@ -114,3 +114,5 @@ aa13e7702cd9d8aca9aa38f1227f966990866944 jdk7-b136 ...@@ -114,3 +114,5 @@ aa13e7702cd9d8aca9aa38f1227f966990866944 jdk7-b136
29296ea6529a418037ccce95903249665ef31c11 jdk7-b137 29296ea6529a418037ccce95903249665ef31c11 jdk7-b137
60d3d55dcc9c31a30ced9caa6ef5c0dcd7db031d jdk7-b138 60d3d55dcc9c31a30ced9caa6ef5c0dcd7db031d jdk7-b138
d80954a89b49fda47c0c5cace65a17f5a758b8bd jdk7-b139 d80954a89b49fda47c0c5cace65a17f5a758b8bd jdk7-b139
9315c733fb17ddfb9fb44be7e0ffea37bf3c727d jdk7-b140
63eeefe118da18c75ba3d36266768cd1ccaaca6b jdk7-b141
...@@ -354,7 +354,7 @@ HAVE_DPS = no ...@@ -354,7 +354,7 @@ HAVE_DPS = no
# Japanese manpages # Japanese manpages
# #
JA_SOURCE_ENCODING = eucJP JA_SOURCE_ENCODING = eucJP
JA_TARGET_ENCODINGS = eucJP JA_TARGET_ENCODINGS = UTF-8
# Settings for the JDI - Serviceability Agent binding. # Settings for the JDI - Serviceability Agent binding.
HOTSPOT_SALIB_PATH = $(HOTSPOT_IMPORT_PATH)/jre/lib/$(LIBARCH) HOTSPOT_SALIB_PATH = $(HOTSPOT_IMPORT_PATH)/jre/lib/$(LIBARCH)
......
...@@ -55,10 +55,13 @@ program_default_rule: all ...@@ -55,10 +55,13 @@ program_default_rule: all
program: $(ACTUAL_PROGRAM) program: $(ACTUAL_PROGRAM)
# reuse the mapfiles in the launcher's directory, the same should # Work-around for missing processor specific mapfiles
# be applicable to the tool launchers as well. ifndef CROSS_COMPILE_ARCH
FILES_m = $(BUILDDIR)/java/main/java/mapfile-$(ARCH) # reuse the mapfiles in the launcher's directory, the same should
include $(BUILDDIR)/common/Mapfile-vers.gmk # be applicable to the tool launchers as well.
FILES_m = $(BUILDDIR)/java/main/java/mapfile-$(ARCH)
include $(BUILDDIR)/common/Mapfile-vers.gmk
endif
include $(JDK_TOPDIR)/make/common/Rules.gmk include $(JDK_TOPDIR)/make/common/Rules.gmk
......
...@@ -164,7 +164,7 @@ endif # solaris ...@@ -164,7 +164,7 @@ endif # solaris
ifeq ($(PLATFORM), linux) ifeq ($(PLATFORM), linux)
MANBASEDIRS=$(JDK_TOPDIR)/src/linux/doc $(IMPORTDOCDIR) MANBASEDIRS=$(JDK_TOPDIR)/src/linux/doc $(IMPORTDOCDIR)
MAN1SUBDIR=man MAN1SUBDIR=man
JA_DIRNAME=ja_JP.$(JA_SOURCE_ENCODING) JA_DIRNAME=ja_JP.UTF-8
endif # linux endif # linux
define copy-man-pages define copy-man-pages
...@@ -190,8 +190,7 @@ for manbase in $(MANBASEDIRS:%=%/$(MAN1SUBDIR)) ; do \ ...@@ -190,8 +190,7 @@ for manbase in $(MANBASEDIRS:%=%/$(MAN1SUBDIR)) ; do \
done done
$(java-vm-cleanup) $(java-vm-cleanup)
if [ "$(JA_DIRNAME)" != "" ] ; then \ if [ "$(JA_DIRNAME)" != "" ] ; then \
$(MV) $1/man/ja $1/man/$(JA_DIRNAME); \ $(CD) $1/man && $(RM) ja && $(LN) -s $(JA_DIRNAME) ja; \
$(CD) $1/man && $(LN) -s $(JA_DIRNAME) ja; \
fi fi
endef endef
......
...@@ -109,6 +109,8 @@ FMT = $(UTILS_COMMAND_PATH)fmt ...@@ -109,6 +109,8 @@ FMT = $(UTILS_COMMAND_PATH)fmt
GDB = $(UTILS_USR_BIN_PATH)gdb GDB = $(UTILS_USR_BIN_PATH)gdb
GREP = $(UTILS_COMMAND_PATH)grep GREP = $(UTILS_COMMAND_PATH)grep
GUNZIP = $(UTILS_COMMAND_PATH)gunzip GUNZIP = $(UTILS_COMMAND_PATH)gunzip
# GZIP is used for solaris. Linux and windows use tar czf
GZIP = $(UTILS_COMMAND_PATH)gzip
HEAD = $(UTILS_USR_BIN_PATH)head HEAD = $(UTILS_USR_BIN_PATH)head
HG = hg HG = hg
ID = $(UTILS_COMMAND_PATH)id ID = $(UTILS_COMMAND_PATH)id
......
...@@ -72,10 +72,6 @@ endif ...@@ -72,10 +72,6 @@ endif
# REQUIRED_DXSDK_VER # REQUIRED_DXSDK_VER
# Windows only: The version of DirectX SDK expected. # Windows only: The version of DirectX SDK expected.
# #
# REQUIRED_FREE_SPACE
# The minimum disk space needed as determined by running 'du -sk' on a fully
# built workspace.
#
# REQUIRED_FREETYPE_VERSION # REQUIRED_FREETYPE_VERSION
# If we are using freetype, the freetype version expected. # If we are using freetype, the freetype version expected.
# #
...@@ -131,11 +127,6 @@ ifeq ($(PLATFORM), solaris) ...@@ -131,11 +127,6 @@ ifeq ($(PLATFORM), solaris)
REQUIRED_OS_VERSION = 5.10 REQUIRED_OS_VERSION = 5.10
REQUIRED_OS_VARIANT_NAME = Solaris REQUIRED_OS_VARIANT_NAME = Solaris
REQUIRED_OS_VARIANT_VERSION = $(REQUIRED_OS_VERSION) REQUIRED_OS_VARIANT_VERSION = $(REQUIRED_OS_VERSION)
ifeq ($(ARCH_FAMILY), sparc)
REQUIRED_FREE_SPACE = 1300000
else
REQUIRED_FREE_SPACE = 1040000
endif
REQUIRED_COMPILER_NAME = Sun Studio 12 Update 1 REQUIRED_COMPILER_NAME = Sun Studio 12 Update 1
REQUIRED_COMPILER_VERSION = SS12u1 REQUIRED_COMPILER_VERSION = SS12u1
# Cross-compilation compiler versions are target specific # Cross-compilation compiler versions are target specific
...@@ -157,7 +148,6 @@ ifeq ($(PLATFORM), linux) ...@@ -157,7 +148,6 @@ ifeq ($(PLATFORM), linux)
REQUIRED_OS_VERSION = 2.6 REQUIRED_OS_VERSION = 2.6
REQUIRED_OS_VARIANT_NAME = Fedora REQUIRED_OS_VARIANT_NAME = Fedora
REQUIRED_OS_VARIANT_VERSION = 9 REQUIRED_OS_VARIANT_VERSION = 9
REQUIRED_FREE_SPACE = 1460000
REQUIRED_ALSA_VERSION = 0.9.1 REQUIRED_ALSA_VERSION = 0.9.1
REQUIRED_COMPILER_NAME = GCC4 REQUIRED_COMPILER_NAME = GCC4
REQUIRED_COMPILER_VERSION = GCC4 REQUIRED_COMPILER_VERSION = GCC4
...@@ -187,7 +177,6 @@ ifeq ($(PLATFORM), windows) ...@@ -187,7 +177,6 @@ ifeq ($(PLATFORM), windows)
REQUIRED_OS_VARIANT_VERSION = $(REQUIRED_OS_VERSION) REQUIRED_OS_VARIANT_VERSION = $(REQUIRED_OS_VERSION)
REQUIRED_CYGWIN_VER = 4.0 REQUIRED_CYGWIN_VER = 4.0
REQUIRED_MKS_VER = 6.1 REQUIRED_MKS_VER = 6.1
REQUIRED_FREE_SPACE = 500000
REQUIRED_DXSDK_VER = 0x0900 REQUIRED_DXSDK_VER = 0x0900
ifeq ($(CC_VERSION),msvc) ifeq ($(CC_VERSION),msvc)
REQUIRED_COMPILER_NAME = Visual Studio 10 REQUIRED_COMPILER_NAME = Visual Studio 10
......
...@@ -192,8 +192,6 @@ endif ...@@ -192,8 +192,6 @@ endif
ALL_SETTINGS+=$(call addRequiredVersionSetting,OS_VERSION) ALL_SETTINGS+=$(call addRequiredVersionSetting,OS_VERSION)
ALL_SETTINGS+=$(call addOptionalSetting,OS_VARIANT_NAME) ALL_SETTINGS+=$(call addOptionalSetting,OS_VARIANT_NAME)
ALL_SETTINGS+=$(call addOptionalSetting,OS_VARIANT_VERSION) ALL_SETTINGS+=$(call addOptionalSetting,OS_VARIANT_VERSION)
ALL_SETTINGS+=$(call addRequiredSetting,TEMP_FREE_SPACE)
ALL_SETTINGS+=$(call addRequiredSetting,FREE_SPACE)
ALL_SETTINGS+=$(call addRequiredSetting,MB_OF_MEMORY) ALL_SETTINGS+=$(call addRequiredSetting,MB_OF_MEMORY)
......
...@@ -69,8 +69,6 @@ endef ...@@ -69,8 +69,6 @@ endef
# Settings and rules to validate the JDK build environment. # Settings and rules to validate the JDK build environment.
ifeq ($(PLATFORM), solaris) ifeq ($(PLATFORM), solaris)
FREE_SPACE := $(shell $(DF) -b $(OUTPUTDIR) | $(TAIL) -1 | $(NAWK) '{print $$2;}')
TEMP_FREE_SPACE := $(shell $(DF) -b $(TEMP_DISK) | $(TAIL) -1 | $(NAWK) '{print $$2;}')
# What kind of system we are using (Variations are Solaris and OpenSolaris) # What kind of system we are using (Variations are Solaris and OpenSolaris)
OS_VERSION := $(shell uname -r) OS_VERSION := $(shell uname -r)
OS_VARIANT_NAME := $(strip $(shell head -1 /etc/release | awk '{print $$1;}') ) OS_VARIANT_NAME := $(strip $(shell head -1 /etc/release | awk '{print $$1;}') )
...@@ -88,8 +86,6 @@ ifeq ($(PLATFORM), solaris) ...@@ -88,8 +86,6 @@ ifeq ($(PLATFORM), solaris)
endif endif
ifeq ($(PLATFORM), linux) ifeq ($(PLATFORM), linux)
FREE_SPACE := $(shell $(DF) --sync -kP $(OUTPUTDIR) | $(TAIL) -1 | $(NAWK) '{print $$4;}')
TEMP_FREE_SPACE := $(shell $(DF) --sync -kP $(TEMP_DISK) | $(TAIL) -1 | $(NAWK) '{print $$4;}')
# What kind of system we are using (Variation is the Linux vendor) # What kind of system we are using (Variation is the Linux vendor)
OS_VERSION := $(shell uname -r) OS_VERSION := $(shell uname -r)
OS_VARIANT_NAME := $(shell \ OS_VARIANT_NAME := $(shell \
...@@ -118,8 +114,6 @@ ifeq ($(PLATFORM), linux) ...@@ -118,8 +114,6 @@ ifeq ($(PLATFORM), linux)
endif endif
ifeq ($(PLATFORM), windows) ifeq ($(PLATFORM), windows)
FREE_SPACE := $(shell $(DF) -kP $(OUTPUTDIR) | $(TAIL) -1 | $(NAWK) '{print $$4;}')
TEMP_FREE_SPACE := $(shell $(DF) -kP $(TEMP_DISK) | $(TAIL) -1 | $(NAWK) '{print $$4;}')
# Windows 2000 is 5.0, Windows XP is 5.1, Windows 2003 is 5.2 # Windows 2000 is 5.0, Windows XP is 5.1, Windows 2003 is 5.2
# Assume 5.0 (Windows 2000) if systeminfo does not help # Assume 5.0 (Windows 2000) if systeminfo does not help
WINDOWS_MAPPING-5.0 := Windows2000 WINDOWS_MAPPING-5.0 := Windows2000
...@@ -715,18 +709,6 @@ sane-outputdir: ...@@ -715,18 +709,6 @@ sane-outputdir:
" Either obtain these permissions or set ALT_OUTPUTDIR. \n" \ " Either obtain these permissions or set ALT_OUTPUTDIR. \n" \
"" >> $(ERROR_FILE) ; \ "" >> $(ERROR_FILE) ; \
fi fi
@#
@# OUTPUTDIR must have enough free space...
@#
@if [ $(FREE_SPACE) -lt $(REQUIRED_FREE_SPACE) ]; then \
$(ECHO) "WARNING: You may not have enough free space in your OUTPUTDIR. The \n" \
" current value of OUTPUTDIR is \n" \
" $(OUTPUTDIR) \n" \
" You need "$(REQUIRED_FREE_SPACE)" Kbytes free on this device to build \n" \
" and it appears that only "$(FREE_SPACE)" Kbytes are free. \n" \
" Either obtain more space or set ALT_OUTPUTDIR to a larger disk. \n" \
"" >> $(WARNING_FILE) ; \
fi
###################################################### ######################################################
# if specified, ALT_BOOTDIR must point to non-relative path if set # if specified, ALT_BOOTDIR must point to non-relative path if set
......
...@@ -21,4 +21,4 @@ ...@@ -21,4 +21,4 @@
# or visit www.oracle.com if you need additional information or have any # or visit www.oracle.com if you need additional information or have any
# questions. # questions.
# #
tzdata2011e tzdata2011g
...@@ -234,7 +234,21 @@ Rule Egypt 1989 only - May 6 1:00 1:00 S ...@@ -234,7 +234,21 @@ Rule Egypt 1989 only - May 6 1:00 1:00 S
Rule Egypt 1990 1994 - May 1 1:00 1:00 S Rule Egypt 1990 1994 - May 1 1:00 1:00 S
# IATA (after 1990) says transitions are at 0:00. # IATA (after 1990) says transitions are at 0:00.
# Go with IATA starting in 1995, except correct 1995 entry from 09-30 to 09-29. # Go with IATA starting in 1995, except correct 1995 entry from 09-30 to 09-29.
Rule Egypt 1995 max - Apr lastFri 0:00s 1:00 S
# From Alexander Krivenyshev (2011-04-20):
# "...Egypt's interim cabinet decided on Wednesday to cancel daylight
# saving time after a poll posted on its website showed the majority of
# Egyptians would approve the cancellation."
#
# Egypt to cancel daylight saving time
# <a href="http://www.almasryalyoum.com/en/node/407168">
# http://www.almasryalyoum.com/en/node/407168
# </a>
# or
# <a href="http://www.worldtimezone.com/dst_news/dst_news_egypt04.html">
# http://www.worldtimezone.com/dst_news/dst_news_egypt04.html
# </a>
Rule Egypt 1995 2010 - Apr lastFri 0:00s 1:00 S
Rule Egypt 1995 2005 - Sep lastThu 23:00s 0 - Rule Egypt 1995 2005 - Sep lastThu 23:00s 0 -
# From Steffen Thorsen (2006-09-19): # From Steffen Thorsen (2006-09-19):
# The Egyptian Gazette, issue 41,090 (2006-09-18), page 1, reports: # The Egyptian Gazette, issue 41,090 (2006-09-18), page 1, reports:
...@@ -335,7 +349,7 @@ Rule Egypt 2008 only - Aug lastThu 23:00s 0 - ...@@ -335,7 +349,7 @@ Rule Egypt 2008 only - Aug lastThu 23:00s 0 -
Rule Egypt 2009 only - Aug 20 23:00s 0 - Rule Egypt 2009 only - Aug 20 23:00s 0 -
Rule Egypt 2010 only - Aug 11 0:00 0 - Rule Egypt 2010 only - Aug 11 0:00 0 -
Rule Egypt 2010 only - Sep 10 0:00 1:00 S Rule Egypt 2010 only - Sep 10 0:00 1:00 S
Rule Egypt 2010 max - Sep lastThu 23:00s 0 - Rule Egypt 2010 only - Sep lastThu 23:00s 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Cairo 2:05:00 - LMT 1900 Oct Zone Africa/Cairo 2:05:00 - LMT 1900 Oct
......
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
# A monument to Willett was unveiled on 1927-05-21, in an open space in # A monument to Willett was unveiled on 1927-05-21, in an open space in
# a 45-acre wood near Chislehurst, Kent that was purchased by popular # a 45-acre wood near Chislehurst, Kent that was purchased by popular
# subscription and open to the public. On the south face of the monolith, # subscription and open to the public. On the south face of the monolith,
# designed by G. W. Miller, is the the William Willett Memorial Sundial, # designed by G. W. Miller, is the...William Willett Memorial Sundial,
# which is permanently set to Summer Time. # which is permanently set to Summer Time.
# From Winston Churchill (1934-04-28): # From Winston Churchill (1934-04-28):
...@@ -1808,7 +1808,7 @@ Zone Europe/Oslo 0:43:00 - LMT 1895 Jan 1 ...@@ -1808,7 +1808,7 @@ Zone Europe/Oslo 0:43:00 - LMT 1895 Jan 1
# #
# All these events predate our cutoff date of 1970. Unless we can # All these events predate our cutoff date of 1970. Unless we can
# come up with more definitive info about the timekeeping during the # come up with more definitive info about the timekeeping during the
# war years it's probably best just do do the following for now: # war years it's probably best just do...the following for now:
Link Europe/Oslo Arctic/Longyearbyen Link Europe/Oslo Arctic/Longyearbyen
# Poland # Poland
......
...@@ -767,7 +767,7 @@ Zone America/La_Paz -4:32:36 - LMT 1890 ...@@ -767,7 +767,7 @@ Zone America/La_Paz -4:32:36 - LMT 1890
# #
# As a result of the above Decree I believe the America/Rio_Branco # As a result of the above Decree I believe the America/Rio_Branco
# timezone shall be modified from UTC-5 to UTC-4 and a new timezone shall # timezone shall be modified from UTC-5 to UTC-4 and a new timezone shall
# be created to represent the the west side of the Para State. I # be created to represent the...west side of the Para State. I
# suggest this new timezone be called Santarem as the most # suggest this new timezone be called Santarem as the most
# important/populated city in the affected area. # important/populated city in the affected area.
# #
...@@ -1365,6 +1365,24 @@ Zone Pacific/Galapagos -5:58:24 - LMT 1931 # Puerto Baquerizo Moreno ...@@ -1365,6 +1365,24 @@ Zone Pacific/Galapagos -5:58:24 - LMT 1931 # Puerto Baquerizo Moreno
# For now, we'll just record the time in Stanley, since we have no # For now, we'll just record the time in Stanley, since we have no
# better info. # better info.
# From Steffen Thorsen (2011-04-01):
# The Falkland Islands will not turn back clocks this winter, but stay on
# daylight saving time.
#
# One source:
# <a href="http://www.falklandnews.com/public/story.cfm?get=5914&source=3">
# http://www.falklandnews.com/public/story.cfm?get=5914&source=3
# </a>
#
# We have gotten this confirmed by a clerk of the legislative assembly:
# Normally the clocks revert to Local Mean Time (UTC/GMT -4 hours) on the
# third Sunday of April at 0200hrs and advance to Summer Time (UTC/GMT -3
# hours) on the first Sunday of September at 0200hrs.
#
# IMPORTANT NOTE: During 2011, on a trial basis, the Falkland Islands
# will not revert to local mean time, but clocks will remain on Summer
# time (UTC/GMT - 3 hours) throughout the whole of 2011. Any long term
# change to local time following the trial period will be notified.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Falk 1937 1938 - Sep lastSun 0:00 1:00 S Rule Falk 1937 1938 - Sep lastSun 0:00 1:00 S
Rule Falk 1938 1942 - Mar Sun>=19 0:00 0 - Rule Falk 1938 1942 - Mar Sun>=19 0:00 0 -
...@@ -1376,7 +1394,8 @@ Rule Falk 1984 1985 - Apr lastSun 0:00 0 - ...@@ -1376,7 +1394,8 @@ Rule Falk 1984 1985 - Apr lastSun 0:00 0 -
Rule Falk 1984 only - Sep 16 0:00 1:00 S Rule Falk 1984 only - Sep 16 0:00 1:00 S
Rule Falk 1985 2000 - Sep Sun>=9 0:00 1:00 S Rule Falk 1985 2000 - Sep Sun>=9 0:00 1:00 S
Rule Falk 1986 2000 - Apr Sun>=16 0:00 0 - Rule Falk 1986 2000 - Apr Sun>=16 0:00 0 -
Rule Falk 2001 max - Apr Sun>=15 2:00 0 - Rule Falk 2001 2010 - Apr Sun>=15 2:00 0 -
Rule Falk 2012 max - Apr Sun>=15 2:00 0 -
Rule Falk 2001 max - Sep Sun>=1 2:00 1:00 S Rule Falk 2001 max - Sep Sun>=1 2:00 1:00 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Atlantic/Stanley -3:51:24 - LMT 1890 Zone Atlantic/Stanley -3:51:24 - LMT 1890
......
...@@ -56,9 +56,9 @@ FileChooser.deleteFileButtonMnemonic=76 ...@@ -56,9 +56,9 @@ FileChooser.deleteFileButtonMnemonic=76
FileChooser.renameFileButtonText=Rename File FileChooser.renameFileButtonText=Rename File
FileChooser.renameFileButtonMnemonic=82 FileChooser.renameFileButtonMnemonic=82
FileChooser.cancelButtonText=Cancel FileChooser.cancelButtonText=Cancel
FileChooser.cancelButtonMnemonic=67 #FileChooser.cancelButtonMnemonic=67
FileChooser.saveButtonText=OK FileChooser.saveButtonText=OK
FileChooser.saveButtonMnemonic=79 #FileChooser.saveButtonMnemonic=79
FileChooser.openButtonText=OK FileChooser.openButtonText=OK
FileChooser.openButtonMnemonic=79 FileChooser.openButtonMnemonic=79
FileChooser.saveDialogTitleText=Save FileChooser.saveDialogTitleText=Save
...@@ -79,9 +79,5 @@ FileChooser.renameFileDialogText=Rename file "{0}" to ...@@ -79,9 +79,5 @@ FileChooser.renameFileDialogText=Rename file "{0}" to
FileChooser.renameFileErrorTitle=Error FileChooser.renameFileErrorTitle=Error
FileChooser.renameFileErrorText=Error renaming file "{0}" to "{1}" FileChooser.renameFileErrorText=Error renaming file "{0}" to "{1}"
# dummy resource added for translation automation #OptionPane.okButtonMnemonic=79
OptionPane.okButtonText=OK #OptionPane.cancelButtonMnemonic=67
OptionPane.okButtonMnemonic=79
# dummy resource added for translation automation
OptionPane.cancelButtonText=Cancel
OptionPane.cancelButtonMnemonic=67
...@@ -24,7 +24,7 @@ GTKColorChooserPanel.hueText=Farbton: ...@@ -24,7 +24,7 @@ GTKColorChooserPanel.hueText=Farbton:
GTKColorChooserPanel.hueMnemonic=70 GTKColorChooserPanel.hueMnemonic=70
GTKColorChooserPanel.redText=Rot: GTKColorChooserPanel.redText=Rot:
GTKColorChooserPanel.redMnemonic=79 GTKColorChooserPanel.redMnemonic=82
GTKColorChooserPanel.saturationText=S\u00E4ttigung: GTKColorChooserPanel.saturationText=S\u00E4ttigung:
GTKColorChooserPanel.saturationMnemonic=83 GTKColorChooserPanel.saturationMnemonic=83
......
...@@ -30,7 +30,7 @@ GTKColorChooserPanel.saturationText=Saturaci\u00F3n: ...@@ -30,7 +30,7 @@ GTKColorChooserPanel.saturationText=Saturaci\u00F3n:
GTKColorChooserPanel.saturationMnemonic=83 GTKColorChooserPanel.saturationMnemonic=83
GTKColorChooserPanel.greenText=Verde: GTKColorChooserPanel.greenText=Verde:
GTKColorChooserPanel.greenMnemonic=86 GTKColorChooserPanel.greenMnemonic=69
GTKColorChooserPanel.valueText=Valor: GTKColorChooserPanel.valueText=Valor:
GTKColorChooserPanel.valueMnemonic=86 GTKColorChooserPanel.valueMnemonic=86
......
...@@ -30,7 +30,7 @@ GTKColorChooserPanel.saturationText=Saturation : ...@@ -30,7 +30,7 @@ GTKColorChooserPanel.saturationText=Saturation :
GTKColorChooserPanel.saturationMnemonic=83 GTKColorChooserPanel.saturationMnemonic=83
GTKColorChooserPanel.greenText=Vert : GTKColorChooserPanel.greenText=Vert :
GTKColorChooserPanel.greenMnemonic=86 GTKColorChooserPanel.greenMnemonic=69
GTKColorChooserPanel.valueText=Valeur : GTKColorChooserPanel.valueText=Valeur :
GTKColorChooserPanel.valueMnemonic=86 GTKColorChooserPanel.valueMnemonic=86
......
...@@ -30,7 +30,7 @@ GTKColorChooserPanel.saturationText=Saturazione: ...@@ -30,7 +30,7 @@ GTKColorChooserPanel.saturationText=Saturazione:
GTKColorChooserPanel.saturationMnemonic=83 GTKColorChooserPanel.saturationMnemonic=83
GTKColorChooserPanel.greenText=Verde: GTKColorChooserPanel.greenText=Verde:
GTKColorChooserPanel.greenMnemonic=86 GTKColorChooserPanel.greenMnemonic=69
GTKColorChooserPanel.valueText=Valore: GTKColorChooserPanel.valueText=Valore:
GTKColorChooserPanel.valueMnemonic=86 GTKColorChooserPanel.valueMnemonic=86
......
...@@ -55,11 +55,11 @@ FileChooser.deleteFileButtonText=\u30D5\u30A1\u30A4\u30EB\u306E\u524A\u9664(L) ...@@ -55,11 +55,11 @@ FileChooser.deleteFileButtonText=\u30D5\u30A1\u30A4\u30EB\u306E\u524A\u9664(L)
FileChooser.deleteFileButtonMnemonic=76 FileChooser.deleteFileButtonMnemonic=76
FileChooser.renameFileButtonText=\u30D5\u30A1\u30A4\u30EB\u306E\u540D\u524D\u5909\u66F4(R) FileChooser.renameFileButtonText=\u30D5\u30A1\u30A4\u30EB\u306E\u540D\u524D\u5909\u66F4(R)
FileChooser.renameFileButtonMnemonic=82 FileChooser.renameFileButtonMnemonic=82
FileChooser.cancelButtonText=\u53D6\u6D88(C) FileChooser.cancelButtonText=\u53D6\u6D88
FileChooser.cancelButtonMnemonic=67 FileChooser.cancelButtonMnemonic=67
FileChooser.saveButtonText=OK(O) FileChooser.saveButtonText=OK
FileChooser.saveButtonMnemonic=79 FileChooser.saveButtonMnemonic=79
FileChooser.openButtonText=OK(O) FileChooser.openButtonText=OK
FileChooser.openButtonMnemonic=79 FileChooser.openButtonMnemonic=79
FileChooser.saveDialogTitleText=\u4FDD\u5B58 FileChooser.saveDialogTitleText=\u4FDD\u5B58
FileChooser.openDialogTitleText=\u958B\u304F FileChooser.openDialogTitleText=\u958B\u304F
...@@ -79,10 +79,6 @@ FileChooser.renameFileDialogText=\u30D5\u30A1\u30A4\u30EB"{0}"\u3092\u6B21\u306E ...@@ -79,10 +79,6 @@ FileChooser.renameFileDialogText=\u30D5\u30A1\u30A4\u30EB"{0}"\u3092\u6B21\u306E
FileChooser.renameFileErrorTitle=\u30A8\u30E9\u30FC FileChooser.renameFileErrorTitle=\u30A8\u30E9\u30FC
FileChooser.renameFileErrorText=\u30D5\u30A1\u30A4\u30EB"{0}"\u306E"{1}"\u3078\u306E\u5909\u66F4\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F FileChooser.renameFileErrorText=\u30D5\u30A1\u30A4\u30EB"{0}"\u306E"{1}"\u3078\u306E\u5909\u66F4\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F
# dummy resource added for translation automation #OptionPane.okButtonMnemonic=79
OptionPane.okButtonText=OK(O) #OptionPane.cancelButtonMnemonic=67
OptionPane.okButtonMnemonic=79
# dummy resource added for translation automation
OptionPane.cancelButtonText=\u53D6\u6D88(C)
OptionPane.cancelButtonMnemonic=67
...@@ -55,11 +55,11 @@ FileChooser.deleteFileButtonText=\uD30C\uC77C \uC0AD\uC81C(L) ...@@ -55,11 +55,11 @@ FileChooser.deleteFileButtonText=\uD30C\uC77C \uC0AD\uC81C(L)
FileChooser.deleteFileButtonMnemonic=76 FileChooser.deleteFileButtonMnemonic=76
FileChooser.renameFileButtonText=\uD30C\uC77C \uC774\uB984 \uBC14\uAFB8\uAE30(R) FileChooser.renameFileButtonText=\uD30C\uC77C \uC774\uB984 \uBC14\uAFB8\uAE30(R)
FileChooser.renameFileButtonMnemonic=82 FileChooser.renameFileButtonMnemonic=82
FileChooser.cancelButtonText=\uCDE8\uC18C(C) FileChooser.cancelButtonText=\uCDE8\uC18C
FileChooser.cancelButtonMnemonic=67 FileChooser.cancelButtonMnemonic=67
FileChooser.saveButtonText=\uD655\uC778(O) FileChooser.saveButtonText=\uD655\uC778
FileChooser.saveButtonMnemonic=79 FileChooser.saveButtonMnemonic=79
FileChooser.openButtonText=\uD655\uC778(O) FileChooser.openButtonText=\uD655\uC778
FileChooser.openButtonMnemonic=79 FileChooser.openButtonMnemonic=79
FileChooser.saveDialogTitleText=\uC800\uC7A5 FileChooser.saveDialogTitleText=\uC800\uC7A5
FileChooser.openDialogTitleText=\uC5F4\uAE30 FileChooser.openDialogTitleText=\uC5F4\uAE30
...@@ -79,10 +79,6 @@ FileChooser.renameFileDialogText="{0}" \uD30C\uC77C\uC758 \uC774\uB984 \uBC14\uA ...@@ -79,10 +79,6 @@ FileChooser.renameFileDialogText="{0}" \uD30C\uC77C\uC758 \uC774\uB984 \uBC14\uA
FileChooser.renameFileErrorTitle=\uC624\uB958 FileChooser.renameFileErrorTitle=\uC624\uB958
FileChooser.renameFileErrorText="{0}" \uD30C\uC77C\uC758 \uC774\uB984\uC744 "{1}"(\uC73C)\uB85C \uBC14\uAFB8\uB294 \uC911 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. FileChooser.renameFileErrorText="{0}" \uD30C\uC77C\uC758 \uC774\uB984\uC744 "{1}"(\uC73C)\uB85C \uBC14\uAFB8\uB294 \uC911 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4.
# dummy resource added for translation automation #OptionPane.okButtonMnemonic=79
OptionPane.okButtonText=\uD655\uC778(O) #OptionPane.cancelButtonMnemonic=67
OptionPane.okButtonMnemonic=79
# dummy resource added for translation automation
OptionPane.cancelButtonText=\uCDE8\uC18C(C)
OptionPane.cancelButtonMnemonic=67
...@@ -30,7 +30,7 @@ GTKColorChooserPanel.saturationText=Satura\u00E7\u00E3o: ...@@ -30,7 +30,7 @@ GTKColorChooserPanel.saturationText=Satura\u00E7\u00E3o:
GTKColorChooserPanel.saturationMnemonic=83 GTKColorChooserPanel.saturationMnemonic=83
GTKColorChooserPanel.greenText=Verde: GTKColorChooserPanel.greenText=Verde:
GTKColorChooserPanel.greenMnemonic=86 GTKColorChooserPanel.greenMnemonic=68
GTKColorChooserPanel.valueText=Valor: GTKColorChooserPanel.valueText=Valor:
GTKColorChooserPanel.valueMnemonic=86 GTKColorChooserPanel.valueMnemonic=86
......
...@@ -39,7 +39,7 @@ GTKColorChooserPanel.blueText=Bl\u00E5: ...@@ -39,7 +39,7 @@ GTKColorChooserPanel.blueText=Bl\u00E5:
GTKColorChooserPanel.blueMnemonic=66 GTKColorChooserPanel.blueMnemonic=66
GTKColorChooserPanel.colorNameText=F\u00E4rgnamn: GTKColorChooserPanel.colorNameText=F\u00E4rgnamn:
GTKColorChooserPanel.colorNameMnemonic=78 GTKColorChooserPanel.colorNameMnemonic=70
......
...@@ -55,11 +55,11 @@ FileChooser.deleteFileButtonText=\u5220\u9664\u6587\u4EF6(L) ...@@ -55,11 +55,11 @@ FileChooser.deleteFileButtonText=\u5220\u9664\u6587\u4EF6(L)
FileChooser.deleteFileButtonMnemonic=76 FileChooser.deleteFileButtonMnemonic=76
FileChooser.renameFileButtonText=\u91CD\u547D\u540D\u6587\u4EF6(R) FileChooser.renameFileButtonText=\u91CD\u547D\u540D\u6587\u4EF6(R)
FileChooser.renameFileButtonMnemonic=82 FileChooser.renameFileButtonMnemonic=82
FileChooser.cancelButtonText=\u53D6\u6D88(C) FileChooser.cancelButtonText=\u53D6\u6D88
FileChooser.cancelButtonMnemonic=67 FileChooser.cancelButtonMnemonic=67
FileChooser.saveButtonText=\u786E\u5B9A(O) FileChooser.saveButtonText=\u786E\u5B9A
FileChooser.saveButtonMnemonic=79 FileChooser.saveButtonMnemonic=79
FileChooser.openButtonText=\u786E\u5B9A(O) FileChooser.openButtonText=\u786E\u5B9A
FileChooser.openButtonMnemonic=79 FileChooser.openButtonMnemonic=79
FileChooser.saveDialogTitleText=\u4FDD\u5B58 FileChooser.saveDialogTitleText=\u4FDD\u5B58
FileChooser.openDialogTitleText=\u6253\u5F00 FileChooser.openDialogTitleText=\u6253\u5F00
...@@ -79,10 +79,6 @@ FileChooser.renameFileDialogText=\u5C06\u6587\u4EF6 "{0}" \u91CD\u547D\u540D\u4E ...@@ -79,10 +79,6 @@ FileChooser.renameFileDialogText=\u5C06\u6587\u4EF6 "{0}" \u91CD\u547D\u540D\u4E
FileChooser.renameFileErrorTitle=\u9519\u8BEF FileChooser.renameFileErrorTitle=\u9519\u8BEF
FileChooser.renameFileErrorText=\u5C06\u6587\u4EF6 "{0}" \u91CD\u547D\u540D\u4E3A "{1}" \u65F6\u51FA\u9519 FileChooser.renameFileErrorText=\u5C06\u6587\u4EF6 "{0}" \u91CD\u547D\u540D\u4E3A "{1}" \u65F6\u51FA\u9519
# dummy resource added for translation automation #OptionPane.okButtonMnemonic=79
OptionPane.okButtonText=\u786E\u5B9A(O) #OptionPane.cancelButtonMnemonic=67
OptionPane.okButtonMnemonic=79
# dummy resource added for translation automation
OptionPane.cancelButtonText=\u53D6\u6D88(C)
OptionPane.cancelButtonMnemonic=67
...@@ -55,11 +55,11 @@ FileChooser.deleteFileButtonText=\u522A\u9664\u6A94\u6848(L) ...@@ -55,11 +55,11 @@ FileChooser.deleteFileButtonText=\u522A\u9664\u6A94\u6848(L)
FileChooser.deleteFileButtonMnemonic=76 FileChooser.deleteFileButtonMnemonic=76
FileChooser.renameFileButtonText=\u91CD\u65B0\u547D\u540D\u6A94\u6848(R) FileChooser.renameFileButtonText=\u91CD\u65B0\u547D\u540D\u6A94\u6848(R)
FileChooser.renameFileButtonMnemonic=82 FileChooser.renameFileButtonMnemonic=82
FileChooser.cancelButtonText=\u53D6\u6D88(C) FileChooser.cancelButtonText=\u53D6\u6D88
FileChooser.cancelButtonMnemonic=67 FileChooser.cancelButtonMnemonic=67
FileChooser.saveButtonText=\u78BA\u5B9A(O) FileChooser.saveButtonText=\u78BA\u5B9A
FileChooser.saveButtonMnemonic=79 FileChooser.saveButtonMnemonic=79
FileChooser.openButtonText=\u78BA\u5B9A(O) FileChooser.openButtonText=\u78BA\u5B9A
FileChooser.openButtonMnemonic=79 FileChooser.openButtonMnemonic=79
FileChooser.saveDialogTitleText=\u5132\u5B58 FileChooser.saveDialogTitleText=\u5132\u5B58
FileChooser.openDialogTitleText=\u958B\u555F FileChooser.openDialogTitleText=\u958B\u555F
...@@ -79,10 +79,6 @@ FileChooser.renameFileDialogText=\u5C07\u6A94\u6848 "{0}" \u91CD\u65B0\u547D\u54 ...@@ -79,10 +79,6 @@ FileChooser.renameFileDialogText=\u5C07\u6A94\u6848 "{0}" \u91CD\u65B0\u547D\u54
FileChooser.renameFileErrorTitle=\u932F\u8AA4 FileChooser.renameFileErrorTitle=\u932F\u8AA4
FileChooser.renameFileErrorText=\u5C07\u6A94\u6848 "{0}" \u91CD\u65B0\u547D\u540D\u70BA "{1}" \u6642\u51FA\u73FE\u932F\u8AA4 FileChooser.renameFileErrorText=\u5C07\u6A94\u6848 "{0}" \u91CD\u65B0\u547D\u540D\u70BA "{1}" \u6642\u51FA\u73FE\u932F\u8AA4
# dummy resource added for translation automation #OptionPane.okButtonMnemonic=79
OptionPane.okButtonText=\u78BA\u5B9A(O) #OptionPane.cancelButtonMnemonic=67
OptionPane.okButtonMnemonic=79
# dummy resource added for translation automation
OptionPane.cancelButtonText=\u53D6\u6D88(C)
OptionPane.cancelButtonMnemonic=67
...@@ -57,7 +57,7 @@ FileChooser.renameErrorFileExistsText=Cannot rename {0}: A file with the name yo ...@@ -57,7 +57,7 @@ FileChooser.renameErrorFileExistsText=Cannot rename {0}: A file with the name yo
Specify a different file name. Specify a different file name.
FileChooser.acceptAllFileFilterText=All Files FileChooser.acceptAllFileFilterText=All Files
FileChooser.cancelButtonText=Cancel FileChooser.cancelButtonText=Cancel
FileChooser.cancelButtonMnemonic=67 #FileChooser.cancelButtonMnemonic=67 // not needed?
FileChooser.saveButtonText=Save FileChooser.saveButtonText=Save
FileChooser.saveButtonMnemonic=83 // not needed? FileChooser.saveButtonMnemonic=83 // not needed?
FileChooser.openButtonText=Open FileChooser.openButtonText=Open
...@@ -146,9 +146,9 @@ OptionPane.yesButtonMnemonic=89 ...@@ -146,9 +146,9 @@ OptionPane.yesButtonMnemonic=89
OptionPane.noButtonText=No OptionPane.noButtonText=No
OptionPane.noButtonMnemonic=78 OptionPane.noButtonMnemonic=78
OptionPane.okButtonText=OK OptionPane.okButtonText=OK
OptionPane.okButtonMnemonic=0 #OptionPane.okButtonMnemonic=0
OptionPane.cancelButtonText=Cancel OptionPane.cancelButtonText=Cancel
OptionPane.cancelButtonMnemonic=0 #OptionPane.cancelButtonMnemonic=0
OptionPane.titleText=Select an Option OptionPane.titleText=Select an Option
# Title for the dialog for the showInputDialog methods. Only used if # Title for the dialog for the showInputDialog methods. Only used if
# the developer uses one of the variants that doesn't take a title. # the developer uses one of the variants that doesn't take a title.
......
...@@ -55,7 +55,7 @@ FileChooser.renameErrorTitleText=\u30D5\u30A1\u30A4\u30EB\u307E\u305F\u306F\u30D ...@@ -55,7 +55,7 @@ FileChooser.renameErrorTitleText=\u30D5\u30A1\u30A4\u30EB\u307E\u305F\u306F\u30D
FileChooser.renameErrorText={0}\u306E\u540D\u524D\u3092\u5909\u66F4\u3067\u304D\u307E\u305B\u3093 FileChooser.renameErrorText={0}\u306E\u540D\u524D\u3092\u5909\u66F4\u3067\u304D\u307E\u305B\u3093
FileChooser.renameErrorFileExistsText={0}\u306E\u540D\u524D\u3092\u5909\u66F4\u3067\u304D\u307E\u305B\u3093: \u6307\u5B9A\u3057\u305F\u540D\u524D\u306E\u30D5\u30A1\u30A4\u30EB\u306F\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059\u3002\u5225\u306E\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002 FileChooser.renameErrorFileExistsText={0}\u306E\u540D\u524D\u3092\u5909\u66F4\u3067\u304D\u307E\u305B\u3093: \u6307\u5B9A\u3057\u305F\u540D\u524D\u306E\u30D5\u30A1\u30A4\u30EB\u306F\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059\u3002\u5225\u306E\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002
FileChooser.acceptAllFileFilterText=\u3059\u3079\u3066\u306E\u30D5\u30A1\u30A4\u30EB FileChooser.acceptAllFileFilterText=\u3059\u3079\u3066\u306E\u30D5\u30A1\u30A4\u30EB
FileChooser.cancelButtonText=\u53D6\u6D88(C) FileChooser.cancelButtonText=\u53D6\u6D88
FileChooser.cancelButtonMnemonic=67 FileChooser.cancelButtonMnemonic=67
FileChooser.saveButtonText=\u4FDD\u5B58 FileChooser.saveButtonText=\u4FDD\u5B58
FileChooser.saveButtonMnemonic=83 FileChooser.saveButtonMnemonic=83
...@@ -146,7 +146,7 @@ OptionPane.noButtonText=\u3044\u3044\u3048(N) ...@@ -146,7 +146,7 @@ OptionPane.noButtonText=\u3044\u3044\u3048(N)
OptionPane.noButtonMnemonic=78 OptionPane.noButtonMnemonic=78
OptionPane.okButtonText=OK OptionPane.okButtonText=OK
OptionPane.okButtonMnemonic=O OptionPane.okButtonMnemonic=O
OptionPane.cancelButtonText=\u53D6\u6D88(0) OptionPane.cancelButtonText=\u53D6\u6D88
OptionPane.cancelButtonMnemonic=0 OptionPane.cancelButtonMnemonic=0
OptionPane.titleText=\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u9078\u629E OptionPane.titleText=\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u9078\u629E
# Title for the dialog for the showInputDialog methods. Only used if # Title for the dialog for the showInputDialog methods. Only used if
......
...@@ -55,7 +55,7 @@ FileChooser.renameErrorTitleText=\uD30C\uC77C \uB610\uB294 \uD3F4\uB354 \uC774\u ...@@ -55,7 +55,7 @@ FileChooser.renameErrorTitleText=\uD30C\uC77C \uB610\uB294 \uD3F4\uB354 \uC774\u
FileChooser.renameErrorText={0}\uC758 \uC774\uB984\uC744 \uBC14\uAFC0 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. FileChooser.renameErrorText={0}\uC758 \uC774\uB984\uC744 \uBC14\uAFC0 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
FileChooser.renameErrorFileExistsText={0}\uC758 \uC774\uB984\uC744 \uBC14\uAFC0 \uC218 \uC5C6\uC74C: \uC9C0\uC815\uD55C \uC774\uB984\uC744 \uC0AC\uC6A9\uD558\uB294 \uD30C\uC77C\uC774 \uC874\uC7AC\uD569\uB2C8\uB2E4. \uB2E4\uB978 \uD30C\uC77C \uC774\uB984\uC744 \uC9C0\uC815\uD558\uC2ED\uC2DC\uC624. FileChooser.renameErrorFileExistsText={0}\uC758 \uC774\uB984\uC744 \uBC14\uAFC0 \uC218 \uC5C6\uC74C: \uC9C0\uC815\uD55C \uC774\uB984\uC744 \uC0AC\uC6A9\uD558\uB294 \uD30C\uC77C\uC774 \uC874\uC7AC\uD569\uB2C8\uB2E4. \uB2E4\uB978 \uD30C\uC77C \uC774\uB984\uC744 \uC9C0\uC815\uD558\uC2ED\uC2DC\uC624.
FileChooser.acceptAllFileFilterText=\uBAA8\uB4E0 \uD30C\uC77C FileChooser.acceptAllFileFilterText=\uBAA8\uB4E0 \uD30C\uC77C
FileChooser.cancelButtonText=\uCDE8\uC18C(C) FileChooser.cancelButtonText=\uCDE8\uC18C
FileChooser.cancelButtonMnemonic=67 FileChooser.cancelButtonMnemonic=67
FileChooser.saveButtonText=\uC800\uC7A5 FileChooser.saveButtonText=\uC800\uC7A5
FileChooser.saveButtonMnemonic=83 FileChooser.saveButtonMnemonic=83
...@@ -146,7 +146,7 @@ OptionPane.noButtonText=\uC544\uB2C8\uC624(N) ...@@ -146,7 +146,7 @@ OptionPane.noButtonText=\uC544\uB2C8\uC624(N)
OptionPane.noButtonMnemonic=78 OptionPane.noButtonMnemonic=78
OptionPane.okButtonText=OK OptionPane.okButtonText=OK
OptionPane.okButtonMnemonic=O OptionPane.okButtonMnemonic=O
OptionPane.cancelButtonText=\uCDE8\uC18C(0) OptionPane.cancelButtonText=\uCDE8\uC18C
OptionPane.cancelButtonMnemonic=0 OptionPane.cancelButtonMnemonic=0
OptionPane.titleText=\uC635\uC158 \uC120\uD0DD OptionPane.titleText=\uC635\uC158 \uC120\uD0DD
# Title for the dialog for the showInputDialog methods. Only used if # Title for the dialog for the showInputDialog methods. Only used if
......
...@@ -96,7 +96,7 @@ ColorChooser.okText=OK ...@@ -96,7 +96,7 @@ ColorChooser.okText=OK
ColorChooser.cancelText=Avbryt ColorChooser.cancelText=Avbryt
ColorChooser.resetText=\u00C5terst\u00E4ll ColorChooser.resetText=\u00C5terst\u00E4ll
# VK_XXX constant for 'ColorChooser.resetText' button to make mnemonic # VK_XXX constant for 'ColorChooser.resetText' button to make mnemonic
ColorChooser.resetMnemonic=82 ColorChooser.resetMnemonic=84
ColorChooser.sampleText=Exempeltext Exempeltext ColorChooser.sampleText=Exempeltext Exempeltext
ColorChooser.swatchesNameText=Prov ColorChooser.swatchesNameText=Prov
ColorChooser.swatchesMnemonic=80 ColorChooser.swatchesMnemonic=80
......
...@@ -55,7 +55,7 @@ FileChooser.renameErrorTitleText=\u91CD\u547D\u540D\u6587\u4EF6\u6216\u6587\u4EF ...@@ -55,7 +55,7 @@ FileChooser.renameErrorTitleText=\u91CD\u547D\u540D\u6587\u4EF6\u6216\u6587\u4EF
FileChooser.renameErrorText=\u65E0\u6CD5\u91CD\u547D\u540D{0} FileChooser.renameErrorText=\u65E0\u6CD5\u91CD\u547D\u540D{0}
FileChooser.renameErrorFileExistsText=\u65E0\u6CD5\u91CD\u547D\u540D{0}: \u5DF2\u5B58\u5728\u5177\u6709\u6240\u6307\u5B9A\u540D\u79F0\u7684\u6587\u4EF6\u3002\u8BF7\u6307\u5B9A\u5176\u4ED6\u6587\u4EF6\u540D\u3002 FileChooser.renameErrorFileExistsText=\u65E0\u6CD5\u91CD\u547D\u540D{0}: \u5DF2\u5B58\u5728\u5177\u6709\u6240\u6307\u5B9A\u540D\u79F0\u7684\u6587\u4EF6\u3002\u8BF7\u6307\u5B9A\u5176\u4ED6\u6587\u4EF6\u540D\u3002
FileChooser.acceptAllFileFilterText=\u6240\u6709\u6587\u4EF6 FileChooser.acceptAllFileFilterText=\u6240\u6709\u6587\u4EF6
FileChooser.cancelButtonText=\u53D6\u6D88(C) FileChooser.cancelButtonText=\u53D6\u6D88
FileChooser.cancelButtonMnemonic=67 FileChooser.cancelButtonMnemonic=67
FileChooser.saveButtonText=\u4FDD\u5B58 FileChooser.saveButtonText=\u4FDD\u5B58
FileChooser.saveButtonMnemonic=83 FileChooser.saveButtonMnemonic=83
...@@ -146,7 +146,7 @@ OptionPane.noButtonText=\u5426(N) ...@@ -146,7 +146,7 @@ OptionPane.noButtonText=\u5426(N)
OptionPane.noButtonMnemonic=78 OptionPane.noButtonMnemonic=78
OptionPane.okButtonText=OK OptionPane.okButtonText=OK
OptionPane.okButtonMnemonic=O OptionPane.okButtonMnemonic=O
OptionPane.cancelButtonText=\u53D6\u6D88(0) OptionPane.cancelButtonText=\u53D6\u6D88
OptionPane.cancelButtonMnemonic=0 OptionPane.cancelButtonMnemonic=0
OptionPane.titleText=\u9009\u62E9\u4E00\u4E2A\u9009\u9879 OptionPane.titleText=\u9009\u62E9\u4E00\u4E2A\u9009\u9879
# Title for the dialog for the showInputDialog methods. Only used if # Title for the dialog for the showInputDialog methods. Only used if
......
...@@ -55,7 +55,7 @@ FileChooser.renameErrorTitleText=\u91CD\u65B0\u547D\u540D\u6A94\u6848\u6216\u8CC ...@@ -55,7 +55,7 @@ FileChooser.renameErrorTitleText=\u91CD\u65B0\u547D\u540D\u6A94\u6848\u6216\u8CC
FileChooser.renameErrorText=\u7121\u6CD5\u91CD\u65B0\u547D\u540D {0} FileChooser.renameErrorText=\u7121\u6CD5\u91CD\u65B0\u547D\u540D {0}
FileChooser.renameErrorFileExistsText=\u7121\u6CD5\u91CD\u65B0\u547D\u540D {0}: \u5DF2\u7D93\u5B58\u5728\u60A8\u6240\u6307\u5B9A\u540D\u7A31\u7684\u6A94\u6848\u3002\u8ACB\u6307\u5B9A\u4E0D\u540C\u7684\u540D\u7A31\u3002 FileChooser.renameErrorFileExistsText=\u7121\u6CD5\u91CD\u65B0\u547D\u540D {0}: \u5DF2\u7D93\u5B58\u5728\u60A8\u6240\u6307\u5B9A\u540D\u7A31\u7684\u6A94\u6848\u3002\u8ACB\u6307\u5B9A\u4E0D\u540C\u7684\u540D\u7A31\u3002
FileChooser.acceptAllFileFilterText=\u6240\u6709\u6A94\u6848 FileChooser.acceptAllFileFilterText=\u6240\u6709\u6A94\u6848
FileChooser.cancelButtonText=\u53D6\u6D88(C) FileChooser.cancelButtonText=\u53D6\u6D88
FileChooser.cancelButtonMnemonic=67 FileChooser.cancelButtonMnemonic=67
FileChooser.saveButtonText=\u5132\u5B58 FileChooser.saveButtonText=\u5132\u5B58
FileChooser.saveButtonMnemonic=83 FileChooser.saveButtonMnemonic=83
...@@ -146,7 +146,7 @@ OptionPane.noButtonText=\u5426(N) ...@@ -146,7 +146,7 @@ OptionPane.noButtonText=\u5426(N)
OptionPane.noButtonMnemonic=78 OptionPane.noButtonMnemonic=78
OptionPane.okButtonText=OK OptionPane.okButtonText=OK
OptionPane.okButtonMnemonic=O OptionPane.okButtonMnemonic=O
OptionPane.cancelButtonText=\u53D6\u6D88(0) OptionPane.cancelButtonText=\u53D6\u6D88
OptionPane.cancelButtonMnemonic=0 OptionPane.cancelButtonMnemonic=0
OptionPane.titleText=\u9078\u53D6\u4E00\u500B\u9078\u9805 OptionPane.titleText=\u9078\u53D6\u4E00\u500B\u9078\u9805
# Title for the dialog for the showInputDialog methods. Only used if # Title for the dialog for the showInputDialog methods. Only used if
......
...@@ -2944,6 +2944,46 @@ public abstract class Component implements ImageObserver, MenuContainer, ...@@ -2944,6 +2944,46 @@ public abstract class Component implements ImageObserver, MenuContainer,
} }
} }
/**
* Revalidates the component hierarchy up to the nearest validate root.
* <p>
* This method first invalidates the component hierarchy starting from this
* component up to the nearest validate root. Afterwards, the component
* hierarchy is validated starting from the nearest validate root.
* <p>
* This is a convenience method supposed to help application developers
* avoid looking for validate roots manually. Basically, it's equivalent to
* first calling the {@link #invalidate()} method on this component, and
* then calling the {@link #validate()} method on the nearest validate
* root.
*
* @see Container#isValidateRoot
* @since 1.7
*/
public void revalidate() {
synchronized (getTreeLock()) {
invalidate();
Container root = getContainer();
if (root == null) {
// There's no parents. Just validate itself.
validate();
} else {
while (!root.isValidateRoot()) {
if (root.getContainer() == null) {
// If there's no validate roots, we'll validate the
// topmost container
break;
}
root = root.getContainer();
}
root.validate();
}
}
}
/** /**
* Creates a graphics context for this component. This method will * Creates a graphics context for this component. This method will
* return <code>null</code> if this component is currently not * return <code>null</code> if this component is currently not
......
...@@ -257,6 +257,11 @@ public abstract class GraphicsDevice { ...@@ -257,6 +257,11 @@ public abstract class GraphicsDevice {
* 1.0f, and the background color alpha is set to 255 (completely opaque). * 1.0f, and the background color alpha is set to 255 (completely opaque).
* These values are not restored when returning to windowed mode. * These values are not restored when returning to windowed mode.
* <p> * <p>
* It is unspecified and platform-dependent how decorated windows operate
* in full-screen mode. For this reason, it is recommended to turn off
* the decorations in a {@code Frame} or {@code Dialog} object by using the
* {@code setUndecorated} method.
* <p>
* When returning to windowed mode from an exclusive full-screen window, * When returning to windowed mode from an exclusive full-screen window,
* any display changes made by calling {@code setDisplayMode} are * any display changes made by calling {@code setDisplayMode} are
* automatically restored to their original state. * automatically restored to their original state.
...@@ -272,6 +277,8 @@ public abstract class GraphicsDevice { ...@@ -272,6 +277,8 @@ public abstract class GraphicsDevice {
* @see #setDisplayMode * @see #setDisplayMode
* @see Component#enableInputMethods * @see Component#enableInputMethods
* @see Component#setVisible * @see Component#setVisible
* @see Frame#setUndecorated
* @see Dialog#setUndecorated
* *
* @since 1.4 * @since 1.4
*/ */
......
...@@ -49,9 +49,11 @@ import java.beans.ConstructorProperties; ...@@ -49,9 +49,11 @@ import java.beans.ConstructorProperties;
* from the focus point to the circumference will thus span all the gradient * from the focus point to the circumference will thus span all the gradient
* colors. * colors.
* <p> * <p>
* Specifying a focus point outside of the circle's radius will result in the * Specifying a focus point outside of the radius of the circle will cause
* focus being set to the intersection point of the focus-center line and the * the rings of the gradient pattern to be centered on the point just inside
* perimeter of the circle. * the edge of the circle in the direction of the focus point.
* The rendering will internally use this modified location as if it were
* the specified focus point.
* <p> * <p>
* The user must provide an array of floats specifying how to distribute the * The user must provide an array of floats specifying how to distribute the
* colors along the gradient. These values should range from 0.0 to 1.0 and * colors along the gradient. These values should range from 0.0 to 1.0 and
...@@ -621,6 +623,11 @@ public final class RadialGradientPaint extends MultipleGradientPaint { ...@@ -621,6 +623,11 @@ public final class RadialGradientPaint extends MultipleGradientPaint {
/** /**
* Returns a copy of the focus point of the radial gradient. * Returns a copy of the focus point of the radial gradient.
* Note that if the focus point specified when the radial gradient
* was constructed lies outside of the radius of the circle, this
* method will still return the original focus point even though
* the rendering may center the rings of color on a different
* point that lies inside the radius.
* *
* @return a {@code Point2D} object that is a copy of the focus point * @return a {@code Point2D} object that is a copy of the focus point
*/ */
......
...@@ -1870,11 +1870,15 @@ public abstract class Toolkit { ...@@ -1870,11 +1870,15 @@ public abstract class Toolkit {
/** /**
* Adds the specified property change listener for the named desktop * Adds the specified property change listener for the named desktop
* property. * property. When a {@link PropertyChangeListenerProxy} object is added,
* If pcl is null, no exception is thrown and no action is performed. * its property name is ignored, and the wrapped listener is added.
* If {@code name} is {@code null} or {@code pcl} is {@code null},
* no exception is thrown and no action is performed.
* *
* @param name The name of the property to listen for * @param name The name of the property to listen for
* @param pcl The property change listener * @param pcl The property change listener
* @see PropertyChangeSupport#addPropertyChangeListener(String,
PropertyChangeListener)
* @since 1.2 * @since 1.2
*/ */
public void addPropertyChangeListener(String name, PropertyChangeListener pcl) { public void addPropertyChangeListener(String name, PropertyChangeListener pcl) {
...@@ -1883,11 +1887,16 @@ public abstract class Toolkit { ...@@ -1883,11 +1887,16 @@ public abstract class Toolkit {
/** /**
* Removes the specified property change listener for the named * Removes the specified property change listener for the named
* desktop property. * desktop property. When a {@link PropertyChangeListenerProxy} object
* If pcl is null, no exception is thrown and no action is performed. * is removed, its property name is ignored, and
* the wrapped listener is removed.
* If {@code name} is {@code null} or {@code pcl} is {@code null},
* no exception is thrown and no action is performed.
* *
* @param name The name of the property to remove * @param name The name of the property to remove
* @param pcl The property change listener * @param pcl The property change listener
* @see PropertyChangeSupport#removePropertyChangeListener(String,
PropertyChangeListener)
* @since 1.2 * @since 1.2
*/ */
public void removePropertyChangeListener(String name, PropertyChangeListener pcl) { public void removePropertyChangeListener(String name, PropertyChangeListener pcl) {
...@@ -1896,12 +1905,15 @@ public abstract class Toolkit { ...@@ -1896,12 +1905,15 @@ public abstract class Toolkit {
/** /**
* Returns an array of all the property change listeners * Returns an array of all the property change listeners
* registered on this toolkit. * registered on this toolkit. The returned array
* contains {@code PropertyChangeListenerProxy} objects
* that associate listeners with the names of desktop properties.
* *
* @return all of this toolkit's <code>PropertyChangeListener</code>s * @return all of this toolkit's {@ code PropertyChangeListener}
* or an empty array if no property change * objects wrapped in {@code PropertyChangeListenerProxy} objects
* listeners are currently registered * or an empty array if no listeners are added
* *
* @see PropertyChangeSupport#getPropertyChangeListeners()
* @since 1.4 * @since 1.4
*/ */
public PropertyChangeListener[] getPropertyChangeListeners() { public PropertyChangeListener[] getPropertyChangeListeners() {
...@@ -1909,13 +1921,15 @@ public abstract class Toolkit { ...@@ -1909,13 +1921,15 @@ public abstract class Toolkit {
} }
/** /**
* Returns an array of all the <code>PropertyChangeListener</code>s * Returns an array of all property change listeners
* associated with the named property. * associated with the specified name of a desktop property.
* *
* @param propertyName the named property * @param propertyName the named property
* @return all of the <code>PropertyChangeListener</code>s associated with * @return all of the {@code PropertyChangeListener} objects
* the named property or an empty array if no such listeners have * associated with the specified name of a desktop property
* been added * or an empty array if no such listeners are added
*
* @see PropertyChangeSupport#getPropertyChangeListeners(String)
* @since 1.4 * @since 1.4
*/ */
public PropertyChangeListener[] getPropertyChangeListeners(String propertyName) { public PropertyChangeListener[] getPropertyChangeListeners(String propertyName) {
......
...@@ -681,7 +681,7 @@ public abstract class Arc2D extends RectangularShape { ...@@ -681,7 +681,7 @@ public abstract class Arc2D extends RectangularShape {
* @see java.awt.geom.Arc2D.Float * @see java.awt.geom.Arc2D.Float
* @see java.awt.geom.Arc2D.Double * @see java.awt.geom.Arc2D.Double
*/ */
Arc2D() { protected Arc2D() {
this(OPEN); this(OPEN);
} }
......
...@@ -732,7 +732,7 @@ public abstract class Path2D implements Shape, Cloneable { ...@@ -732,7 +732,7 @@ public abstract class Path2D implements Shape, Cloneable {
* *
* @since 1.6 * @since 1.6
*/ */
public PathIterator getPathIterator(AffineTransform at) { public final PathIterator getPathIterator(AffineTransform at) {
if (at == null) { if (at == null) {
return new CopyIterator(this); return new CopyIterator(this);
} else { } else {
...@@ -1461,7 +1461,7 @@ public abstract class Path2D implements Shape, Cloneable { ...@@ -1461,7 +1461,7 @@ public abstract class Path2D implements Shape, Cloneable {
* of this {@code Shape}'s outline * of this {@code Shape}'s outline
* @since 1.6 * @since 1.6
*/ */
public PathIterator getPathIterator(AffineTransform at) { public final PathIterator getPathIterator(AffineTransform at) {
if (at == null) { if (at == null) {
return new CopyIterator(this); return new CopyIterator(this);
} else { } else {
...@@ -2342,8 +2342,8 @@ public abstract class Path2D implements Shape, Cloneable { ...@@ -2342,8 +2342,8 @@ public abstract class Path2D implements Shape, Cloneable {
* *
* @since 1.6 * @since 1.6
*/ */
public PathIterator getPathIterator(AffineTransform at, public final PathIterator getPathIterator(AffineTransform at,
double flatness) double flatness)
{ {
return new FlatteningPathIterator(getPathIterator(at), flatness); return new FlatteningPathIterator(getPathIterator(at), flatness);
} }
......
/* /*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -32,7 +32,7 @@ import java.lang.annotation.*; ...@@ -32,7 +32,7 @@ import java.lang.annotation.*;
* constructor does not perform potentially unsafe operations on its * constructor does not perform potentially unsafe operations on its
* varargs parameter. Applying this annotation to a method or * varargs parameter. Applying this annotation to a method or
* constructor suppresses unchecked warnings about a * constructor suppresses unchecked warnings about a
* <i>non-reifiable</i> variable-arity (vararg) type and suppresses * <i>non-reifiable</i> variable arity (vararg) type and suppresses
* unchecked warnings about parameterized array creation at call * unchecked warnings about parameterized array creation at call
* sites. * sites.
* *
...@@ -41,11 +41,10 @@ import java.lang.annotation.*; ...@@ -41,11 +41,10 @@ import java.lang.annotation.*;
* additional usage restrictions on this annotation type; it is a * additional usage restrictions on this annotation type; it is a
* compile-time error if a method or constructor declaration is * compile-time error if a method or constructor declaration is
* annotated with a {@code @SafeVarargs} annotation, and either: * annotated with a {@code @SafeVarargs} annotation, and either:
* <ul> * <ul>
* <li> the declaration is a fixed-arity method or constructor * <li> the declaration is a fixed arity method or constructor
* *
* <li> the declaration is a variable-arity method that is neither * <li> the declaration is a variable arity method that is neither
* {@code static} nor {@code final}. * {@code static} nor {@code final}.
* *
* </ul> * </ul>
...@@ -55,15 +54,28 @@ import java.lang.annotation.*; ...@@ -55,15 +54,28 @@ import java.lang.annotation.*;
* *
* <ul> * <ul>
* *
* <li> The variable-arity parameter has a reifiable element type, * <li> The variable arity parameter has a reifiable element type,
* which includes primitive types, {@code Object}, and {@code String}. * which includes primitive types, {@code Object}, and {@code String}.
* (The unchecked warnings this annotation type suppresses already do * (The unchecked warnings this annotation type suppresses already do
* not occur for a reifiable element type.) * not occur for a reifiable element type.)
* *
* <li> The body of the method or constructor declaration performs * <li> The body of the method or constructor declaration performs
* potentially unsafe operations, such as an assignment to an element * potentially unsafe operations, such as an assignment to an element
* of the variable-arity parameter's array that generates an unchecked * of the variable arity parameter's array that generates an unchecked
* warning. * warning. Some unsafe operations do not trigger an unchecked
* warning. For example, the aliasing in
*
* <blockquote><pre>
* &#64;SafeVarargs // Not actually safe!
* static void m(List&lt;String&gt;... stringLists) {
* Object[] array = stringLists;
* List&lt;Integer&gt; tmpList = Arrays.asList(42);
* array[0] = tmpList; // Semantically invalid, but compiles without warnings
* String s = stringLists[0].get(0); // Oh no, ClassCastException at runtime!
* }
* </pre></blockquote>
*
* leads to a {@code ClassCastException} at runtime.
* *
* <p>Future versions of the platform may mandate compiler errors for * <p>Future versions of the platform may mandate compiler errors for
* such unsafe operations. * such unsafe operations.
......
...@@ -275,10 +275,14 @@ public class LockSupport { ...@@ -275,10 +275,14 @@ public class LockSupport {
* snapshot -- the thread may have since unblocked or blocked on a * snapshot -- the thread may have since unblocked or blocked on a
* different blocker object. * different blocker object.
* *
* @param t the thread
* @return the blocker * @return the blocker
* @throws NullPointerException if argument is null
* @since 1.6 * @since 1.6
*/ */
public static Object getBlocker(Thread t) { public static Object getBlocker(Thread t) {
if (t == null)
throw new NullPointerException();
return unsafe.getObjectVolatile(t, parkBlockerOffset); return unsafe.getObjectVolatile(t, parkBlockerOffset);
} }
......
...@@ -342,8 +342,8 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement { ...@@ -342,8 +342,8 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement {
// Calculate the screen size that popup should fit // Calculate the screen size that popup should fit
Dimension popupSize = JPopupMenu.this.getPreferredSize(); Dimension popupSize = JPopupMenu.this.getPreferredSize();
int popupRightX = popupLocation.x + popupSize.width; long popupRightX = (long)popupLocation.x + (long)popupSize.width;
int popupBottomY = popupLocation.y + popupSize.height; long popupBottomY = (long)popupLocation.y + (long)popupSize.height;
int scrWidth = scrBounds.width; int scrWidth = scrBounds.width;
int scrHeight = scrBounds.height; int scrHeight = scrBounds.height;
if (!canPopupOverlapTaskBar()) { if (!canPopupOverlapTaskBar()) {
...@@ -358,13 +358,13 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement { ...@@ -358,13 +358,13 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement {
int scrBottomY = scrBounds.y + scrHeight; int scrBottomY = scrBounds.y + scrHeight;
// Ensure that popup menu fits the screen // Ensure that popup menu fits the screen
if (popupRightX > scrRightX) { if (popupRightX > (long)scrRightX) {
popupLocation.x = scrRightX - popupSize.width; popupLocation.x = scrRightX - popupSize.width;
if( popupLocation.x < scrBounds.x ) { if( popupLocation.x < scrBounds.x ) {
popupLocation.x = scrBounds.x ; popupLocation.x = scrBounds.x ;
} }
} }
if (popupBottomY > scrBottomY) { if (popupBottomY > (long)scrBottomY) {
popupLocation.y = scrBottomY - popupSize.height; popupLocation.y = scrBottomY - popupSize.height;
if( popupLocation.y < scrBounds.y ) { if( popupLocation.y < scrBounds.y ) {
popupLocation.y = scrBounds.y; popupLocation.y = scrBounds.y;
......
...@@ -671,7 +671,7 @@ public class JSplitPane extends JComponent implements Accessible ...@@ -671,7 +671,7 @@ public class JSplitPane extends JComponent implements Accessible
* which must be <code>true</code> for the child components * which must be <code>true</code> for the child components
* to be continuously * to be continuously
* redisplayed and laid out during user intervention. * redisplayed and laid out during user intervention.
* The default value of this property is <code>false</code>. * The default value of this property is look and feel dependent.
* Some look and feels might not support continuous layout; * Some look and feels might not support continuous layout;
* they will ignore this property. * they will ignore this property.
* *
......
...@@ -154,7 +154,7 @@ public class BasicSplitPaneDivider extends Container ...@@ -154,7 +154,7 @@ public class BasicSplitPaneDivider extends Container
setBackground(UIManager.getColor("SplitPane.background")); setBackground(UIManager.getColor("SplitPane.background"));
} }
private void revalidate() { private void revalidateSplitPane() {
invalidate(); invalidate();
if (splitPane != null) { if (splitPane != null) {
splitPane.revalidate(); splitPane.revalidate();
...@@ -315,7 +315,7 @@ public class BasicSplitPaneDivider extends Container ...@@ -315,7 +315,7 @@ public class BasicSplitPaneDivider extends Container
setCursor((orientation == JSplitPane.HORIZONTAL_SPLIT) ? setCursor((orientation == JSplitPane.HORIZONTAL_SPLIT) ?
Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR) : Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR) :
Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR)); Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR));
revalidate(); revalidateSplitPane();
} }
else if (e.getPropertyName() == JSplitPane. else if (e.getPropertyName() == JSplitPane.
ONE_TOUCH_EXPANDABLE_PROPERTY) { ONE_TOUCH_EXPANDABLE_PROPERTY) {
...@@ -376,7 +376,7 @@ public class BasicSplitPaneDivider extends Container ...@@ -376,7 +376,7 @@ public class BasicSplitPaneDivider extends Container
add(rightButton); add(rightButton);
} }
} }
revalidate(); revalidateSplitPane();
} }
......
...@@ -13,7 +13,7 @@ public class ExtendedKeyCodes { ...@@ -13,7 +13,7 @@ public class ExtendedKeyCodes {
*/ */
// Keycodes declared in KeyEvent.java with corresponding Unicode values. // Keycodes declared in KeyEvent.java with corresponding Unicode values.
private final static HashMap<Integer, Integer> regularKeyCodesMap = private final static HashMap<Integer, Integer> regularKeyCodesMap =
new HashMap<Integer,Integer>(83, 1.0f); new HashMap<Integer,Integer>(98, 1.0f);
// Keycodes derived from Unicode values. Here should be collected codes // Keycodes derived from Unicode values. Here should be collected codes
// for characters appearing on the primary layer of at least one // for characters appearing on the primary layer of at least one
...@@ -108,6 +108,21 @@ public class ExtendedKeyCodes { ...@@ -108,6 +108,21 @@ public class ExtendedKeyCodes {
regularKeyCodesMap.put(0x5E, KeyEvent.VK_CIRCUMFLEX); regularKeyCodesMap.put(0x5E, KeyEvent.VK_CIRCUMFLEX);
regularKeyCodesMap.put(0x5F, KeyEvent.VK_UNDERSCORE); regularKeyCodesMap.put(0x5F, KeyEvent.VK_UNDERSCORE);
regularKeyCodesMap.put(0x60, KeyEvent.VK_BACK_QUOTE); regularKeyCodesMap.put(0x60, KeyEvent.VK_BACK_QUOTE);
regularKeyCodesMap.put(0x61, KeyEvent.VK_A);
regularKeyCodesMap.put(0x62, KeyEvent.VK_B);
regularKeyCodesMap.put(0x63, KeyEvent.VK_C);
regularKeyCodesMap.put(0x64, KeyEvent.VK_D);
regularKeyCodesMap.put(0x65, KeyEvent.VK_E);
regularKeyCodesMap.put(0x66, KeyEvent.VK_F);
regularKeyCodesMap.put(0x67, KeyEvent.VK_G);
regularKeyCodesMap.put(0x68, KeyEvent.VK_H);
regularKeyCodesMap.put(0x69, KeyEvent.VK_I);
regularKeyCodesMap.put(0x6A, KeyEvent.VK_J);
regularKeyCodesMap.put(0x6B, KeyEvent.VK_K);
regularKeyCodesMap.put(0x6C, KeyEvent.VK_L);
regularKeyCodesMap.put(0x6D, KeyEvent.VK_M);
regularKeyCodesMap.put(0x6E, KeyEvent.VK_N);
regularKeyCodesMap.put(0x6F, KeyEvent.VK_O);
regularKeyCodesMap.put(0x70, KeyEvent.VK_P); regularKeyCodesMap.put(0x70, KeyEvent.VK_P);
regularKeyCodesMap.put(0x71, KeyEvent.VK_Q); regularKeyCodesMap.put(0x71, KeyEvent.VK_Q);
regularKeyCodesMap.put(0x72, KeyEvent.VK_R); regularKeyCodesMap.put(0x72, KeyEvent.VK_R);
......
...@@ -29,12 +29,10 @@ import java.awt.AWTError; ...@@ -29,12 +29,10 @@ import java.awt.AWTError;
import java.awt.EventQueue; import java.awt.EventQueue;
import java.awt.Image; import java.awt.Image;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Toolkit;
import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.FlavorMap; import java.awt.datatransfer.FlavorMap;
import java.awt.datatransfer.FlavorTable; import java.awt.datatransfer.FlavorTable;
import java.awt.datatransfer.StringSelection;
import java.awt.datatransfer.Transferable; import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.UnsupportedFlavorException; import java.awt.datatransfer.UnsupportedFlavorException;
...@@ -66,8 +64,6 @@ import java.lang.reflect.InvocationTargetException; ...@@ -66,8 +64,6 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.lang.reflect.Modifier; import java.lang.reflect.Modifier;
import java.security.AccessControlContext;
import java.security.AccessControlException;
import java.security.AccessController; import java.security.AccessController;
import java.security.PrivilegedAction; import java.security.PrivilegedAction;
import java.security.PrivilegedActionException; import java.security.PrivilegedActionException;
...@@ -171,7 +167,26 @@ public abstract class DataTransferer { ...@@ -171,7 +167,26 @@ public abstract class DataTransferer {
*/ */
public static final DataFlavor javaTextEncodingFlavor; public static final DataFlavor javaTextEncodingFlavor;
private static SortedSet standardEncodings; /**
* Lazy initialization of Standard Encodings.
*/
private static class StandardEncodingsHolder {
private static final SortedSet standardEncodings = load();
private static SortedSet load() {
final Comparator comparator =
new CharsetComparator(IndexedComparator.SELECT_WORST);
final SortedSet tempSet = new TreeSet(comparator);
tempSet.add("US-ASCII");
tempSet.add("ISO-8859-1");
tempSet.add("UTF-8");
tempSet.add("UTF-16BE");
tempSet.add("UTF-16LE");
tempSet.add("UTF-16");
tempSet.add(getDefaultTextCharset());
return Collections.unmodifiableSortedSet(tempSet);
}
}
/** /**
* Tracks whether a particular text/* MIME type supports the charset * Tracks whether a particular text/* MIME type supports the charset
...@@ -509,18 +524,7 @@ public abstract class DataTransferer { ...@@ -509,18 +524,7 @@ public abstract class DataTransferer {
* non-standard, character sets are not included. * non-standard, character sets are not included.
*/ */
public static Iterator standardEncodings() { public static Iterator standardEncodings() {
if (standardEncodings == null) { return StandardEncodingsHolder.standardEncodings.iterator();
TreeSet tempSet = new TreeSet(defaultCharsetComparator);
tempSet.add("US-ASCII");
tempSet.add("ISO-8859-1");
tempSet.add("UTF-8");
tempSet.add("UTF-16BE");
tempSet.add("UTF-16LE");
tempSet.add("UTF-16");
tempSet.add(getDefaultTextCharset());
standardEncodings = Collections.unmodifiableSortedSet(tempSet);
}
return standardEncodings.iterator();
} }
/** /**
...@@ -2398,7 +2402,9 @@ search: ...@@ -2398,7 +2402,9 @@ search:
public static DataFlavor[] setToSortedDataFlavorArray(Set flavorsSet) { public static DataFlavor[] setToSortedDataFlavorArray(Set flavorsSet) {
DataFlavor[] flavors = new DataFlavor[flavorsSet.size()]; DataFlavor[] flavors = new DataFlavor[flavorsSet.size()];
flavorsSet.toArray(flavors); flavorsSet.toArray(flavors);
Arrays.sort(flavors, defaultFlavorComparator); final Comparator comparator =
new DataFlavorComparator(IndexedComparator.SELECT_WORST);
Arrays.sort(flavors, comparator);
return flavors; return flavors;
} }
...@@ -2455,11 +2461,6 @@ search: ...@@ -2455,11 +2461,6 @@ search:
return new ArrayList(); return new ArrayList();
} }
private static CharsetComparator defaultCharsetComparator =
new CharsetComparator(IndexedComparator.SELECT_WORST);
private static DataFlavorComparator defaultFlavorComparator =
new DataFlavorComparator(IndexedComparator.SELECT_WORST);
/** /**
* A Comparator which includes a helper function for comparing two Objects * A Comparator which includes a helper function for comparing two Objects
* which are likely to be keys in the specified Map. * which are likely to be keys in the specified Map.
......
...@@ -27,6 +27,8 @@ package sun.java2d.pisces; ...@@ -27,6 +27,8 @@ package sun.java2d.pisces;
import java.util.Arrays; import java.util.Arrays;
import java.util.Iterator; import java.util.Iterator;
import static java.lang.Math.ulp;
import static java.lang.Math.sqrt;
import sun.awt.geom.PathConsumer2D; import sun.awt.geom.PathConsumer2D;
...@@ -130,7 +132,7 @@ final class Stroker implements PathConsumer2D { ...@@ -130,7 +132,7 @@ final class Stroker implements PathConsumer2D {
private static void computeOffset(final float lx, final float ly, private static void computeOffset(final float lx, final float ly,
final float w, final float[] m) final float w, final float[] m)
{ {
final float len = (float)Math.sqrt(lx*lx + ly*ly); final float len = (float) sqrt(lx*lx + ly*ly);
if (len == 0) { if (len == 0) {
m[0] = m[1] = 0; m[0] = m[1] = 0;
} else { } else {
...@@ -217,7 +219,7 @@ final class Stroker implements PathConsumer2D { ...@@ -217,7 +219,7 @@ final class Stroker implements PathConsumer2D {
// this normal's length is at least 0.5 and at most sqrt(2)/2 (because // this normal's length is at least 0.5 and at most sqrt(2)/2 (because
// we know the angle of the arc is > 90 degrees). // we know the angle of the arc is > 90 degrees).
float nx = my - omy, ny = omx - mx; float nx = my - omy, ny = omx - mx;
float nlen = (float)Math.sqrt(nx*nx + ny*ny); float nlen = (float) sqrt(nx*nx + ny*ny);
float scale = lineWidth2/nlen; float scale = lineWidth2/nlen;
float mmx = nx * scale, mmy = ny * scale; float mmx = nx * scale, mmy = ny * scale;
...@@ -246,8 +248,8 @@ final class Stroker implements PathConsumer2D { ...@@ -246,8 +248,8 @@ final class Stroker implements PathConsumer2D {
// define the bezier curve we're computing. // define the bezier curve we're computing.
// It is computed using the constraints that P1-P0 and P3-P2 are parallel // It is computed using the constraints that P1-P0 and P3-P2 are parallel
// to the arc tangents at the endpoints, and that |P1-P0|=|P3-P2|. // to the arc tangents at the endpoints, and that |P1-P0|=|P3-P2|.
float cv = (float)((4.0 / 3.0) * Math.sqrt(0.5-cosext2) / float cv = (float) ((4.0 / 3.0) * sqrt(0.5-cosext2) /
(1.0 + Math.sqrt(cosext2+0.5))); (1.0 + sqrt(cosext2+0.5)));
// if clockwise, we need to negate cv. // if clockwise, we need to negate cv.
if (rev) { // rev is equivalent to isCW(omx, omy, mx, my) if (rev) { // rev is equivalent to isCW(omx, omy, mx, my)
cv = -cv; cv = -cv;
...@@ -284,28 +286,20 @@ final class Stroker implements PathConsumer2D { ...@@ -284,28 +286,20 @@ final class Stroker implements PathConsumer2D {
false); false);
} }
// Return the intersection point of the lines (x0, y0) -> (x1, y1) // Put the intersection point of the lines (x0, y0) -> (x1, y1)
// and (x0p, y0p) -> (x1p, y1p) in m[0] and m[1] // and (x0p, y0p) -> (x1p, y1p) in m[off] and m[off+1].
private void computeMiter(final float x0, final float y0, // If the lines are parallel, it will put a non finite number in m.
final float x1, final float y1, private void computeIntersection(final float x0, final float y0,
final float x0p, final float y0p, final float x1, final float y1,
final float x1p, final float y1p, final float x0p, final float y0p,
final float[] m, int off) final float x1p, final float y1p,
final float[] m, int off)
{ {
float x10 = x1 - x0; float x10 = x1 - x0;
float y10 = y1 - y0; float y10 = y1 - y0;
float x10p = x1p - x0p; float x10p = x1p - x0p;
float y10p = y1p - y0p; float y10p = y1p - y0p;
// if this is 0, the lines are parallel. If they go in the
// same direction, there is no intersection so m[off] and
// m[off+1] will contain infinity, so no miter will be drawn.
// If they go in the same direction that means that the start of the
// current segment and the end of the previous segment have the same
// tangent, in which case this method won't even be involved in
// miter drawing because it won't be called by drawMiter (because
// (mx == omx && my == omy) will be true, and drawMiter will return
// immediately).
float den = x10*y10p - x10p*y10; float den = x10*y10p - x10p*y10;
float t = x10p*(y0-y0p) - y10p*(x0-x0p); float t = x10p*(y0-y0p) - y10p*(x0-x0p);
t /= den; t /= den;
...@@ -321,7 +315,8 @@ final class Stroker implements PathConsumer2D { ...@@ -321,7 +315,8 @@ final class Stroker implements PathConsumer2D {
{ {
if ((mx == omx && my == omy) || if ((mx == omx && my == omy) ||
(pdx == 0 && pdy == 0) || (pdx == 0 && pdy == 0) ||
(dx == 0 && dy == 0)) { (dx == 0 && dy == 0))
{
return; return;
} }
...@@ -332,12 +327,17 @@ final class Stroker implements PathConsumer2D { ...@@ -332,12 +327,17 @@ final class Stroker implements PathConsumer2D {
my = -my; my = -my;
} }
computeMiter((x0 - pdx) + omx, (y0 - pdy) + omy, x0 + omx, y0 + omy, computeIntersection((x0 - pdx) + omx, (y0 - pdy) + omy, x0 + omx, y0 + omy,
(dx + x0) + mx, (dy + y0) + my, x0 + mx, y0 + my, (dx + x0) + mx, (dy + y0) + my, x0 + mx, y0 + my,
miter, 0); miter, 0);
float lenSq = (miter[0]-x0)*(miter[0]-x0) + (miter[1]-y0)*(miter[1]-y0); float lenSq = (miter[0]-x0)*(miter[0]-x0) + (miter[1]-y0)*(miter[1]-y0);
// If the lines are parallel, lenSq will be either NaN or +inf
// (actually, I'm not sure if the latter is possible. The important
// thing is that -inf is not possible, because lenSq is a square).
// For both of those values, the comparison below will fail and
// no miter will be drawn, which is correct.
if (lenSq < miterLimitSq) { if (lenSq < miterLimitSq) {
emitLineTo(miter[0], miter[1], rev); emitLineTo(miter[0], miter[1], rev);
} }
...@@ -566,8 +566,8 @@ final class Stroker implements PathConsumer2D { ...@@ -566,8 +566,8 @@ final class Stroker implements PathConsumer2D {
// if p1 == p2 && p3 == p4: draw line from p1->p4, unless p1 == p4, // if p1 == p2 && p3 == p4: draw line from p1->p4, unless p1 == p4,
// in which case ignore if p1 == p2 // in which case ignore if p1 == p2
final boolean p1eqp2 = within(x1,y1,x2,y2, 6 * Math.ulp(y2)); final boolean p1eqp2 = within(x1,y1,x2,y2, 6 * ulp(y2));
final boolean p3eqp4 = within(x3,y3,x4,y4, 6 * Math.ulp(y4)); final boolean p3eqp4 = within(x3,y3,x4,y4, 6 * ulp(y4));
if (p1eqp2 && p3eqp4) { if (p1eqp2 && p3eqp4) {
getLineOffsets(x1, y1, x4, y4, leftOff, rightOff); getLineOffsets(x1, y1, x4, y4, leftOff, rightOff);
return 4; return 4;
...@@ -583,7 +583,7 @@ final class Stroker implements PathConsumer2D { ...@@ -583,7 +583,7 @@ final class Stroker implements PathConsumer2D {
float dotsq = (dx1 * dx4 + dy1 * dy4); float dotsq = (dx1 * dx4 + dy1 * dy4);
dotsq = dotsq * dotsq; dotsq = dotsq * dotsq;
float l1sq = dx1 * dx1 + dy1 * dy1, l4sq = dx4 * dx4 + dy4 * dy4; float l1sq = dx1 * dx1 + dy1 * dy1, l4sq = dx4 * dx4 + dy4 * dy4;
if (Helpers.within(dotsq, l1sq * l4sq, 4 * Math.ulp(dotsq))) { if (Helpers.within(dotsq, l1sq * l4sq, 4 * ulp(dotsq))) {
getLineOffsets(x1, y1, x4, y4, leftOff, rightOff); getLineOffsets(x1, y1, x4, y4, leftOff, rightOff);
return 4; return 4;
} }
...@@ -693,8 +693,6 @@ final class Stroker implements PathConsumer2D { ...@@ -693,8 +693,6 @@ final class Stroker implements PathConsumer2D {
return 8; return 8;
} }
// compute offset curves using bezier spline through t=0.5 (i.e.
// ComputedCurve(0.5) == IdealParallelCurve(0.5))
// return the kind of curve in the right and left arrays. // return the kind of curve in the right and left arrays.
private int computeOffsetQuad(float[] pts, final int off, private int computeOffsetQuad(float[] pts, final int off,
float[] leftOff, float[] rightOff) float[] leftOff, float[] rightOff)
...@@ -703,58 +701,69 @@ final class Stroker implements PathConsumer2D { ...@@ -703,58 +701,69 @@ final class Stroker implements PathConsumer2D {
final float x2 = pts[off + 2], y2 = pts[off + 3]; final float x2 = pts[off + 2], y2 = pts[off + 3];
final float x3 = pts[off + 4], y3 = pts[off + 5]; final float x3 = pts[off + 4], y3 = pts[off + 5];
float dx3 = x3 - x2; final float dx3 = x3 - x2;
float dy3 = y3 - y2; final float dy3 = y3 - y2;
float dx1 = x2 - x1; final float dx1 = x2 - x1;
float dy1 = y2 - y1; final float dy1 = y2 - y1;
// if p1=p2 or p3=p4 it means that the derivative at the endpoint // this computes the offsets at t = 0, 1
// vanishes, which creates problems with computeOffset. Usually
// this happens when this stroker object is trying to winden
// a curve with a cusp. What happens is that curveTo splits
// the input curve at the cusp, and passes it to this function.
// because of inaccuracies in the splitting, we consider points
// equal if they're very close to each other.
// if p1 == p2 && p3 == p4: draw line from p1->p4, unless p1 == p4,
// in which case ignore.
final boolean p1eqp2 = within(x1,y1,x2,y2, 6 * Math.ulp(y2));
final boolean p2eqp3 = within(x2,y2,x3,y3, 6 * Math.ulp(y3));
if (p1eqp2 || p2eqp3) {
getLineOffsets(x1, y1, x3, y3, leftOff, rightOff);
return 4;
}
// if p2-p1 and p4-p3 are parallel, that must mean this curve is a line
float dotsq = (dx1 * dx3 + dy1 * dy3);
dotsq = dotsq * dotsq;
float l1sq = dx1 * dx1 + dy1 * dy1, l3sq = dx3 * dx3 + dy3 * dy3;
if (Helpers.within(dotsq, l1sq * l3sq, 4 * Math.ulp(dotsq))) {
getLineOffsets(x1, y1, x3, y3, leftOff, rightOff);
return 4;
}
// this computes the offsets at t=0, 0.5, 1, using the property that
// for any bezier curve the vectors p2-p1 and p4-p3 are parallel to
// the (dx/dt, dy/dt) vectors at the endpoints.
computeOffset(dx1, dy1, lineWidth2, offset[0]); computeOffset(dx1, dy1, lineWidth2, offset[0]);
computeOffset(dx3, dy3, lineWidth2, offset[1]); computeOffset(dx3, dy3, lineWidth2, offset[1]);
float x1p = x1 + offset[0][0]; // start
float y1p = y1 + offset[0][1]; // point
float x3p = x3 + offset[1][0]; // end
float y3p = y3 + offset[1][1]; // point
computeMiter(x1p, y1p, x1p+dx1, y1p+dy1, x3p, y3p, x3p-dx3, y3p-dy3, leftOff, 2); leftOff[0] = x1 + offset[0][0]; leftOff[1] = y1 + offset[0][1];
leftOff[0] = x1p; leftOff[1] = y1p; leftOff[4] = x3 + offset[1][0]; leftOff[5] = y3 + offset[1][1];
leftOff[4] = x3p; leftOff[5] = y3p; rightOff[0] = x1 - offset[0][0]; rightOff[1] = y1 - offset[0][1];
x1p = x1 - offset[0][0]; y1p = y1 - offset[0][1]; rightOff[4] = x3 - offset[1][0]; rightOff[5] = y3 - offset[1][1];
x3p = x3 - offset[1][0]; y3p = y3 - offset[1][1];
computeMiter(x1p, y1p, x1p+dx1, y1p+dy1, x3p, y3p, x3p-dx3, y3p-dy3, rightOff, 2); float x1p = leftOff[0]; // start
rightOff[0] = x1p; rightOff[1] = y1p; float y1p = leftOff[1]; // point
rightOff[4] = x3p; rightOff[5] = y3p; float x3p = leftOff[4]; // end
float y3p = leftOff[5]; // point
// Corner cases:
// 1. If the two control vectors are parallel, we'll end up with NaN's
// in leftOff (and rightOff in the body of the if below), so we'll
// do getLineOffsets, which is right.
// 2. If the first or second two points are equal, then (dx1,dy1)==(0,0)
// or (dx3,dy3)==(0,0), so (x1p, y1p)==(x1p+dx1, y1p+dy1)
// or (x3p, y3p)==(x3p-dx3, y3p-dy3), which means that
// computeIntersection will put NaN's in leftOff and right off, and
// we will do getLineOffsets, which is right.
computeIntersection(x1p, y1p, x1p+dx1, y1p+dy1, x3p, y3p, x3p-dx3, y3p-dy3, leftOff, 2);
float cx = leftOff[2];
float cy = leftOff[3];
if (!(isFinite(cx) && isFinite(cy))) {
// maybe the right path is not degenerate.
x1p = rightOff[0];
y1p = rightOff[1];
x3p = rightOff[4];
y3p = rightOff[5];
computeIntersection(x1p, y1p, x1p+dx1, y1p+dy1, x3p, y3p, x3p-dx3, y3p-dy3, rightOff, 2);
cx = rightOff[2];
cy = rightOff[3];
if (!(isFinite(cx) && isFinite(cy))) {
// both are degenerate. This curve is a line.
getLineOffsets(x1, y1, x3, y3, leftOff, rightOff);
return 4;
}
// {left,right}Off[0,1,4,5] are already set to the correct values.
leftOff[2] = 2*x2 - cx;
leftOff[3] = 2*y2 - cy;
return 6;
}
// rightOff[2,3] = (x2,y2) - ((left_x2, left_y2) - (x2, y2))
// == 2*(x2, y2) - (left_x2, left_y2)
rightOff[2] = 2*x2 - cx;
rightOff[3] = 2*y2 - cy;
return 6; return 6;
} }
private static boolean isFinite(float x) {
return (Float.NEGATIVE_INFINITY < x && x < Float.POSITIVE_INFINITY);
}
// This is where the curve to be processed is put. We give it // This is where the curve to be processed is put. We give it
// enough room to store 2 curves: one for the current subdivision, the // enough room to store 2 curves: one for the current subdivision, the
// other for the rest of the curve. // other for the rest of the curve.
...@@ -812,12 +821,12 @@ final class Stroker implements PathConsumer2D { ...@@ -812,12 +821,12 @@ final class Stroker implements PathConsumer2D {
// if these vectors are too small, normalize them, to avoid future // if these vectors are too small, normalize them, to avoid future
// precision problems. // precision problems.
if (Math.abs(dxs) < 0.1f && Math.abs(dys) < 0.1f) { if (Math.abs(dxs) < 0.1f && Math.abs(dys) < 0.1f) {
float len = (float)Math.sqrt(dxs*dxs + dys*dys); float len = (float) sqrt(dxs*dxs + dys*dys);
dxs /= len; dxs /= len;
dys /= len; dys /= len;
} }
if (Math.abs(dxf) < 0.1f && Math.abs(dyf) < 0.1f) { if (Math.abs(dxf) < 0.1f && Math.abs(dyf) < 0.1f) {
float len = (float)Math.sqrt(dxf*dxf + dyf*dyf); float len = (float) sqrt(dxf*dxf + dyf*dyf);
dxf /= len; dxf /= len;
dyf /= len; dyf /= len;
} }
...@@ -834,7 +843,6 @@ final class Stroker implements PathConsumer2D { ...@@ -834,7 +843,6 @@ final class Stroker implements PathConsumer2D {
while(it.hasNext()) { while(it.hasNext()) {
int curCurveOff = it.next(); int curCurveOff = it.next();
kind = 0;
switch (type) { switch (type) {
case 8: case 8:
kind = computeOffsetCubic(middle, curCurveOff, lp, rp); kind = computeOffsetCubic(middle, curCurveOff, lp, rp);
...@@ -843,24 +851,22 @@ final class Stroker implements PathConsumer2D { ...@@ -843,24 +851,22 @@ final class Stroker implements PathConsumer2D {
kind = computeOffsetQuad(middle, curCurveOff, lp, rp); kind = computeOffsetQuad(middle, curCurveOff, lp, rp);
break; break;
} }
if (kind != 0) { emitLineTo(lp[0], lp[1]);
emitLineTo(lp[0], lp[1]); switch(kind) {
switch(kind) { case 8:
case 8: emitCurveTo(lp[0], lp[1], lp[2], lp[3], lp[4], lp[5], lp[6], lp[7], false);
emitCurveTo(lp[0], lp[1], lp[2], lp[3], lp[4], lp[5], lp[6], lp[7], false); emitCurveTo(rp[0], rp[1], rp[2], rp[3], rp[4], rp[5], rp[6], rp[7], true);
emitCurveTo(rp[0], rp[1], rp[2], rp[3], rp[4], rp[5], rp[6], rp[7], true); break;
break; case 6:
case 6: emitQuadTo(lp[0], lp[1], lp[2], lp[3], lp[4], lp[5], false);
emitQuadTo(lp[0], lp[1], lp[2], lp[3], lp[4], lp[5], false); emitQuadTo(rp[0], rp[1], rp[2], rp[3], rp[4], rp[5], true);
emitQuadTo(rp[0], rp[1], rp[2], rp[3], rp[4], rp[5], true); break;
break; case 4:
case 4: emitLineTo(lp[2], lp[3]);
emitLineTo(lp[2], lp[3]); emitLineTo(rp[0], rp[1], true);
emitLineTo(rp[0], rp[1], true); break;
break;
}
emitLineTo(rp[kind - 2], rp[kind - 1], true);
} }
emitLineTo(rp[kind - 2], rp[kind - 1], true);
} }
this.cmx = (lp[kind - 2] - rp[kind - 2]) / 2; this.cmx = (lp[kind - 2] - rp[kind - 2]) / 2;
...@@ -887,7 +893,7 @@ final class Stroker implements PathConsumer2D { ...@@ -887,7 +893,7 @@ final class Stroker implements PathConsumer2D {
// we rotate it so that the first vector in the control polygon is // we rotate it so that the first vector in the control polygon is
// parallel to the x-axis. This will ensure that rotated quarter // parallel to the x-axis. This will ensure that rotated quarter
// circles won't be subdivided. // circles won't be subdivided.
final float hypot = (float)Math.sqrt(x12 * x12 + y12 * y12); final float hypot = (float) sqrt(x12 * x12 + y12 * y12);
final float cos = x12 / hypot; final float cos = x12 / hypot;
final float sin = y12 / hypot; final float sin = y12 / hypot;
final float x1 = cos * pts[0] + sin * pts[1]; final float x1 = cos * pts[0] + sin * pts[1];
...@@ -976,12 +982,12 @@ final class Stroker implements PathConsumer2D { ...@@ -976,12 +982,12 @@ final class Stroker implements PathConsumer2D {
// if these vectors are too small, normalize them, to avoid future // if these vectors are too small, normalize them, to avoid future
// precision problems. // precision problems.
if (Math.abs(dxs) < 0.1f && Math.abs(dys) < 0.1f) { if (Math.abs(dxs) < 0.1f && Math.abs(dys) < 0.1f) {
float len = (float)Math.sqrt(dxs*dxs + dys*dys); float len = (float) sqrt(dxs*dxs + dys*dys);
dxs /= len; dxs /= len;
dys /= len; dys /= len;
} }
if (Math.abs(dxf) < 0.1f && Math.abs(dyf) < 0.1f) { if (Math.abs(dxf) < 0.1f && Math.abs(dyf) < 0.1f) {
float len = (float)Math.sqrt(dxf*dxf + dyf*dyf); float len = (float) sqrt(dxf*dxf + dyf*dyf);
dxf /= len; dxf /= len;
dyf /= len; dyf /= len;
} }
...@@ -999,20 +1005,18 @@ final class Stroker implements PathConsumer2D { ...@@ -999,20 +1005,18 @@ final class Stroker implements PathConsumer2D {
int curCurveOff = it.next(); int curCurveOff = it.next();
kind = computeOffsetCubic(middle, curCurveOff, lp, rp); kind = computeOffsetCubic(middle, curCurveOff, lp, rp);
if (kind != 0) { emitLineTo(lp[0], lp[1]);
emitLineTo(lp[0], lp[1]); switch(kind) {
switch(kind) { case 8:
case 8: emitCurveTo(lp[0], lp[1], lp[2], lp[3], lp[4], lp[5], lp[6], lp[7], false);
emitCurveTo(lp[0], lp[1], lp[2], lp[3], lp[4], lp[5], lp[6], lp[7], false); emitCurveTo(rp[0], rp[1], rp[2], rp[3], rp[4], rp[5], rp[6], rp[7], true);
emitCurveTo(rp[0], rp[1], rp[2], rp[3], rp[4], rp[5], rp[6], rp[7], true); break;
break; case 4:
case 4: emitLineTo(lp[2], lp[3]);
emitLineTo(lp[2], lp[3]); emitLineTo(rp[0], rp[1], true);
emitLineTo(rp[0], rp[1], true); break;
break;
}
emitLineTo(rp[kind - 2], rp[kind - 1], true);
} }
emitLineTo(rp[kind - 2], rp[kind - 1], true);
} }
this.cmx = (lp[kind - 2] - rp[kind - 2]) / 2; this.cmx = (lp[kind - 2] - rp[kind - 2]) / 2;
...@@ -1050,12 +1054,12 @@ final class Stroker implements PathConsumer2D { ...@@ -1050,12 +1054,12 @@ final class Stroker implements PathConsumer2D {
// if these vectors are too small, normalize them, to avoid future // if these vectors are too small, normalize them, to avoid future
// precision problems. // precision problems.
if (Math.abs(dxs) < 0.1f && Math.abs(dys) < 0.1f) { if (Math.abs(dxs) < 0.1f && Math.abs(dys) < 0.1f) {
float len = (float)Math.sqrt(dxs*dxs + dys*dys); float len = (float) sqrt(dxs*dxs + dys*dys);
dxs /= len; dxs /= len;
dys /= len; dys /= len;
} }
if (Math.abs(dxf) < 0.1f && Math.abs(dyf) < 0.1f) { if (Math.abs(dxf) < 0.1f && Math.abs(dyf) < 0.1f) {
float len = (float)Math.sqrt(dxf*dxf + dyf*dyf); float len = (float) sqrt(dxf*dxf + dyf*dyf);
dxf /= len; dxf /= len;
dyf /= len; dyf /= len;
} }
...@@ -1073,20 +1077,18 @@ final class Stroker implements PathConsumer2D { ...@@ -1073,20 +1077,18 @@ final class Stroker implements PathConsumer2D {
int curCurveOff = it.next(); int curCurveOff = it.next();
kind = computeOffsetQuad(middle, curCurveOff, lp, rp); kind = computeOffsetQuad(middle, curCurveOff, lp, rp);
if (kind != 0) { emitLineTo(lp[0], lp[1]);
emitLineTo(lp[0], lp[1]); switch(kind) {
switch(kind) { case 6:
case 6: emitQuadTo(lp[0], lp[1], lp[2], lp[3], lp[4], lp[5], false);
emitQuadTo(lp[0], lp[1], lp[2], lp[3], lp[4], lp[5], false); emitQuadTo(rp[0], rp[1], rp[2], rp[3], rp[4], rp[5], true);
emitQuadTo(rp[0], rp[1], rp[2], rp[3], rp[4], rp[5], true); break;
break; case 4:
case 4: emitLineTo(lp[2], lp[3]);
emitLineTo(lp[2], lp[3]); emitLineTo(rp[0], rp[1], true);
emitLineTo(rp[0], rp[1], true); break;
break;
}
emitLineTo(rp[kind - 2], rp[kind - 1], true);
} }
emitLineTo(rp[kind - 2], rp[kind - 1], true);
} }
this.cmx = (lp[kind - 2] - rp[kind - 2]) / 2; this.cmx = (lp[kind - 2] - rp[kind - 2]) / 2;
......
...@@ -49,7 +49,7 @@ label.source=Source : ...@@ -49,7 +49,7 @@ label.source=Source :
label.source.mnemonic=C label.source.mnemonic=C
label.status=Statut : label.status=Statut :
label.username=Nom utilisateur : label.username=Nom utilisateur :
label.username.mnemonic=U label.username.mnemonic=O
label.millimetres=(mm) label.millimetres=(mm)
label.inches=(po) label.inches=(po)
label.topmargin=haut label.topmargin=haut
...@@ -62,7 +62,7 @@ label.rightmargin=droite ...@@ -62,7 +62,7 @@ label.rightmargin=droite
label.rightmargin.mnemonic=D label.rightmargin.mnemonic=D
# #
radiobutton.color=Couleur radiobutton.color=Couleur
radiobutton.color.mnemonic=U radiobutton.color.mnemonic=C
radiobutton.draftq=Brouillon radiobutton.draftq=Brouillon
radiobutton.draftq.mnemonic=L radiobutton.draftq.mnemonic=L
radiobutton.duplex=Duplex radiobutton.duplex=Duplex
...@@ -70,7 +70,7 @@ radiobutton.duplex.mnemonic=D ...@@ -70,7 +70,7 @@ radiobutton.duplex.mnemonic=D
radiobutton.highq=Max. radiobutton.highq=Max.
radiobutton.highq.mnemonic=X radiobutton.highq.mnemonic=X
radiobutton.landscape=Paysage radiobutton.landscape=Paysage
radiobutton.landscape.mnemonic=S radiobutton.landscape.mnemonic=Y
radiobutton.monochrome=Monochrome radiobutton.monochrome=Monochrome
radiobutton.monochrome.mnemonic=M radiobutton.monochrome.mnemonic=M
radiobutton.normalq=Normal radiobutton.normalq=Normal
......
...@@ -15,10 +15,10 @@ button.cancel=Cancelar ...@@ -15,10 +15,10 @@ button.cancel=Cancelar
button.ok=OK button.ok=OK
button.print=Imprimir button.print=Imprimir
button.properties=Propriedades... button.properties=Propriedades...
button.properties.mnemonic=R button.properties.mnemonic=D
# #
checkbox.collate=Agrupar checkbox.collate=Agrupar
checkbox.collate.mnemonic=A checkbox.collate.mnemonic=R
checkbox.jobsheets=P\u00E1gina com Banner checkbox.jobsheets=P\u00E1gina com Banner
checkbox.jobsheets.mnemonic=B checkbox.jobsheets.mnemonic=B
checkbox.printtofile=Imprimir em Arquivo checkbox.printtofile=Imprimir em Arquivo
...@@ -38,7 +38,7 @@ label.jobname.mnemonic=J ...@@ -38,7 +38,7 @@ label.jobname.mnemonic=J
label.numcopies=N\u00FAmero de c\u00F3pias: label.numcopies=N\u00FAmero de c\u00F3pias:
label.numcopies.mnemonic=O label.numcopies.mnemonic=O
label.priority=Prioridade: label.priority=Prioridade:
label.priority.mnemonic=R label.priority.mnemonic=P
label.psname=Nome: label.psname=Nome:
label.psname.mnemonic=N label.psname.mnemonic=N
label.pstype=Tipo: label.pstype=Tipo:
...@@ -59,7 +59,7 @@ label.bottommargin.mnemonic=I ...@@ -59,7 +59,7 @@ label.bottommargin.mnemonic=I
label.leftmargin=esquerda: label.leftmargin=esquerda:
label.leftmargin.mnemonic=Q label.leftmargin.mnemonic=Q
label.rightmargin=direita label.rightmargin=direita
label.rightmargin.mnemonic=R label.rightmargin.mnemonic=D
# #
radiobutton.color=Cor radiobutton.color=Cor
radiobutton.color.mnemonic=O radiobutton.color.mnemonic=O
...@@ -68,7 +68,7 @@ radiobutton.draftq.mnemonic=R ...@@ -68,7 +68,7 @@ radiobutton.draftq.mnemonic=R
radiobutton.duplex=Duplex radiobutton.duplex=Duplex
radiobutton.duplex.mnemonic=D radiobutton.duplex.mnemonic=D
radiobutton.highq=Alta radiobutton.highq=Alta
radiobutton.highq.mnemonic=A radiobutton.highq.mnemonic=T
radiobutton.landscape=Paisagem radiobutton.landscape=Paisagem
radiobutton.landscape.mnemonic=P radiobutton.landscape.mnemonic=P
radiobutton.monochrome=Monocrom\u00E1tico radiobutton.monochrome=Monocrom\u00E1tico
...@@ -76,7 +76,7 @@ radiobutton.monochrome.mnemonic=M ...@@ -76,7 +76,7 @@ radiobutton.monochrome.mnemonic=M
radiobutton.normalq=Normal radiobutton.normalq=Normal
radiobutton.normalq.mnemonic=N radiobutton.normalq.mnemonic=N
radiobutton.oneside=Um Lado radiobutton.oneside=Um Lado
radiobutton.oneside.mnemonic=O radiobutton.oneside.mnemonic=L
radiobutton.portrait=Retrato radiobutton.portrait=Retrato
radiobutton.portrait.mnemonic=R radiobutton.portrait.mnemonic=R
radiobutton.rangeall=Tudo radiobutton.rangeall=Tudo
...@@ -86,7 +86,7 @@ radiobutton.rangepages.mnemonic=P ...@@ -86,7 +86,7 @@ radiobutton.rangepages.mnemonic=P
radiobutton.revlandscape=Paisagem Invertida radiobutton.revlandscape=Paisagem Invertida
radiobutton.revlandscape.mnemonic=N radiobutton.revlandscape.mnemonic=N
radiobutton.revportrait=Retrato Invertido radiobutton.revportrait=Retrato Invertido
radiobutton.revportrait.mnemonic=I radiobutton.revportrait.mnemonic=E
radiobutton.tumble=Virar radiobutton.tumble=Virar
radiobutton.tumble.mnemonic=V radiobutton.tumble.mnemonic=V
# The vkMnemonics correspond with the constants defined in KeyEvent, eg # The vkMnemonics correspond with the constants defined in KeyEvent, eg
...@@ -96,7 +96,7 @@ tab.appearance.vkMnemonic=65 ...@@ -96,7 +96,7 @@ tab.appearance.vkMnemonic=65
tab.general=Geral tab.general=Geral
tab.general.vkMnemonic=71 tab.general.vkMnemonic=71
tab.pagesetup=Configura\u00E7\u00E3o de P\u00E1gina tab.pagesetup=Configura\u00E7\u00E3o de P\u00E1gina
tab.pagesetup.vkMnemonic=80 tab.pagesetup.vkMnemonic=67
# #
error.pagerange=Faixa de p\u00E1ginas inv\u00E1lida; insira novamente os valores (por exemplo, 1-3,5,7-10) error.pagerange=Faixa de p\u00E1ginas inv\u00E1lida; insira novamente os valores (por exemplo, 1-3,5,7-10)
error.destination=Nome de arquivo inv\u00E1lido; tente novamente error.destination=Nome de arquivo inv\u00E1lido; tente novamente
......
...@@ -763,7 +763,7 @@ public class FilePane extends JPanel implements PropertyChangeListener { ...@@ -763,7 +763,7 @@ public class FilePane extends JPanel implements PropertyChangeListener {
public void setValueAt(Object value, int row, int col) { public void setValueAt(Object value, int row, int col) {
if (col == COLUMN_FILENAME) { if (col == COLUMN_FILENAME) {
JFileChooser chooser = getFileChooser(); final JFileChooser chooser = getFileChooser();
File f = (File)getValueAt(row, col); File f = (File)getValueAt(row, col);
if (f != null) { if (f != null) {
String oldDisplayName = chooser.getName(f); String oldDisplayName = chooser.getName(f);
...@@ -782,18 +782,25 @@ public class FilePane extends JPanel implements PropertyChangeListener { ...@@ -782,18 +782,25 @@ public class FilePane extends JPanel implements PropertyChangeListener {
// rename // rename
FileSystemView fsv = chooser.getFileSystemView(); FileSystemView fsv = chooser.getFileSystemView();
File f2 = fsv.createFileObject(f.getParentFile(), newFileName); final File f2 = fsv.createFileObject(f.getParentFile(), newFileName);
if (f2.exists()) { if (f2.exists()) {
JOptionPane.showMessageDialog(chooser, MessageFormat.format(renameErrorFileExistsText, JOptionPane.showMessageDialog(chooser, MessageFormat.format(renameErrorFileExistsText,
oldFileName), renameErrorTitleText, JOptionPane.ERROR_MESSAGE); oldFileName), renameErrorTitleText, JOptionPane.ERROR_MESSAGE);
} else { } else {
if (FilePane.this.getModel().renameFile(f, f2)) { if (FilePane.this.getModel().renameFile(f, f2)) {
if (fsv.isParent(chooser.getCurrentDirectory(), f2)) { if (fsv.isParent(chooser.getCurrentDirectory(), f2)) {
if (chooser.isMultiSelectionEnabled()) { // The setSelectedFile method produces a new setValueAt invocation while the JTable
chooser.setSelectedFiles(new File[]{f2}); // is editing. Postpone file selection to be sure that edit mode of the JTable
} else { // is completed
chooser.setSelectedFile(f2); SwingUtilities.invokeLater(new Runnable() {
} public void run() {
if (chooser.isMultiSelectionEnabled()) {
chooser.setSelectedFiles(new File[]{f2});
} else {
chooser.setSelectedFile(f2);
}
}
});
} else { } else {
// Could be because of delay in updating Desktop folder // Could be because of delay in updating Desktop folder
// chooser.setSelectedFile(null); // chooser.setSelectedFile(null);
......
...@@ -29,6 +29,8 @@ import java.awt.event.*; ...@@ -29,6 +29,8 @@ import java.awt.event.*;
import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener; import java.beans.PropertyChangeListener;
import java.io.*; import java.io.*;
import java.security.AccessController;
import java.security.PrivilegedAction;
import javax.swing.*; import javax.swing.*;
import javax.swing.border.*; import javax.swing.border.*;
...@@ -79,7 +81,12 @@ public class WindowsPlacesBar extends JToolBar ...@@ -79,7 +81,12 @@ public class WindowsPlacesBar extends JToolBar
setBackground(bgColor); setBackground(bgColor);
FileSystemView fsv = fc.getFileSystemView(); FileSystemView fsv = fc.getFileSystemView();
files = (File[])ShellFolder.get("fileChooserShortcutPanelFolders"); files = AccessController.doPrivileged(new PrivilegedAction<File[]>() {
public File[] run() {
return (File[]) ShellFolder.get("fileChooserShortcutPanelFolders");
}
});
buttons = new JToggleButton[files.length]; buttons = new JToggleButton[files.length];
buttonGroup = new ButtonGroup(); buttonGroup = new ButtonGroup();
for (int i = 0; i < files.length; i++) { for (int i = 0; i < files.length; i++) {
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
/* avoid extra function call in case we use fread (TVT) */ /* avoid extra function call in case we use fread (TVT) */
#define READ(_gif,_buf,_len) \ #define READ(_gif,_buf,_len) \
(((GifFilePrivateType*)_gif->Private)->Read ? \ (((GifFilePrivateType*)_gif->Private)->Read ? \
((GifFilePrivateType*)_gif->Private)->Read(_gif,_buf,_len) : \ (size_t)((GifFilePrivateType*)_gif->Private)->Read(_gif,_buf,_len) : \
fread(_buf,1,_len,((GifFilePrivateType*)_gif->Private)->File)) fread(_buf,1,_len,((GifFilePrivateType*)_gif->Private)->File))
static int DGifGetWord(GifFileType *GifFile, int *Word); static int DGifGetWord(GifFileType *GifFile, int *Word);
......
...@@ -55,13 +55,15 @@ typedef Int32 hsFixed; ...@@ -55,13 +55,15 @@ typedef Int32 hsFixed;
typedef Int32 hsFract; typedef Int32 hsFract;
typedef UInt32 Bool32; typedef UInt32 Bool32;
#ifndef __cplusplus
#ifndef false #ifndef false
#define false 0 #define false 0
#endif #endif
#ifndef true #ifndef true
#define true 1 #define true 1
#endif #endif
#endif
#define kPosInfinity32 (0x7fffffff) #define kPosInfinity32 (0x7fffffff)
#define kNegInfinity32 (0x80000000) #define kNegInfinity32 (0x80000000)
......
...@@ -162,7 +162,7 @@ static le_int32 decompose(LEUnicode syllable, LEUnicode &lead, LEUnicode &vowel, ...@@ -162,7 +162,7 @@ static le_int32 decompose(LEUnicode syllable, LEUnicode &lead, LEUnicode &vowel,
return 0; return 0;
} }
lead = LJMO_FIRST + (sIndex / HSYL_LVCNT); lead = (LEUnicode)(LJMO_FIRST + (sIndex / HSYL_LVCNT));
vowel = VJMO_FIRST + (sIndex % HSYL_LVCNT) / TJMO_COUNT; vowel = VJMO_FIRST + (sIndex % HSYL_LVCNT) / TJMO_COUNT;
trail = TJMO_FIRST + (sIndex % TJMO_COUNT); trail = TJMO_FIRST + (sIndex % TJMO_COUNT);
......
...@@ -65,9 +65,9 @@ void MPreFixups::add(le_int32 baseIndex, le_int32 mpreIndex) ...@@ -65,9 +65,9 @@ void MPreFixups::add(le_int32 baseIndex, le_int32 mpreIndex)
} }
} }
void MPreFixups::apply(LEGlyphStorage &glyphStorage, LEErrorCode& success) void MPreFixups::apply(LEGlyphStorage &glyphStorage, LEErrorCode& leSuccess)
{ {
if (LE_FAILURE(success)) { if (LE_FAILURE(leSuccess)) {
return; return;
} }
......
...@@ -1479,16 +1479,19 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient { ...@@ -1479,16 +1479,19 @@ class XListPeer extends XComponentPeer implements ListPeer, XScrollbarClient {
int h = height - (SCROLLBAR_AREA + (2 * MARGIN)); int h = height - (SCROLLBAR_AREA + (2 * MARGIN));
hsb.setValue(hsb.getValue() + x); hsb.setValue(hsb.getValue() + x);
int options = PAINT_ITEMS | PAINT_HSCROLL;
Rectangle source = null; Rectangle source = null;
Point distance = null; Point distance = null;
if (x < 0) { if (x < 0) {
source = new Rectangle(MARGIN + SPACE, MARGIN, w + x, h); source = new Rectangle(MARGIN + SPACE, MARGIN, w + x, h);
distance = new Point(-x, 0); distance = new Point(-x, 0);
options |= COPY_AREA;
} else if (x > 0) { } else if (x > 0) {
source = new Rectangle(MARGIN + SPACE + x, MARGIN, w - x, h); source = new Rectangle(MARGIN + SPACE + x, MARGIN, w - x, h);
distance = new Point(-x, 0); distance = new Point(-x, 0);
options |= COPY_AREA;
} }
int options = COPY_AREA | PAINT_ITEMS | PAINT_HSCROLL;
repaint(vsb.getValue(), lastItemDisplayed(), options, source, distance); repaint(vsb.getValue(), lastItemDisplayed(), options, source, distance);
} }
......
...@@ -256,9 +256,9 @@ public class FcFontConfiguration extends FontConfiguration { ...@@ -256,9 +256,9 @@ public class FcFontConfiguration extends FontConfiguration {
} }
if (installedFallbackFontFiles != null) { if (installedFallbackFontFiles != null) {
System.arraycopy(fileNames, index, System.arraycopy(installedFallbackFontFiles, 0,
installedFallbackFontFiles, fileNames, fcFonts.length,
0, installedFallbackFontFiles.length); installedFallbackFontFiles.length);
} }
result[fontIndex * NUM_STYLES + styleIndex] result[fontIndex * NUM_STYLES + styleIndex]
......
...@@ -239,6 +239,13 @@ void DAUDIO_GetFormats(INT32 mixerIndex, INT32 deviceID, int isSource, void* cre ...@@ -239,6 +239,13 @@ void DAUDIO_GetFormats(INT32 mixerIndex, INT32 deviceID, int isSource, void* cre
snd_pcm_close(handle); snd_pcm_close(handle);
} }
/** Workaround for cr 7033899, 7030629:
* dmix plugin doesn't like flush (snd_pcm_drop) when the buffer is empty
* (just opened, underruned or already flushed).
* Sometimes it causes PCM falls to -EBADFD error,
* sometimes causes bufferSize change.
* To prevent unnecessary flushes AlsaPcmInfo::isRunning & isFlushed are used.
*/
/* ******* ALSA PCM INFO ******************** */ /* ******* ALSA PCM INFO ******************** */
typedef struct tag_AlsaPcmInfo { typedef struct tag_AlsaPcmInfo {
snd_pcm_t* handle; snd_pcm_t* handle;
...@@ -248,6 +255,8 @@ typedef struct tag_AlsaPcmInfo { ...@@ -248,6 +255,8 @@ typedef struct tag_AlsaPcmInfo {
int frameSize; // storage size in Bytes int frameSize; // storage size in Bytes
unsigned int periods; unsigned int periods;
snd_pcm_uframes_t periodSize; snd_pcm_uframes_t periodSize;
short int isRunning; // see comment above
short int isFlushed; // see comment above
#ifdef GET_POSITION_METHOD2 #ifdef GET_POSITION_METHOD2
// to be used exclusively by getBytePosition! // to be used exclusively by getBytePosition!
snd_pcm_status_t* positionStatus; snd_pcm_status_t* positionStatus;
...@@ -432,6 +441,9 @@ void* DAUDIO_Open(INT32 mixerIndex, INT32 deviceID, int isSource, ...@@ -432,6 +441,9 @@ void* DAUDIO_Open(INT32 mixerIndex, INT32 deviceID, int isSource,
return NULL; return NULL;
} }
memset(info, 0, sizeof(AlsaPcmInfo)); memset(info, 0, sizeof(AlsaPcmInfo));
// initial values are: stopped, flushed
info->isRunning = 0;
info->isFlushed = 1;
ret = openPCMfromDeviceID(deviceID, &(info->handle), isSource, FALSE /* do open device*/); ret = openPCMfromDeviceID(deviceID, &(info->handle), isSource, FALSE /* do open device*/);
if (ret == 0) { if (ret == 0) {
...@@ -587,6 +599,14 @@ int DAUDIO_Start(void* id, int isSource) { ...@@ -587,6 +599,14 @@ int DAUDIO_Start(void* id, int isSource) {
|| (state == SND_PCM_STATE_RUNNING) || (state == SND_PCM_STATE_RUNNING)
|| (state == SND_PCM_STATE_XRUN) || (state == SND_PCM_STATE_XRUN)
|| (state == SND_PCM_STATE_SUSPENDED); || (state == SND_PCM_STATE_SUSPENDED);
if (ret) {
info->isRunning = 1;
// source line should keep isFlushed value until Write() is called;
// for target data line reset it right now.
if (!isSource) {
info->isFlushed = 0;
}
}
TRACE1("< DAUDIO_Start %s\n", ret?"success":"error"); TRACE1("< DAUDIO_Start %s\n", ret?"success":"error");
return ret?TRUE:FALSE; return ret?TRUE:FALSE;
} }
...@@ -606,6 +626,7 @@ int DAUDIO_Stop(void* id, int isSource) { ...@@ -606,6 +626,7 @@ int DAUDIO_Stop(void* id, int isSource) {
ERROR1("ERROR in snd_pcm_pause: %s\n", snd_strerror(ret)); ERROR1("ERROR in snd_pcm_pause: %s\n", snd_strerror(ret));
return FALSE; return FALSE;
} }
info->isRunning = 0;
TRACE0("< DAUDIO_Stop success\n"); TRACE0("< DAUDIO_Stop success\n");
return TRUE; return TRUE;
} }
...@@ -651,8 +672,7 @@ int xrun_recovery(AlsaPcmInfo* info, int err) { ...@@ -651,8 +672,7 @@ int xrun_recovery(AlsaPcmInfo* info, int err) {
return -1; return -1;
} }
return 1; return 1;
} } else if (err == -ESTRPIPE) {
else if (err == -ESTRPIPE) {
TRACE0("xrun_recovery: suspended.\n"); TRACE0("xrun_recovery: suspended.\n");
ret = snd_pcm_resume(info->handle); ret = snd_pcm_resume(info->handle);
if (ret < 0) { if (ret < 0) {
...@@ -667,11 +687,11 @@ int xrun_recovery(AlsaPcmInfo* info, int err) { ...@@ -667,11 +687,11 @@ int xrun_recovery(AlsaPcmInfo* info, int err) {
return -1; return -1;
} }
return 1; return 1;
} } else if (err == -EAGAIN) {
else if (err == -EAGAIN) {
TRACE0("xrun_recovery: EAGAIN try again flag.\n"); TRACE0("xrun_recovery: EAGAIN try again flag.\n");
return 0; return 0;
} }
TRACE2("xrun_recovery: unexpected error %d: %s\n", err, snd_strerror(err)); TRACE2("xrun_recovery: unexpected error %d: %s\n", err, snd_strerror(err));
return -1; return -1;
} }
...@@ -691,6 +711,7 @@ int DAUDIO_Write(void* id, char* data, int byteSize) { ...@@ -691,6 +711,7 @@ int DAUDIO_Write(void* id, char* data, int byteSize) {
TRACE0("< DAUDIO_Write returning -1\n"); TRACE0("< DAUDIO_Write returning -1\n");
return -1; return -1;
} }
count = 2; // maximum number of trials to recover from underrun count = 2; // maximum number of trials to recover from underrun
//frameSize = snd_pcm_bytes_to_frames(info->handle, byteSize); //frameSize = snd_pcm_bytes_to_frames(info->handle, byteSize);
frameSize = (snd_pcm_sframes_t) (byteSize / info->frameSize); frameSize = (snd_pcm_sframes_t) (byteSize / info->frameSize);
...@@ -712,6 +733,12 @@ int DAUDIO_Write(void* id, char* data, int byteSize) { ...@@ -712,6 +733,12 @@ int DAUDIO_Write(void* id, char* data, int byteSize) {
} }
} while (TRUE); } while (TRUE);
//ret = snd_pcm_frames_to_bytes(info->handle, writtenFrames); //ret = snd_pcm_frames_to_bytes(info->handle, writtenFrames);
if (writtenFrames > 0) {
// reset "flushed" flag
info->isFlushed = 0;
}
ret = (int) (writtenFrames * info->frameSize); ret = (int) (writtenFrames * info->frameSize);
TRACE1("< DAUDIO_Write: returning %d bytes.\n", ret); TRACE1("< DAUDIO_Write: returning %d bytes.\n", ret);
return ret; return ret;
...@@ -736,6 +763,11 @@ int DAUDIO_Read(void* id, char* data, int byteSize) { ...@@ -736,6 +763,11 @@ int DAUDIO_Read(void* id, char* data, int byteSize) {
TRACE0("< DAUDIO_Read returning -1\n"); TRACE0("< DAUDIO_Read returning -1\n");
return -1; return -1;
} }
if (!info->isRunning && info->isFlushed) {
// PCM has nothing to read
return 0;
}
count = 2; // maximum number of trials to recover from error count = 2; // maximum number of trials to recover from error
//frameSize = snd_pcm_bytes_to_frames(info->handle, byteSize); //frameSize = snd_pcm_bytes_to_frames(info->handle, byteSize);
frameSize = (snd_pcm_sframes_t) (byteSize / info->frameSize); frameSize = (snd_pcm_sframes_t) (byteSize / info->frameSize);
...@@ -784,12 +816,22 @@ int DAUDIO_Flush(void* id, int isSource) { ...@@ -784,12 +816,22 @@ int DAUDIO_Flush(void* id, int isSource) {
int ret; int ret;
TRACE0("DAUDIO_Flush\n"); TRACE0("DAUDIO_Flush\n");
if (info->isFlushed) {
// nothing to drop
return 1;
}
ret = snd_pcm_drop(info->handle); ret = snd_pcm_drop(info->handle);
if (ret != 0) { if (ret != 0) {
ERROR1("ERROR in snd_pcm_drop: %s\n", snd_strerror(ret)); ERROR1("ERROR in snd_pcm_drop: %s\n", snd_strerror(ret));
return FALSE; return FALSE;
} }
ret = DAUDIO_Start(id, isSource);
info->isFlushed = 1;
if (info->isRunning) {
ret = DAUDIO_Start(id, isSource);
}
return ret; return ret;
} }
...@@ -800,7 +842,7 @@ int DAUDIO_GetAvailable(void* id, int isSource) { ...@@ -800,7 +842,7 @@ int DAUDIO_GetAvailable(void* id, int isSource) {
int ret; int ret;
state = snd_pcm_state(info->handle); state = snd_pcm_state(info->handle);
if (state == SND_PCM_STATE_XRUN) { if (info->isFlushed || state == SND_PCM_STATE_XRUN) {
// if in xrun state then we have the entire buffer available, // if in xrun state then we have the entire buffer available,
// not 0 as alsa reports // not 0 as alsa reports
ret = info->bufferSizeInBytes; ret = info->bufferSizeInBytes;
...@@ -841,7 +883,7 @@ INT64 DAUDIO_GetBytePosition(void* id, int isSource, INT64 javaBytePos) { ...@@ -841,7 +883,7 @@ INT64 DAUDIO_GetBytePosition(void* id, int isSource, INT64 javaBytePos) {
snd_pcm_state_t state; snd_pcm_state_t state;
state = snd_pcm_state(info->handle); state = snd_pcm_state(info->handle);
if (state != SND_PCM_STATE_XRUN) { if (!info->isFlushed && state != SND_PCM_STATE_XRUN) {
#ifdef GET_POSITION_METHOD2 #ifdef GET_POSITION_METHOD2
snd_timestamp_t* ts; snd_timestamp_t* ts;
snd_pcm_uframes_t framesAvail; snd_pcm_uframes_t framesAvail;
......
...@@ -1107,7 +1107,8 @@ Java_sun_font_FontConfigManager_getFontConfig ...@@ -1107,7 +1107,8 @@ Java_sun_font_FontConfigManager_getFontConfig
arrlen = (*env)->GetArrayLength(env, fcCompFontArray); arrlen = (*env)->GetArrayLength(env, fcCompFontArray);
for (i=0; i<arrlen; i++) { for (i=0; i<arrlen; i++) {
FcFontSet* fontset; FcFontSet* fontset;
int fn, j, fontCount, nfonts, minGlyphs; int fn, j, fontCount, nfonts;
unsigned int minGlyphs;
FcChar8 **family, **styleStr, **fullname, **file; FcChar8 **family, **styleStr, **fullname, **file;
jarray fcFontArr; jarray fcFontArr;
......
...@@ -830,7 +830,14 @@ class HTMLCodec extends InputStream { ...@@ -830,7 +830,14 @@ class HTMLCodec extends InputStream {
if( -1 == iStartOffset ){ if( -1 == iStartOffset ){
throw new IOException(FAILURE_MSG + "invalid HTML format."); throw new IOException(FAILURE_MSG + "invalid HTML format.");
} }
iReadCount = bufferedStream.skip(iStartOffset);
int curOffset = 0;
while (curOffset < iStartOffset){
curOffset += bufferedStream.skip(iStartOffset - curOffset);
}
iReadCount = curOffset;
if( iStartOffset != iReadCount ){ if( iStartOffset != iReadCount ){
throw new IOException(FAILURE_MSG + "Byte stream ends in description."); throw new IOException(FAILURE_MSG + "Byte stream ends in description.");
} }
......
...@@ -235,7 +235,7 @@ static int CALLBACK EnumFontFacesInFamilyProcW( ...@@ -235,7 +235,7 @@ static int CALLBACK EnumFontFacesInFamilyProcW(
} }
fullname = (*env)->NewString(env, lpelfe->elfFullName, fullname = (*env)->NewString(env, lpelfe->elfFullName,
wcslen((LPWSTR)lpelfe->elfFullName)); (jsize)wcslen((LPWSTR)lpelfe->elfFullName));
fullnameLC = (*env)->CallObjectMethod(env, fullname, fullnameLC = (*env)->CallObjectMethod(env, fullname,
fmi->toLowerCaseMID, fmi->locale); fmi->toLowerCaseMID, fmi->locale);
(*env)->CallBooleanMethod(env, fmi->list, fmi->addMID, fullname); (*env)->CallBooleanMethod(env, fmi->list, fmi->addMID, fullname);
...@@ -314,7 +314,7 @@ static int CALLBACK EnumFamilyNamesW( ...@@ -314,7 +314,7 @@ static int CALLBACK EnumFamilyNamesW(
GdiFontMapInfo *fmi = (GdiFontMapInfo*)lParam; GdiFontMapInfo *fmi = (GdiFontMapInfo*)lParam;
JNIEnv *env = fmi->env; JNIEnv *env = fmi->env;
jstring familyLC; jstring familyLC;
int slen; size_t slen;
LOGFONTW lfw; LOGFONTW lfw;
/* Both Vista and XP return DEVICE_FONTTYPE for OTF fonts */ /* Both Vista and XP return DEVICE_FONTTYPE for OTF fonts */
...@@ -336,7 +336,7 @@ static int CALLBACK EnumFamilyNamesW( ...@@ -336,7 +336,7 @@ static int CALLBACK EnumFamilyNamesW(
return 1; return 1;
} }
slen = wcslen(lpelfe->elfLogFont.lfFaceName); slen = wcslen(lpelfe->elfLogFont.lfFaceName);
fmi->family = (*env)->NewString(env,lpelfe->elfLogFont.lfFaceName, slen); fmi->family = (*env)->NewString(env,lpelfe->elfLogFont.lfFaceName, (jsize)slen);
familyLC = (*env)->CallObjectMethod(env, fmi->family, familyLC = (*env)->CallObjectMethod(env, fmi->family,
fmi->toLowerCaseMID, fmi->locale); fmi->toLowerCaseMID, fmi->locale);
/* check if already seen this family with a different charset */ /* check if already seen this family with a different charset */
...@@ -386,10 +386,10 @@ static int CALLBACK EnumFamilyNamesW( ...@@ -386,10 +386,10 @@ static int CALLBACK EnumFamilyNamesW(
static BOOL RegistryToBaseTTNameA(LPSTR name) { static BOOL RegistryToBaseTTNameA(LPSTR name) {
static const char TTSUFFIX[] = " (TrueType)"; static const char TTSUFFIX[] = " (TrueType)";
static const char OTSUFFIX[] = " (OpenType)"; static const char OTSUFFIX[] = " (OpenType)";
int TTSLEN = strlen(TTSUFFIX); size_t TTSLEN = strlen(TTSUFFIX);
char *suffix; char *suffix;
int len = strlen(name); size_t len = strlen(name);
if (len == 0) { if (len == 0) {
return FALSE; return FALSE;
} }
...@@ -412,10 +412,10 @@ static BOOL RegistryToBaseTTNameA(LPSTR name) { ...@@ -412,10 +412,10 @@ static BOOL RegistryToBaseTTNameA(LPSTR name) {
static BOOL RegistryToBaseTTNameW(LPWSTR name) { static BOOL RegistryToBaseTTNameW(LPWSTR name) {
static const wchar_t TTSUFFIX[] = L" (TrueType)"; static const wchar_t TTSUFFIX[] = L" (TrueType)";
static const wchar_t OTSUFFIX[] = L" (OpenType)"; static const wchar_t OTSUFFIX[] = L" (OpenType)";
int TTSLEN = wcslen(TTSUFFIX); size_t TTSLEN = wcslen(TTSUFFIX);
wchar_t *suffix; wchar_t *suffix;
int len = wcslen(name); size_t len = wcslen(name);
if (len == 0) { if (len == 0) {
return FALSE; return FALSE;
} }
...@@ -439,7 +439,7 @@ static void registerFontA(GdiFontMapInfo *fmi, jobject fontToFileMap, ...@@ -439,7 +439,7 @@ static void registerFontA(GdiFontMapInfo *fmi, jobject fontToFileMap,
LPSTR ptr1, ptr2; LPSTR ptr1, ptr2;
jstring fontStr; jstring fontStr;
JNIEnv *env = fmi->env; JNIEnv *env = fmi->env;
int dslen = strlen(data); size_t dslen = strlen(data);
jstring fileStr = JNU_NewStringPlatform(env, data); jstring fileStr = JNU_NewStringPlatform(env, data);
/* TTC or ttc means it may be a collection. Need to parse out /* TTC or ttc means it may be a collection. Need to parse out
...@@ -488,8 +488,8 @@ static void registerFontW(GdiFontMapInfo *fmi, jobject fontToFileMap, ...@@ -488,8 +488,8 @@ static void registerFontW(GdiFontMapInfo *fmi, jobject fontToFileMap,
wchar_t *ptr1, *ptr2; wchar_t *ptr1, *ptr2;
jstring fontStr; jstring fontStr;
JNIEnv *env = fmi->env; JNIEnv *env = fmi->env;
int dslen = wcslen(data); size_t dslen = wcslen(data);
jstring fileStr = (*env)->NewString(env, data, dslen); jstring fileStr = (*env)->NewString(env, data, (jsize)dslen);
/* TTC or ttc means it may be a collection. Need to parse out /* TTC or ttc means it may be a collection. Need to parse out
* multiple font face names separated by " & " * multiple font face names separated by " & "
...@@ -510,7 +510,7 @@ static void registerFontW(GdiFontMapInfo *fmi, jobject fontToFileMap, ...@@ -510,7 +510,7 @@ static void registerFontW(GdiFontMapInfo *fmi, jobject fontToFileMap,
while ((ptr2 = wcsstr(ptr1, L" & ")) != NULL) { while ((ptr2 = wcsstr(ptr1, L" & ")) != NULL) {
ptr1 = ptr2+3; ptr1 = ptr2+3;
} }
fontStr = (*env)->NewString(env, ptr1, wcslen(ptr1)); fontStr = (*env)->NewString(env, ptr1, (jsize)wcslen(ptr1));
fontStr = (*env)->CallObjectMethod(env, fontStr, fontStr = (*env)->CallObjectMethod(env, fontStr,
fmi->toLowerCaseMID, fmi->toLowerCaseMID,
fmi->locale); fmi->locale);
...@@ -524,7 +524,7 @@ static void registerFontW(GdiFontMapInfo *fmi, jobject fontToFileMap, ...@@ -524,7 +524,7 @@ static void registerFontW(GdiFontMapInfo *fmi, jobject fontToFileMap,
} }
} }
} else { } else {
fontStr = (*env)->NewString(env, name, wcslen(name)); fontStr = (*env)->NewString(env, name, (jsize)wcslen(name));
fontStr = (*env)->CallObjectMethod(env, fontStr, fontStr = (*env)->CallObjectMethod(env, fontStr,
fmi->toLowerCaseMID, fmi->locale); fmi->toLowerCaseMID, fmi->locale);
(*env)->CallObjectMethod(env, fontToFileMap, fmi->putMID, (*env)->CallObjectMethod(env, fontToFileMap, fmi->putMID,
......
...@@ -187,6 +187,7 @@ void D3DPipelineManager::NotifyAdapterEventListeners(UINT adapter, ...@@ -187,6 +187,7 @@ void D3DPipelineManager::NotifyAdapterEventListeners(UINT adapter,
} }
JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
RETURN_IF_NULL(env);
pMgr = D3DPipelineManager::GetInstance(); pMgr = D3DPipelineManager::GetInstance();
RETURN_IF_NULL(pMgr); RETURN_IF_NULL(pMgr);
......
...@@ -705,7 +705,7 @@ JNIEXPORT jobject JNICALL Java_sun_security_mscapi_RSAKeyPairGenerator_generateR ...@@ -705,7 +705,7 @@ JNIEXPORT jobject JNICALL Java_sun_security_mscapi_RSAKeyPairGenerator_generateR
HCRYPTPROV hCryptProv = NULL; HCRYPTPROV hCryptProv = NULL;
HCRYPTKEY hKeyPair; HCRYPTKEY hKeyPair;
DWORD dwFlags = (keySize << 16) | CRYPT_EXPORTABLE; DWORD dwFlags = (keySize << 16) | CRYPT_EXPORTABLE;
jobject keypair; jobject keypair = NULL;
const char* pszKeyContainerName = NULL; // UUID const char* pszKeyContainerName = NULL; // UUID
__try __try
......
...@@ -48,7 +48,7 @@ void AwtObjectList::Add(AwtObject* obj) ...@@ -48,7 +48,7 @@ void AwtObjectList::Add(AwtObject* obj)
m_head = item; m_head = item;
} }
void AwtObjectList::Remove(AwtObject* obj) BOOL AwtObjectList::Remove(AwtObject* obj)
{ {
CriticalSection::Lock l(m_lock); CriticalSection::Lock l(m_lock);
...@@ -64,11 +64,14 @@ void AwtObjectList::Remove(AwtObject* obj) ...@@ -64,11 +64,14 @@ void AwtObjectList::Remove(AwtObject* obj)
} }
DASSERT(item != NULL); DASSERT(item != NULL);
delete item; delete item;
return; return TRUE;
} }
lastItem = item; lastItem = item;
item = item->next; item = item->next;
} }
return FALSE;
// DASSERT(FALSE); // should never get here... // DASSERT(FALSE); // should never get here...
// even if it does it shouldn't be fatal. // even if it does it shouldn't be fatal.
} }
......
...@@ -46,7 +46,7 @@ public: ...@@ -46,7 +46,7 @@ public:
AwtObjectList(); AwtObjectList();
void Add(AwtObject* obj); void Add(AwtObject* obj);
void Remove(AwtObject* obj); BOOL Remove(AwtObject* obj);
#ifdef DEBUG #ifdef DEBUG
/* Used for sanity checks only. */ /* Used for sanity checks only. */
AwtObject* LookUp(AwtObject* obj); AwtObject* LookUp(AwtObject* obj);
......
...@@ -294,7 +294,7 @@ Java_sun_awt_windows_WClipboard_publishClipboardData(JNIEnv *env, ...@@ -294,7 +294,7 @@ Java_sun_awt_windows_WClipboard_publishClipboardData(JNIEnv *env,
if (format == CF_HDROP) { if (format == CF_HDROP) {
DROPFILES *dropfiles = (DROPFILES *)dataout; DROPFILES *dropfiles = (DROPFILES *)dataout;
dropfiles->pFiles = sizeof(DROPFILES); dropfiles->pFiles = sizeof(DROPFILES);
dropfiles->fWide = FALSE; // good guess! dropfiles->fWide = TRUE; // we publish only Unicode
dataout += sizeof(DROPFILES); dataout += sizeof(DROPFILES);
} }
......
...@@ -549,8 +549,6 @@ AwtComponent::CreateHWnd(JNIEnv *env, LPCWSTR title, ...@@ -549,8 +549,6 @@ AwtComponent::CreateHWnd(JNIEnv *env, LPCWSTR title,
m_hwnd = hwnd; m_hwnd = hwnd;
ImmAssociateContext(NULL);
SetDrawState((jint)JAWT_LOCK_SURFACE_CHANGED | SetDrawState((jint)JAWT_LOCK_SURFACE_CHANGED |
(jint)JAWT_LOCK_BOUNDS_CHANGED | (jint)JAWT_LOCK_BOUNDS_CHANGED |
(jint)JAWT_LOCK_CLIP_CHANGED); (jint)JAWT_LOCK_CLIP_CHANGED);
...@@ -1203,7 +1201,7 @@ void SpyWinMessage(HWND hwnd, UINT message, LPCTSTR szComment) { ...@@ -1203,7 +1201,7 @@ void SpyWinMessage(HWND hwnd, UINT message, LPCTSTR szComment) {
WIN_MSG(WM_IME_COMPOSITIONFULL) WIN_MSG(WM_IME_COMPOSITIONFULL)
WIN_MSG(WM_IME_SELECT) WIN_MSG(WM_IME_SELECT)
WIN_MSG(WM_IME_CHAR) WIN_MSG(WM_IME_CHAR)
FMT_MSG(0x0288, "WM_IME_REQUEST") FMT_MSG(WM_IME_REQUEST)
WIN_MSG(WM_IME_KEYDOWN) WIN_MSG(WM_IME_KEYDOWN)
WIN_MSG(WM_IME_KEYUP) WIN_MSG(WM_IME_KEYUP)
FMT_MSG(0x02A1, "WM_MOUSEHOVER") FMT_MSG(0x02A1, "WM_MOUSEHOVER")
...@@ -1733,7 +1731,7 @@ LRESULT AwtComponent::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) ...@@ -1733,7 +1731,7 @@ LRESULT AwtComponent::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
case WM_IME_SELECT: case WM_IME_SELECT:
case WM_IME_KEYUP: case WM_IME_KEYUP:
case WM_IME_KEYDOWN: case WM_IME_KEYDOWN:
case 0x0288: // WM_IME_REQUEST case WM_IME_REQUEST:
CallProxyDefWindowProc(message, wParam, lParam, retValue, mr); CallProxyDefWindowProc(message, wParam, lParam, retValue, mr);
break; break;
case WM_CHAR: case WM_CHAR:
...@@ -1969,7 +1967,9 @@ MsgRouting AwtComponent::WmDestroy() ...@@ -1969,7 +1967,9 @@ MsgRouting AwtComponent::WmDestroy()
{ {
// fix for 6259348: we should enter the SyncCall critical section before // fix for 6259348: we should enter the SyncCall critical section before
// disposing the native object, that is value 1 of lParam is intended for // disposing the native object, that is value 1 of lParam is intended for
AwtToolkit::GetInstance().SendMessage(WM_AWT_DISPOSE, (WPARAM)this, (LPARAM)1); if(m_peerObject != NULL) { // is not being terminating
AwtToolkit::GetInstance().SendMessage(WM_AWT_DISPOSE, (WPARAM)m_peerObject, (LPARAM)1);
}
return mrConsume; return mrConsume;
} }
...@@ -2020,25 +2020,6 @@ MsgRouting AwtComponent::WmExitMenuLoop(BOOL isTrackPopupMenu) ...@@ -2020,25 +2020,6 @@ MsgRouting AwtComponent::WmExitMenuLoop(BOOL isTrackPopupMenu)
MsgRouting AwtComponent::WmShowWindow(BOOL show, UINT status) MsgRouting AwtComponent::WmShowWindow(BOOL show, UINT status)
{ {
// NULL-InputContext is associated to all window just after they created.
// ( see CreateHWnd() )
// But to TextField and TextArea on Win95, valid InputContext is associated
// by system after that. This is not happen on NT4.0
// For workaround, force context to NULL here.
// Fix for 4730228
// Check if we already have Java-associated input method
HIMC context = 0;
if (m_InputMethod != NULL) {
// If so get the appropriate context from it and use it instead of empty context
JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
context = (HIMC)(UINT_PTR)(JNU_GetFieldByName(env, NULL, m_InputMethod, "context", "I").i);
}
if (ImmGetContext() != 0 && ImmGetContext() != context) {
ImmAssociateContext(context);
}
return mrDoDefault; return mrDoDefault;
} }
...@@ -4655,10 +4636,6 @@ void* AwtComponent::SetNativeFocusOwner(void *self) { ...@@ -4655,10 +4636,6 @@ void* AwtComponent::SetNativeFocusOwner(void *self) {
ret: ret:
if (c && ::IsWindow(c->GetHWnd())) { if (c && ::IsWindow(c->GetHWnd())) {
sm_focusOwner = c->GetHWnd(); sm_focusOwner = c->GetHWnd();
AwtFrame *owner = (AwtFrame*)GetComponent(c->GetProxyToplevelContainer());
if (owner) {
owner->SetLastProxiedFocusOwner(sm_focusOwner);
}
} else { } else {
sm_focusOwner = NULL; sm_focusOwner = NULL;
} }
...@@ -6534,8 +6511,7 @@ Java_sun_awt_windows_WComponentPeer__1dispose(JNIEnv *env, jobject self) ...@@ -6534,8 +6511,7 @@ Java_sun_awt_windows_WComponentPeer__1dispose(JNIEnv *env, jobject self)
{ {
TRY_NO_HANG; TRY_NO_HANG;
PDATA pData = JNI_GET_PDATA(self); AwtObject::_Dispose(self);
AwtObject::_Dispose(pData);
CATCH_BAD_ALLOC; CATCH_BAD_ALLOC;
} }
......
...@@ -843,7 +843,7 @@ HRESULT __stdcall AwtDragSource::GetData(FORMATETC __RPC_FAR *pFormatEtc, ...@@ -843,7 +843,7 @@ HRESULT __stdcall AwtDragSource::GetData(FORMATETC __RPC_FAR *pFormatEtc,
dropfiles->pt.x = m_dropPoint.x; dropfiles->pt.x = m_dropPoint.x;
dropfiles->pt.y = m_dropPoint.y; dropfiles->pt.y = m_dropPoint.y;
dropfiles->fNC = m_fNC; dropfiles->fNC = m_fNC;
dropfiles->fWide = TRUE; // good guess! dropfiles->fWide = TRUE; // we publish only Unicode
dataout += sizeof(DROPFILES); dataout += sizeof(DROPFILES);
} }
......
...@@ -109,7 +109,7 @@ AwtFrame::AwtFrame() { ...@@ -109,7 +109,7 @@ AwtFrame::AwtFrame() {
m_isMenuDropped = FALSE; m_isMenuDropped = FALSE;
m_isInputMethodWindow = FALSE; m_isInputMethodWindow = FALSE;
m_isUndecorated = FALSE; m_isUndecorated = FALSE;
m_lastProxiedFocusOwner = NULL; m_imeTargetComponent = NULL;
m_actualFocusedWindow = NULL; m_actualFocusedWindow = NULL;
m_iconic = FALSE; m_iconic = FALSE;
m_zoomed = FALSE; m_zoomed = FALSE;
...@@ -311,6 +311,8 @@ LRESULT AwtFrame::ProxyWindowProc(UINT message, WPARAM wParam, LPARAM lParam, Ms ...@@ -311,6 +311,8 @@ LRESULT AwtFrame::ProxyWindowProc(UINT message, WPARAM wParam, LPARAM lParam, Ms
LRESULT retValue = 0L; LRESULT retValue = 0L;
AwtComponent *focusOwner = NULL; AwtComponent *focusOwner = NULL;
AwtComponent *imeTargetComponent = NULL;
// IME and input language related messages need to be sent to a window // IME and input language related messages need to be sent to a window
// which has the Java input focus // which has the Java input focus
switch (message) { switch (message) {
...@@ -323,15 +325,29 @@ LRESULT AwtFrame::ProxyWindowProc(UINT message, WPARAM wParam, LPARAM lParam, Ms ...@@ -323,15 +325,29 @@ LRESULT AwtFrame::ProxyWindowProc(UINT message, WPARAM wParam, LPARAM lParam, Ms
case WM_IME_COMPOSITIONFULL: case WM_IME_COMPOSITIONFULL:
case WM_IME_SELECT: case WM_IME_SELECT:
case WM_IME_CHAR: case WM_IME_CHAR:
case 0x0288: // WM_IME_REQUEST case WM_IME_REQUEST:
case WM_IME_KEYDOWN: case WM_IME_KEYDOWN:
case WM_IME_KEYUP: case WM_IME_KEYUP:
case WM_INPUTLANGCHANGEREQUEST: case WM_INPUTLANGCHANGEREQUEST:
case WM_INPUTLANGCHANGE: case WM_INPUTLANGCHANGE:
if (message == WM_IME_STARTCOMPOSITION) {
SetImeTargetComponent(sm_focusOwner);
}
imeTargetComponent = AwtComponent::GetComponent(GetImeTargetComponent());
if (imeTargetComponent != NULL &&
imeTargetComponent != this) // avoid recursive calls
{
retValue = imeTargetComponent->WindowProc(message, wParam, lParam);
mr = mrConsume;
}
if (message == WM_IME_ENDCOMPOSITION) {
SetImeTargetComponent(NULL);
}
break;
// TODO: when a Choice's list is dropped down and we're scrolling in // TODO: when a Choice's list is dropped down and we're scrolling in
// the list WM_MOUSEWHEEL messages come to the poxy, not to the list. Why? // the list WM_MOUSEWHEEL messages come to the poxy, not to the list. Why?
case WM_MOUSEWHEEL: case WM_MOUSEWHEEL:
focusOwner = AwtComponent::GetComponent(GetLastProxiedFocusOwner()); focusOwner = AwtComponent::GetComponent(sm_focusOwner);
if (focusOwner != NULL && if (focusOwner != NULL &&
focusOwner != this) // avoid recursive calls focusOwner != this) // avoid recursive calls
{ {
...@@ -340,12 +356,16 @@ LRESULT AwtFrame::ProxyWindowProc(UINT message, WPARAM wParam, LPARAM lParam, Ms ...@@ -340,12 +356,16 @@ LRESULT AwtFrame::ProxyWindowProc(UINT message, WPARAM wParam, LPARAM lParam, Ms
} }
break; break;
case WM_SETFOCUS: case WM_SETFOCUS:
if (sm_inSynthesizeFocus) break; // pass it up the WindowProc chain
if (!sm_suppressFocusAndActivation && IsEmbeddedFrame()) { if (!sm_suppressFocusAndActivation && IsEmbeddedFrame()) {
AwtSetActiveWindow(); AwtSetActiveWindow();
} }
mr = mrConsume; mr = mrConsume;
break; break;
case WM_KILLFOCUS: case WM_KILLFOCUS:
if (sm_inSynthesizeFocus) break; // pass it up the WindowProc chain
if (!sm_suppressFocusAndActivation && IsEmbeddedFrame()) { if (!sm_suppressFocusAndActivation && IsEmbeddedFrame()) {
AwtWindow::SynthesizeWmActivate(FALSE, GetHWnd(), NULL); AwtWindow::SynthesizeWmActivate(FALSE, GetHWnd(), NULL);
......
...@@ -150,8 +150,8 @@ public: ...@@ -150,8 +150,8 @@ public:
void CheckRetainActualFocusedWindow(HWND activatedOpositeHWnd); void CheckRetainActualFocusedWindow(HWND activatedOpositeHWnd);
BOOL CheckActivateActualFocusedWindow(HWND deactivatedOpositeHWnd); BOOL CheckActivateActualFocusedWindow(HWND deactivatedOpositeHWnd);
INLINE HWND GetLastProxiedFocusOwner() { return m_lastProxiedFocusOwner; } INLINE HWND GetImeTargetComponent() { return m_imeTargetComponent; }
INLINE void SetLastProxiedFocusOwner(HWND hwnd) { m_lastProxiedFocusOwner = hwnd; } INLINE void SetImeTargetComponent(HWND hwnd) { m_imeTargetComponent = hwnd; }
protected: protected:
/* The frame is undecorated. */ /* The frame is undecorated. */
...@@ -179,9 +179,8 @@ private: ...@@ -179,9 +179,8 @@ private:
/* The frame is an InputMethodWindow */ /* The frame is an InputMethodWindow */
BOOL m_isInputMethodWindow; BOOL m_isInputMethodWindow;
/* Retains the last/current sm_focusOwner proxied. Actually, it should be // retains the target component for the IME messages
* a component of an owned window last/currently active. */ HWND m_imeTargetComponent;
HWND m_lastProxiedFocusOwner;
/* /*
* Fix for 4823903. * Fix for 4823903.
......
...@@ -974,8 +974,7 @@ Java_sun_awt_windows_WMenuItemPeer__1dispose(JNIEnv *env, jobject self) ...@@ -974,8 +974,7 @@ Java_sun_awt_windows_WMenuItemPeer__1dispose(JNIEnv *env, jobject self)
{ {
TRY_NO_HANG; TRY_NO_HANG;
PDATA pData = JNI_GET_PDATA(self); AwtObject::_Dispose(self);
AwtObject::_Dispose(pData);
CATCH_BAD_ALLOC; CATCH_BAD_ALLOC;
} }
......
...@@ -60,11 +60,20 @@ AwtObject::~AwtObject() ...@@ -60,11 +60,20 @@ AwtObject::~AwtObject()
void AwtObject::Dispose() void AwtObject::Dispose()
{ {
theAwtObjectList.Remove(this); AwtToolkit::GetInstance().PostMessage(WM_AWT_DELETEOBJECT, (WPARAM)this, (LPARAM)0);
}
void AwtObject::_Dispose(jobject self)
{
TRY_NO_VERIFY;
CriticalSection::Lock l(AwtToolkit::GetInstance().GetSyncCS());
// value 0 of lParam means that we should not attempt to enter the // value 0 of lParam means that we should not attempt to enter the
// SyncCall critical section, as it was entered someshere earlier // SyncCall critical section, as it was entered someshere earlier
AwtToolkit::GetInstance().PostMessage(WM_AWT_DELETEOBJECT, (WPARAM)this, (LPARAM)0); AwtToolkit::GetInstance().SendMessage(WM_AWT_DISPOSE, (WPARAM)self, (LPARAM)0);
CATCH_BAD_ALLOC;
} }
void AwtObject::_Dispose(PDATA pData) void AwtObject::_Dispose(PDATA pData)
...@@ -73,14 +82,10 @@ void AwtObject::_Dispose(PDATA pData) ...@@ -73,14 +82,10 @@ void AwtObject::_Dispose(PDATA pData)
CriticalSection::Lock l(AwtToolkit::GetInstance().GetSyncCS()); CriticalSection::Lock l(AwtToolkit::GetInstance().GetSyncCS());
if (pData != NULL) { AwtToolkit::GetInstance().SendMessage(WM_AWT_DISPOSEPDATA, (WPARAM)pData, (LPARAM)0);
AwtObject *o = (AwtObject *)pData;
AwtToolkit::GetInstance().SendMessage(WM_AWT_DISPOSE, (WPARAM)o, (LPARAM)0);
}
CATCH_BAD_ALLOC; CATCH_BAD_ALLOC;
} }
/* /*
* Return the peer associated with some target. This information is * Return the peer associated with some target. This information is
* maintained in a hashtable at the java level. * maintained in a hashtable at the java level.
......
...@@ -66,6 +66,10 @@ public: ...@@ -66,6 +66,10 @@ public:
// After this method has been called, this object must not be used in any way. // After this method has been called, this object must not be used in any way.
virtual void Dispose(); virtual void Dispose();
// Static method to be called from JNI methods to dispose AwtObject
// specified by jobject
static void _Dispose(jobject self);
// Static method to be called from JNI methods to dispose AwtObject // Static method to be called from JNI methods to dispose AwtObject
// specified by pData // specified by pData
static void _Dispose(PDATA pData); static void _Dispose(PDATA pData);
......
...@@ -353,8 +353,7 @@ JNIEXPORT void JNICALL Java_sun_awt_windows_WRobotPeer__1dispose( ...@@ -353,8 +353,7 @@ JNIEXPORT void JNICALL Java_sun_awt_windows_WRobotPeer__1dispose(
{ {
TRY_NO_VERIFY; TRY_NO_VERIFY;
PDATA pData = JNI_GET_PDATA(self); AwtObject::_Dispose(self);
AwtObject::_Dispose(pData);
CATCH_BAD_ALLOC; CATCH_BAD_ALLOC;
} }
......
...@@ -191,8 +191,11 @@ void AwtTextComponent::SetCompositionWindow(RECT& rc) ...@@ -191,8 +191,11 @@ void AwtTextComponent::SetCompositionWindow(RECT& rc)
{ {
HIMC hIMC = ImmGetContext(); HIMC hIMC = ImmGetContext();
// rc is not used for text component. // rc is not used for text component.
COMPOSITIONFORM cf = { CFS_POINT, {0,0}, {0,0,0,0} }; COMPOSITIONFORM cf = { CFS_FORCE_POSITION, {0,0}, {0,0,0,0} };
GetCaretPos(&(cf.ptCurrentPos)); GetCaretPos(&(cf.ptCurrentPos));
// the proxy is the native focus owner and it contains the composition window
// let's convert the position to a coordinate space relative to proxy
::MapWindowPoints(GetHWnd(), GetProxyFocusOwner(), (LPPOINT)&cf.ptCurrentPos, 1);
ImmSetCompositionWindow(hIMC, &cf); ImmSetCompositionWindow(hIMC, &cf);
LOGFONT lf; LOGFONT lf;
......
...@@ -740,18 +740,34 @@ LRESULT CALLBACK AwtToolkit::WndProc(HWND hWnd, UINT message, ...@@ -740,18 +740,34 @@ LRESULT CALLBACK AwtToolkit::WndProc(HWND hWnd, UINT message,
canDispose = syncCS.TryEnter(); canDispose = syncCS.TryEnter();
} }
if (canDispose) { if (canDispose) {
AwtObject *o = (AwtObject *)wParam; if(wParam != NULL) {
o->Dispose(); AwtObject *o = (AwtObject *) JNI_GET_PDATA((jobject)wParam);
if (shouldEnterCriticalSection) { if(o != NULL && theAwtObjectList.Remove(o)) {
syncCS.Leave(); o->Dispose();
}
if (shouldEnterCriticalSection) {
syncCS.Leave();
}
} }
} else { } else {
AwtToolkit::GetInstance().PostMessage(WM_AWT_DISPOSE, wParam, lParam); AwtToolkit::GetInstance().PostMessage(WM_AWT_DISPOSE, wParam, lParam);
} }
return 0; return 0;
} }
case WM_AWT_DISPOSEPDATA: {
/*
* NOTE: synchronization routine (like in WM_AWT_DISPOSE) was omitted because
* this handler is called ONLY while disposing Cursor and Font objects where
* synchronization takes place.
*/
AwtObject *o = (AwtObject *) wParam;
if(o != NULL && theAwtObjectList.Remove(o)) {
o->Dispose();
}
return 0;
}
case WM_AWT_DELETEOBJECT: { case WM_AWT_DELETEOBJECT: {
AwtObject *p = (AwtObject *)wParam; AwtObject *p = (AwtObject *) wParam;
if (p->CanBeDeleted()) { if (p->CanBeDeleted()) {
// all the messages for this component are processed, so // all the messages for this component are processed, so
// it can be deleted // it can be deleted
......
...@@ -926,8 +926,7 @@ Java_sun_awt_windows_WTrayIconPeer__1dispose(JNIEnv *env, jobject self) ...@@ -926,8 +926,7 @@ Java_sun_awt_windows_WTrayIconPeer__1dispose(JNIEnv *env, jobject self)
{ {
TRY; TRY;
PDATA pData = JNI_GET_PDATA(self); AwtObject::_Dispose(self);
AwtObject::_Dispose(pData);
CATCH_BAD_ALLOC; CATCH_BAD_ALLOC;
} }
......
...@@ -219,6 +219,7 @@ enum { ...@@ -219,6 +219,7 @@ enum {
WM_AWT_ENDCOMPOSITION, WM_AWT_ENDCOMPOSITION,
WM_AWT_DISPOSE, WM_AWT_DISPOSE,
WM_AWT_DISPOSEPDATA,
WM_AWT_DELETEOBJECT, WM_AWT_DELETEOBJECT,
WM_AWT_SETCONVERSIONSTATUS, WM_AWT_SETCONVERSIONSTATUS,
WM_AWT_GETCONVERSIONSTATUS, WM_AWT_GETCONVERSIONSTATUS,
......
/*
* 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.
*
* 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.
*/
/*
@test
@bug 7036669
@summary Test Component.revalidate() method
@author anthony.petrov@oracle.com: area=awt.component
@run main Revalidate
*/
import java.awt.*;
public class Revalidate {
private static Frame frame = new Frame();
private static Panel panel = new Panel() {
@Override
public boolean isValidateRoot() {
return true;
}
};
private static Button button = new Button("Test");
private static void sleep() {
try { Thread.sleep(500); } catch (Exception e) {}
}
private static void printState(String str) {
System.out.println(str + " isValid state: ");
System.out.println(" frame: " + frame.isValid());
System.out.println(" panel: " + panel.isValid());
System.out.println(" button: " + button.isValid());
}
private static void fail(String msg) {
frame.dispose();
throw new RuntimeException(msg);
}
private static void check(String n, Component c, boolean v) {
if (c.isValid() != v) {
fail(n + ".isValid() = " + c.isValid() + "; expected: " + v);
}
}
private static void check(String str, boolean f, boolean p, boolean b) {
printState(str);
check("frame", frame, f);
check("panel", panel, p);
check("button", button, b);
}
public static void main(String[] args) {
// setup
frame.add(panel);
panel.add(button);
frame.setBounds(200, 200, 300, 200);
frame.setVisible(true);
sleep();
check("Upon showing", true, true, true);
button.setBounds(1, 1, 30, 30);
sleep();
check("button.setBounds():", true, false, false);
button.revalidate();
sleep();
check("button.revalidate():", true, true, true);
button.setBounds(1, 1, 30, 30);
sleep();
check("button.setBounds():", true, false, false);
panel.revalidate();
sleep();
// because the panel's validate root is actually OK
check("panel.revalidate():", true, false, false);
button.revalidate();
sleep();
check("button.revalidate():", true, true, true);
panel.setBounds(2, 2, 125, 130);
sleep();
check("panel.setBounds():", false, false, true);
button.revalidate();
sleep();
check("button.revalidate():", false, true, true);
panel.setBounds(3, 3, 152, 121);
sleep();
check("panel.setBounds():", false, false, true);
panel.revalidate();
sleep();
check("panel.revalidate():", true, true, true);
// cleanup
frame.dispose();
}
}
/*
* Copyright (c) 2010, 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.
*
* 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.
*/
/*
@test
@bug 5089429 6982632
@summary Checks that we don't crash if rendering operations and state
changes are performed on a graphics context from different threads.
@author Dmitri.Trembovetski@sun.com area=Graphics
@run main MTGraphicsAccessTest
*/
import java.awt.*;
import java.awt.image.*;
import java.awt.geom.*;
public class MTGraphicsAccessTest {
// in seconds
static final long STANDALONE_RUN_TIME = 20;
static final long JTREG_RUN_TIME = 7;
static boolean standaloneMode;
static boolean allowExceptions = true;
static long testRunTime;
volatile boolean done;
volatile int stillRunning;
volatile int numexceptions;
Graphics2D sharedGraphics;
BufferedImage sharedBI =
new BufferedImage(50, 50, BufferedImage.TYPE_INT_RGB);
static final Paint colors[] = {
Color.red,
new Color(0x7f, 0xff, 0x00, 0x7f),
new GradientPaint(0, 0, Color.red,
50, 50, new Color(0x7f, 0xff, 0x00, 0x7f)),
};
static final Font fonts[] = {
new Font("Dialog", Font.PLAIN, 12),
new Font("Dialog", Font.BOLD, 16),
new Font("Dialog", Font.ITALIC, 18),
};
static final AlphaComposite comps[] = {
AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1.0f),
AlphaComposite.Src,
AlphaComposite.Xor,
AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f),
null,
};
static final Stroke strokes[] = {
new BasicStroke(),
new BasicStroke(0.0f),
new BasicStroke(2.0f),
new BasicStroke(2.0f, BasicStroke.CAP_ROUND,
BasicStroke.JOIN_BEVEL),
new BasicStroke(5.0f, BasicStroke.CAP_SQUARE,
BasicStroke.JOIN_ROUND),
new BasicStroke(0.0f, BasicStroke.CAP_ROUND,
BasicStroke.JOIN_ROUND, 0,
new float[]{0,6,0,6}, 0),
};
static final AffineTransform transforms[] = {
new AffineTransform(),
AffineTransform.getRotateInstance(10.0),
AffineTransform.getShearInstance(10.0, 4.0),
AffineTransform.getScaleInstance(1.1, 1.2),
AffineTransform.getScaleInstance(3.0, 2.0),
};
public MTGraphicsAccessTest() {
BufferedImage bi =
new BufferedImage(50, 50, BufferedImage.TYPE_INT_RGB);
sharedGraphics = (Graphics2D)bi.getGraphics();
done = false;
numexceptions = 0;
for (int i = 0; i < (standaloneMode ? stateChangers.length : 3); i++) {
(new TesterThread(stateChangers[i])).start();
}
for (int i = 0; i < (standaloneMode ? renderTests.length : 5); i++) {
(new TesterThread(renderTests[i])).start();
}
mysleep(testRunTime);
done = true;
while (stillRunning > 0) { mysleep(500); }
if (numexceptions == 0) {
System.err.println("Test passed");
} else if (!allowExceptions) {
throw new RuntimeException("Test failed with "+
numexceptions+" exceptions");
} else {
System.err.println("Test finished with "+
numexceptions+" exceptions");
}
}
private void mysleep(long time) {
try {
// add +/-5ms variance to increase randomness
Thread.sleep(time + (long)(5 - Math.random()*10));
} catch (InterruptedException e) {};
}
public static void usage(String message) {
if (message != null) {
System.err.println(message);
}
System.err.println("Usage: MTGraphicsAccessTest [-full] "+
"[-time N/forever] [-help]");
System.err.println(" -full: run full suite of tests "+
"(default: limited number of tests is run)");
System.err.println(" -time N: test duration in seconds/forever"+
" (default: "+JTREG_RUN_TIME+"s for the short suite, "+
STANDALONE_RUN_TIME+"s for the full suite)");
System.err.println(" -help: print this help page");
System.exit(1);
}
public static void main(String[] args) {
boolean testRunSet = false;
for (int i = 0; i < args.length; i++) {
if ("-full".equals(args[i])) {
standaloneMode = true;
System.err.println("Running complete list of tests");
} else if ("-noexc".equals(args[i])) {
allowExceptions = false;
} else if ("-time".equals(args[i])) {
try {
String time = args[++i];
if ("forever".equals(time)) {
testRunTime = (Long.MAX_VALUE - 20)/1000;
} else {
testRunTime = 1000*Integer.parseInt(time);
}
testRunSet = true;
} catch (NumberFormatException e) {
usage("Can't parse number of seconds: " + args[i]);
} catch (ArrayIndexOutOfBoundsException e1) {
usage("Missing the 'seconds' argument for -time parameter");
}
} else if ("-help".equals(args[i])) {
usage(null);
} else {
usage("Unknown argument:" + args[i]);
}
}
if (!testRunSet) {
testRunTime = 1000 *
(standaloneMode ? STANDALONE_RUN_TIME : JTREG_RUN_TIME);
}
System.err.println("Approximate test run time: "+
testRunTime/1000+" seconds");
new MTGraphicsAccessTest();
}
class TesterThread extends Thread {
Runnable testRunnable;
public TesterThread(Runnable testRunnable) {
stillRunning++;
this.testRunnable = testRunnable;
}
public void run() {
try {
while (!done) {
try {
testRunnable.run();
yield();
} catch (Throwable t) {
numexceptions++;
t.printStackTrace();
}
}
} finally {
stillRunning--;
}
}
}
final Runnable stateChangers[] = {
new Runnable() {
public void run() {
sharedGraphics.setClip(10, 10, 30, 30);
mysleep(10);
}
},
new Runnable() {
public void run() {
sharedGraphics.setClip(10, 10, 30, 30);
mysleep(10);
}
},
new Runnable() {
int c = 0;
public void run() {
sharedGraphics.setPaint(colors[c++ % colors.length]);
mysleep(10);
}
},
new Runnable() {
boolean AA = false;
public void run() {
if (AA) {
sharedGraphics.setRenderingHint(
RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
} else {
sharedGraphics.setRenderingHint(
RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_OFF);
}
AA = !AA;
mysleep(10);
}
},
new Runnable() {
int t = 0;
public void run() {
sharedGraphics.setTransform(
transforms[t++ % transforms.length]);
mysleep(10);
}
},
new Runnable() {
int c = 0;
public void run() {
AlphaComposite comp = comps[c++ % comps.length];
if (comp == null) {
sharedGraphics.setXORMode(Color.green);
} else {
sharedGraphics.setComposite(comp);
}
mysleep(10);
}
},
new Runnable() {
int s = 0;
public void run() {
sharedGraphics.setStroke(strokes[s++ % strokes.length]);
mysleep(10);
}
},
new Runnable() {
int f = 0;
public void run() {
sharedGraphics.setFont(fonts[f++ % fonts.length]);
mysleep(10);
}
},
};
final Runnable renderTests[] = {
new Runnable() {
public void run() {
sharedGraphics.drawLine(10, 10, 30, 30);
}
},
new Runnable() {
public void run() {
sharedGraphics.drawLine(10, 10, 30, 30);
}
},
new Runnable() {
public void run() {
sharedGraphics.drawRect(10, 10, 30, 30);
}
},
new Runnable() {
public void run() {
sharedGraphics.fillRect(10, 10, 30, 30);
}
},
new Runnable() {
public void run() {
sharedGraphics.drawString("Stuff", 10, 10);
}
},
new Runnable() {
public void run() {
sharedGraphics.draw3DRect(10, 10, 30, 30, true);
}
},
new Runnable() {
public void run() {
sharedGraphics.drawImage(sharedBI, 10, 10, null);
}
},
new Runnable() {
public void run() {
sharedGraphics.fill3DRect(10, 10, 30, 30, false);
}
},
// REMIND: copyArea doesn't work when transform is set..
// new Runnable() {
// public void run() {
// sharedGraphics.copyArea(10, 10, 30, 30, 20, 20);
// }
// },
new Runnable() {
public void run() {
sharedGraphics.drawRoundRect(10, 10, 30, 30, 20, 20);
}
},
new Runnable() {
public void run() {
sharedGraphics.fillRoundRect(10, 10, 30, 30, 20, 20);
}
},
new Runnable() {
public void run() {
sharedGraphics.drawArc(10, 10, 30, 30, 0, 90);
}
},
new Runnable() {
public void run() {
sharedGraphics.fillArc(10, 10, 30, 30, 0, 90);
}
},
new Runnable() {
public void run() {
sharedGraphics.drawOval(10, 10, 30, 30);
}
},
new Runnable() {
public void run() {
sharedGraphics.fillOval(10, 10, 30, 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.
*
* 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.
*/
/*
@test
@bug 7036733
@summary Regression : NullPointerException when scrolling horizontally on AWT List
@author Andrei Dmitriev area=awt-list
@library ../../regtesthelpers
@build Util
@run main ScrollOut
*/
import java.awt.*;
import java.awt.event.*;
import sun.awt.SunToolkit;
import test.java.awt.regtesthelpers.Util;
public class ScrollOut
{
public static final void main(String args[])
{
final Frame frame = new Frame();
final List list = new List();
Robot robot = null;
for (int i = 0; i < 5; i++){
list.add("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
}
frame.add(list);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
((SunToolkit)Toolkit.getDefaultToolkit()).realSync();
try{
robot = new Robot();
}catch(AWTException e){
throw new RuntimeException(e);
}
//Drag from center to the outside on left
Point from = new Point(list.getLocationOnScreen().x + list.getWidth()/2,
list.getLocationOnScreen().y + list.getHeight()/2);
Point to = new Point(list.getLocationOnScreen().x - 30,
from.y);
((SunToolkit)Toolkit.getDefaultToolkit()).realSync();
Util.drag(robot, from, to, InputEvent.BUTTON1_MASK);
((SunToolkit)Toolkit.getDefaultToolkit()).realSync();
//Drag from center to the outside on up
to = new Point(from.x,
list.getLocationOnScreen().y - 50);
((SunToolkit)Toolkit.getDefaultToolkit()).realSync();
Util.drag(robot, from, to, InputEvent.BUTTON1_MASK);
}//End init()
}
/* /*
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2007, 2011 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -50,6 +50,11 @@ import test.java.awt.regtesthelpers.Sysout; ...@@ -50,6 +50,11 @@ import test.java.awt.regtesthelpers.Sysout;
public class InfiniteRecursion { public class InfiniteRecursion {
final static Robot robot = Util.createRobot(); final static Robot robot = Util.createRobot();
final static int MOVE_COUNT = 5; final static int MOVE_COUNT = 5;
//*2 for both rotation directions,
//*2 as Java sends the wheel event to every for nested component in hierarchy under cursor
final static int EXPECTED_COUNT = MOVE_COUNT * 2 * 2;
static int actualEvents = 0; static int actualEvents = 0;
public static void main(String []s) public static void main(String []s)
...@@ -96,8 +101,10 @@ public class InfiniteRecursion { ...@@ -96,8 +101,10 @@ public class InfiniteRecursion {
Util.waitForIdle(robot); Util.waitForIdle(robot);
if (actualEvents != MOVE_COUNT * 2) { //Not fair to check for multiplier 4 as it's not specified actual number of WheelEvents
AbstractTest.fail("Expected events count: "+ MOVE_COUNT+" Actual events count: "+ actualEvents); //result in a single wheel rotation.
if (actualEvents != EXPECTED_COUNT) {
AbstractTest.fail("Expected events count: "+ EXPECTED_COUNT+" Actual events count: "+ actualEvents);
} }
} }
} }
/* /*
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2007, 2011 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -50,6 +50,9 @@ import test.java.awt.regtesthelpers.Sysout; ...@@ -50,6 +50,9 @@ import test.java.awt.regtesthelpers.Sysout;
public class InfiniteRecursion_1 { public class InfiniteRecursion_1 {
final static Robot robot = Util.createRobot(); final static Robot robot = Util.createRobot();
final static int MOVE_COUNT = 5; final static int MOVE_COUNT = 5;
//*2 for both rotation directions,
//*2 as Java sends the wheel event to every for nested component in hierarchy under cursor
final static int EXPECTED_COUNT = MOVE_COUNT * 2 * 2;
static int actualEvents = 0; static int actualEvents = 0;
public static void main(String []s) public static void main(String []s)
...@@ -95,8 +98,10 @@ public class InfiniteRecursion_1 { ...@@ -95,8 +98,10 @@ public class InfiniteRecursion_1 {
} }
Util.waitForIdle(robot); Util.waitForIdle(robot);
if (actualEvents != MOVE_COUNT * 2) { //Not fair to check for multiplier 4 as it's not specified actual number of WheelEvents
AbstractTest.fail("Expected events count: "+ MOVE_COUNT+" Actual events count: "+ actualEvents); //result in a single wheel rotation.
if (actualEvents != EXPECTED_COUNT) {
AbstractTest.fail("Expected events count: "+ EXPECTED_COUNT+" Actual events count: "+ actualEvents);
} }
} }
} }
/* /*
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2007, 2011 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -56,6 +56,9 @@ import java.applet.Applet; ...@@ -56,6 +56,9 @@ import java.applet.Applet;
public class InfiniteRecursion_2 extends Applet { public class InfiniteRecursion_2 extends Applet {
final static Robot robot = Util.createRobot(); final static Robot robot = Util.createRobot();
final static int MOVE_COUNT = 5; final static int MOVE_COUNT = 5;
//*2 for both rotation directions,
//*2 as Java sends the wheel event to every for nested component in hierarchy under cursor
final static int EXPECTED_COUNT = MOVE_COUNT * 2 * 2;
static int actualEvents = 0; static int actualEvents = 0;
public void init() public void init()
...@@ -107,8 +110,10 @@ public class InfiniteRecursion_2 extends Applet { ...@@ -107,8 +110,10 @@ public class InfiniteRecursion_2 extends Applet {
} }
Util.waitForIdle(robot); Util.waitForIdle(robot);
if (actualEvents != MOVE_COUNT * 2) { //Not fair to check for multiplier 4 as it's not specified actual number of WheelEvents
AbstractTest.fail("Expected events count: "+ MOVE_COUNT+" Actual events count: "+ actualEvents); //result in a single wheel rotation.
if (actualEvents != EXPECTED_COUNT) {
AbstractTest.fail("Expected events count: "+ EXPECTED_COUNT+" Actual events count: "+ actualEvents);
} }
}// start() }// start()
} }
/* /*
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2007, 2011 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -50,6 +50,9 @@ import java.applet.Applet; ...@@ -50,6 +50,9 @@ import java.applet.Applet;
public class InfiniteRecursion_3 extends Applet { public class InfiniteRecursion_3 extends Applet {
final static Robot robot = Util.createRobot(); final static Robot robot = Util.createRobot();
final static int MOVE_COUNT = 5; final static int MOVE_COUNT = 5;
//*2 for both rotation directions,
//*2 as Java sends the wheel event to every for nested component in hierarchy under cursor
final static int EXPECTED_COUNT = MOVE_COUNT * 2 * 2;
static int actualEvents = 0; static int actualEvents = 0;
public void init() public void init()
...@@ -91,8 +94,10 @@ public class InfiniteRecursion_3 extends Applet { ...@@ -91,8 +94,10 @@ public class InfiniteRecursion_3 extends Applet {
} }
Util.waitForIdle(robot); Util.waitForIdle(robot);
if (actualEvents != MOVE_COUNT * 2) { //Not fair to check for multiplier 4 as it's not specified actual number of WheelEvents
AbstractTest.fail("Expected events count: "+ MOVE_COUNT+" Actual events count: "+ actualEvents); //result in a single wheel rotation.
if (actualEvents != EXPECTED_COUNT) {
AbstractTest.fail("Expected events count: "+ EXPECTED_COUNT+" Actual events count: "+ actualEvents);
} }
}// start() }// start()
} }
/* /*
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2007, 2011 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -47,6 +47,8 @@ import test.java.awt.regtesthelpers.Sysout; ...@@ -47,6 +47,8 @@ import test.java.awt.regtesthelpers.Sysout;
public class InfiniteRecursion_4 { public class InfiniteRecursion_4 {
final static Robot robot = Util.createRobot(); final static Robot robot = Util.createRobot();
final static int MOVE_COUNT = 5; final static int MOVE_COUNT = 5;
//*2 for both rotation directions over a single frame without any siblings
final static int EXPECTED_COUNT = MOVE_COUNT * 2;
static int actualEvents = 0; static int actualEvents = 0;
public static void main(String []s) public static void main(String []s)
...@@ -80,8 +82,10 @@ public class InfiniteRecursion_4 { ...@@ -80,8 +82,10 @@ public class InfiniteRecursion_4 {
} }
Util.waitForIdle(robot); Util.waitForIdle(robot);
if (actualEvents != MOVE_COUNT * 2) { //Not fair to check for multiplier 4 as it's not specified actual number of WheelEvents
AbstractTest.fail("Expected events count: "+ MOVE_COUNT+" Actual events count: "+ actualEvents); //result in a single wheel rotation.
if (actualEvents != EXPECTED_COUNT) {
AbstractTest.fail("Expected events count: "+ EXPECTED_COUNT+" Actual events count: "+ actualEvents);
} }
} }
} }
/*
* 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.
*
* 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.
*/
/*
@test
@bug 6799551
@library ../../regtesthelpers
@build Util Sysout
@summary Extended key codes for small letters undefined
@author Andrei Dmitriev: area=awt.keyboard
@run main EqualKeyCode
*/
import sun.awt.*;
import java.awt.*;
import test.java.awt.regtesthelpers.Util;
import test.java.awt.regtesthelpers.Sysout;
public class EqualKeyCode {
final static String LETTERS = "abcdefghijklmnopqrstuvwxyz";
public static void main(String []s) {
for (int i = 0; i < LETTERS.length(); i++){
char cSmall = LETTERS.charAt(i);
char cLarge = Character.toUpperCase(cSmall);
int iSmall = ExtendedKeyCodes.getExtendedKeyCodeForChar(cSmall);
int iLarge = ExtendedKeyCodes.getExtendedKeyCodeForChar(cLarge);
System.out.print(" " + cSmall + ":" + iSmall + " ---- ");
System.out.println(" " + cLarge + " : " + iLarge);
if (ExtendedKeyCodes.getExtendedKeyCodeForChar(cSmall) !=
ExtendedKeyCodes.getExtendedKeyCodeForChar(cLarge))
{
throw new RuntimeException("ExtendedKeyCode doesn't exist or doesn't match between capital and small letters.");
}
}
}
}
/*
* 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.
*
* 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.
*/
/* @test
@bug 7036025
@summary java.security.AccessControlException when creating JFileChooser in signed applet
@author Pavel Porvatov
@run main/othervm/policy=security.policy bug7036025
*/
import javax.swing.*;
import java.io.File;
public class bug7036025 {
public static final String DIR = "c:/temp";
public static void main(String[] args) throws Exception {
String systemLookAndFeelClassName = UIManager.getSystemLookAndFeelClassName();
if (!systemLookAndFeelClassName.toLowerCase().contains("windows")) {
System.out.println("The test is only for Windows OS.");
return;
}
File file = new File(DIR);
if (!file.exists()) {
if (!file.mkdir()) {
throw new RuntimeException("Cannot create " + DIR);
}
file.deleteOnExit();
}
UIManager.setLookAndFeel(systemLookAndFeelClassName);
new JFileChooser(file);
System.out.println("Test passed for LookAndFeel " + UIManager.getLookAndFeel().getName());
}
}
grant {
permission java.io.FilePermission "C:\\temp\\*", "read";
permission java.io.FilePermission "C:\\temp", "read,write,delete";
permission java.util.PropertyPermission "*", "read";
};
...@@ -24,13 +24,13 @@ ...@@ -24,13 +24,13 @@
/* @test /* @test
@bug 6596966 @bug 6596966
@summary Some JFileChooser mnemonics do not work with sticky keys @summary Some JFileChooser mnemonics do not work with sticky keys
* @library ../../regtesthelpers
* @build Util
@run main bug6596966 @run main bug6596966
@author Pavel Porvatov @author Pavel Porvatov
*/ */
import sun.awt.SunToolkit;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
...@@ -44,6 +44,7 @@ public class bug6596966 { ...@@ -44,6 +44,7 @@ public class bug6596966 {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
Robot robot = new Robot(); Robot robot = new Robot();
SunToolkit toolkit = (SunToolkit) SunToolkit.getDefaultToolkit();
SwingUtilities.invokeAndWait(new Runnable() { SwingUtilities.invokeAndWait(new Runnable() {
public void run() { public void run() {
...@@ -68,17 +69,17 @@ public class bug6596966 { ...@@ -68,17 +69,17 @@ public class bug6596966 {
} }
}); });
Util.blockTillDisplayed(frame); toolkit.realSync();
robot.keyPress(KeyEvent.VK_ALT); robot.keyPress(KeyEvent.VK_ALT);
robot.keyPress(KeyEvent.VK_L); robot.keyPress(KeyEvent.VK_L);
robot.waitForIdle(); toolkit.realSync();
Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(new KeyEvent(label, KeyEvent.KEY_RELEASED, toolkit.getSystemEventQueue().postEvent(new KeyEvent(label, KeyEvent.KEY_RELEASED,
EventQueue.getMostRecentEventTime(), 0, KeyEvent.VK_L, 'L')); EventQueue.getMostRecentEventTime(), 0, KeyEvent.VK_L, 'L'));
robot.waitForIdle(); toolkit.realSync();
try { try {
SwingUtilities.invokeAndWait(new Runnable() { SwingUtilities.invokeAndWait(new Runnable() {
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
/** /**
* @test * @test
* @bug 7027667, 7023591 * @bug 7027667 7023591 7037091
* *
* @summary Verifies that aa clipped rectangles are drawn, not filled. * @summary Verifies that aa clipped rectangles are drawn, not filled.
* *
......
/*
* 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.
*
* 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.
*/
/**
* @test
* @bug 7036754
*
* @summary Verifies that there are no non-finite numbers when stroking
* certain quadratic curves.
*
* @author Jim Graham
* @run main Test7036754
*/
import java.awt.*;
import java.awt.geom.*;
public class Test7036754 {
public static void main(String argv[]) {
Shape s = new QuadCurve2D.Float(839.24677f, 508.97888f,
839.2953f, 508.97122f,
839.3438f, 508.96353f);
s = new BasicStroke(10f).createStrokedShape(s);
float nsegs[] = {2, 2, 4, 6, 0};
float coords[] = new float[6];
PathIterator pi = s.getPathIterator(null);
while (!pi.isDone()) {
int type = pi.currentSegment(coords);
for (int i = 0; i < nsegs[type]; i++) {
float c = coords[i];
if (Float.isNaN(c) || Float.isInfinite(c)) {
throw new RuntimeException("bad value in stroke");
}
}
pi.next();
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册