Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
7f94d1c9
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
7f94d1c9
编写于
6月 28, 2013
作者:
L
lana
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
52cb23bc
d222f07f
变更
54
显示空白变更内容
内联
并排
Showing
54 changed file
with
1431 addition
and
143 deletion
+1431
-143
.hgtags
.hgtags
+2
-0
makefiles/CompileNativeLibraries.gmk
makefiles/CompileNativeLibraries.gmk
+2
-2
makefiles/CopyFiles.gmk
makefiles/CopyFiles.gmk
+1
-18
src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
+0
-2
src/macosx/native/com/apple/laf/AquaFileView.m
src/macosx/native/com/apple/laf/AquaFileView.m
+3
-3
src/macosx/native/sun/awt/AWTWindow.m
src/macosx/native/sun/awt/AWTWindow.m
+4
-2
src/share/classes/java/awt/DefaultKeyboardFocusManager.java
src/share/classes/java/awt/DefaultKeyboardFocusManager.java
+11
-4
src/share/classes/java/awt/color/ICC_Profile.java
src/share/classes/java/awt/color/ICC_Profile.java
+3
-0
src/share/classes/java/nio/CharBufferSpliterator.java
src/share/classes/java/nio/CharBufferSpliterator.java
+1
-1
src/share/classes/javax/swing/JFileChooser.java
src/share/classes/javax/swing/JFileChooser.java
+18
-2
src/share/classes/javax/swing/JTree.java
src/share/classes/javax/swing/JTree.java
+3
-3
src/share/classes/javax/swing/event/TreeModelEvent.java
src/share/classes/javax/swing/event/TreeModelEvent.java
+2
-2
src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java
...e/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java
+3
-0
src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java
src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java
+4
-4
src/share/classes/javax/swing/text/View.java
src/share/classes/javax/swing/text/View.java
+1
-1
src/share/classes/javax/swing/tree/FixedHeightLayoutCache.java
...hare/classes/javax/swing/tree/FixedHeightLayoutCache.java
+6
-5
src/share/classes/javax/swing/tree/VariableHeightLayoutCache.java
...e/classes/javax/swing/tree/VariableHeightLayoutCache.java
+6
-5
src/share/classes/sun/java2d/cmm/ProfileDataVerifier.java
src/share/classes/sun/java2d/cmm/ProfileDataVerifier.java
+114
-0
src/share/classes/sun/swing/SwingUtilities2.java
src/share/classes/sun/swing/SwingUtilities2.java
+21
-2
src/share/native/sun/font/layout/KernTable.cpp
src/share/native/sun/font/layout/KernTable.cpp
+24
-20
src/share/native/sun/font/layout/KernTable.h
src/share/native/sun/font/layout/KernTable.h
+0
-1
src/share/native/sun/font/layout/LayoutEngine.cpp
src/share/native/sun/font/layout/LayoutEngine.cpp
+0
-1
src/share/native/sun/management/DiagnosticCommandImpl.c
src/share/native/sun/management/DiagnosticCommandImpl.c
+1
-1
src/solaris/classes/sun/awt/X11/XKeyboardFocusManagerPeer.java
...olaris/classes/sun/awt/X11/XKeyboardFocusManagerPeer.java
+6
-4
src/solaris/classes/sun/print/UnixPrintServiceLookup.java
src/solaris/classes/sun/print/UnixPrintServiceLookup.java
+24
-1
src/solaris/native/sun/awt/awt_GraphicsEnv.c
src/solaris/native/sun/awt/awt_GraphicsEnv.c
+12
-6
src/solaris/native/sun/awt/awt_InputMethod.c
src/solaris/native/sun/awt/awt_InputMethod.c
+3
-3
src/solaris/native/sun/xawt/XToolkit.c
src/solaris/native/sun/xawt/XToolkit.c
+3
-6
src/windows/classes/sun/awt/windows/WPrinterJob.java
src/windows/classes/sun/awt/windows/WPrinterJob.java
+15
-3
src/windows/classes/sun/print/Win32PrintService.java
src/windows/classes/sun/print/Win32PrintService.java
+7
-4
src/windows/native/sun/windows/WPrinterJob.cpp
src/windows/native/sun/windows/WPrinterJob.cpp
+6
-1
src/windows/native/sun/windows/awt_Frame.cpp
src/windows/native/sun/windows/awt_Frame.cpp
+4
-2
src/windows/native/sun/windows/awt_PrintControl.cpp
src/windows/native/sun/windows/awt_PrintControl.cpp
+25
-15
test/com/sun/java/swing/plaf/gtk/4928019/bug4928019.java
test/com/sun/java/swing/plaf/gtk/4928019/bug4928019.java
+244
-0
test/java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.html
...t/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.html
+2
-4
test/java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.java
...t/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.java
+1
-3
test/java/awt/Focus/TypeAhead/TestFocusFreeze.java
test/java/awt/Focus/TypeAhead/TestFocusFreeze.java
+1
-0
test/java/awt/GraphicsDevice/CheckDisplayModes.java
test/java/awt/GraphicsDevice/CheckDisplayModes.java
+4
-0
test/java/awt/Mixing/MixingInHwPanel.java
test/java/awt/Mixing/MixingInHwPanel.java
+3
-3
test/java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java
...a/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java
+166
-0
test/java/awt/event/KeyEvent/KeyReleasedInAppletTest/KeyReleasedInAppletTest.java
...vent/KeyReleasedInAppletTest/KeyReleasedInAppletTest.java
+0
-1
test/java/awt/font/TextLayout/KerningLeak.java
test/java/awt/font/TextLayout/KerningLeak.java
+66
-0
test/java/lang/management/MXBean/MXBeanBehavior.java
test/java/lang/management/MXBean/MXBeanBehavior.java
+1
-1
test/java/lang/management/ManagementFactory/MBeanServerMXBeanUnsupportedTest.java
...t/ManagementFactory/MBeanServerMXBeanUnsupportedTest.java
+1
-1
test/javax/print/PrintServiceLookup/GetPrintServices.java
test/javax/print/PrintServiceLookup/GetPrintServices.java
+58
-0
test/javax/swing/JFileChooser/8013442/Test8013442.java
test/javax/swing/JFileChooser/8013442/Test8013442.java
+122
-0
test/javax/swing/JMenu/4692443/bug4692443.java
test/javax/swing/JMenu/4692443/bug4692443.java
+132
-0
test/javax/swing/JTree/8013571/Test8013571.java
test/javax/swing/JTree/8013571/Test8013571.java
+64
-0
test/javax/swing/plaf/basic/BasicComboBoxEditor/Test8015336.java
...vax/swing/plaf/basic/BasicComboBoxEditor/Test8015336.java
+41
-0
test/javax/swing/text/View/8015853/bug8015853.java
test/javax/swing/text/View/8015853/bug8015853.java
+82
-0
test/javax/swing/text/View/8015853/bug8015853.txt
test/javax/swing/text/View/8015853/bug8015853.txt
+67
-0
test/sun/java2d/cmm/ColorConvertOp/ColConvCCMTest.java
test/sun/java2d/cmm/ColorConvertOp/ColConvCCMTest.java
+3
-3
test/sun/java2d/cmm/ColorConvertOp/ColConvDCMTest.java
test/sun/java2d/cmm/ColorConvertOp/ColConvDCMTest.java
+8
-3
test/sun/java2d/cmm/ColorConvertOp/ColConvTest.java
test/sun/java2d/cmm/ColorConvertOp/ColConvTest.java
+30
-0
未找到文件。
.hgtags
浏览文件 @
7f94d1c9
...
@@ -216,3 +216,5 @@ c63eda8f63008a4398d2c22ac8d72f7fef6f9238 jdk8-b90
...
@@ -216,3 +216,5 @@ c63eda8f63008a4398d2c22ac8d72f7fef6f9238 jdk8-b90
a2a2a91075ad85becbe10a39d7fd04ef9bea8df5 jdk8-b92
a2a2a91075ad85becbe10a39d7fd04ef9bea8df5 jdk8-b92
691d6c6cd332d98b0f0221445a73906776f31f72 jdk8-b93
691d6c6cd332d98b0f0221445a73906776f31f72 jdk8-b93
51479fa56b7c4363c6d87c2e8b898d8185cf4b22 jdk8-b94
51479fa56b7c4363c6d87c2e8b898d8185cf4b22 jdk8-b94
42aa9f1828852bb8b77e98ec695211493ae0759d jdk8-b95
4a5d3cf2b3af1660db0237e8da324c140e534fa4 jdk8-b96
makefiles/CompileNativeLibraries.gmk
浏览文件 @
7f94d1c9
...
@@ -2916,7 +2916,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDALSA,\
...
@@ -2916,7 +2916,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDALSA,\
PLATFORM_API_LinuxOS_ALSA_Ports.c,\
PLATFORM_API_LinuxOS_ALSA_Ports.c,\
LANG:=C,\
LANG:=C,\
OPTIMIZATION:=LOW, \
OPTIMIZATION:=LOW, \
CFLAGS:=$(CFLAGS_JDKLIB) \
CFLAGS:=$(CFLAGS_JDKLIB)
$(ALSA_CFLAGS)
\
$(LIBJSOUND_CFLAGS) \
$(LIBJSOUND_CFLAGS) \
-DUSE_DAUDIO=TRUE \
-DUSE_DAUDIO=TRUE \
-DUSE_PORTS=TRUE \
-DUSE_PORTS=TRUE \
...
@@ -2925,7 +2925,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDALSA,\
...
@@ -2925,7 +2925,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDALSA,\
MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjsoundalsa/mapfile-vers, \
MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjsoundalsa/mapfile-vers, \
LDFLAGS:=$(LDFLAGS_JDKLIB)\
LDFLAGS:=$(LDFLAGS_JDKLIB)\
$(call SET_SHARED_LIBRARY_ORIGIN),\
$(call SET_SHARED_LIBRARY_ORIGIN),\
LDFLAGS_SUFFIX:=
-lasound
-ljava -ljvm,\
LDFLAGS_SUFFIX:=
$(ALSA_LIBS)
-ljava -ljvm,\
OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjsoundalsa,\
OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libjsoundalsa,\
DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
DEBUG_SYMBOLS:=$(DEBUG_ALL_BINARIES)))
...
...
makefiles/CopyFiles.gmk
浏览文件 @
7f94d1c9
...
@@ -538,21 +538,4 @@ COPY_FILES += $(JDK_OUTPUTDIR)/lib/sound.properties
...
@@ -538,21 +538,4 @@ COPY_FILES += $(JDK_OUTPUTDIR)/lib/sound.properties
##########################################################################################
##########################################################################################
ifndef OPENJDK
-include $(CUSTOM_MAKE_DIR)/CopyFiles.gmk
ifeq ($(ENABLE_JFR), true)
JFR_CONFIGURATION_DIR_SRC := $(JDK_TOPDIR)/src/closed/share/classes/oracle/jrockit/jfr/settings/
JFR_CONFIGURATION_DIR_DST := $(LIBDIR)/jfr/
JFR_SRC_FILES = $(wildcard $(JFR_CONFIGURATION_DIR_SRC)/*.jfc)
JFR_TARGET_FILES = $(subst $(JFR_CONFIGURATION_DIR_SRC),$(JFR_CONFIGURATION_DIR_DST),$(JFR_SRC_FILES))
$(JFR_CONFIGURATION_DIR_DST)/%.jfc : $(JFR_CONFIGURATION_DIR_SRC)/%.jfc
$(call install-file)
COPY_FILES += $(JFR_TARGET_FILES)
endif
endif
##########################################################################################
src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
浏览文件 @
7f94d1c9
...
@@ -812,8 +812,6 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
...
@@ -812,8 +812,6 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
throw
new
RuntimeException
(
"Unknown window state: "
+
windowState
);
throw
new
RuntimeException
(
"Unknown window state: "
+
windowState
);
}
}
nativeSynthesizeMouseEnteredExitedEvents
();
// NOTE: the SWP.windowState field gets updated to the newWindowState
// NOTE: the SWP.windowState field gets updated to the newWindowState
// value when the native notification comes to us
// value when the native notification comes to us
}
}
...
...
src/macosx/native/com/apple/laf/AquaFileView.m
浏览文件 @
7f94d1c9
...
@@ -187,13 +187,13 @@ JNIEXPORT jstring JNICALL Java_com_apple_laf_AquaFileView_getNativePathForResolv
...
@@ -187,13 +187,13 @@ JNIEXPORT jstring JNICALL Java_com_apple_laf_AquaFileView_getNativePathForResolv
JNF_COCOA_ENTER
(
env
);
JNF_COCOA_ENTER
(
env
);
UInt8
pathCString
[
MAXPATHLEN
+
1
];
UInt8
pathCString
[
MAXPATHLEN
+
1
];
size_t
pathSize
=
sizeof
(
pathCString
)
;
size_t
maxPathLen
=
sizeof
(
pathCString
)
-
1
;
jbyte
*
byteArray
=
(
*
env
)
->
GetByteArrayElements
(
env
,
pathToAlias
,
NULL
);
jbyte
*
byteArray
=
(
*
env
)
->
GetByteArrayElements
(
env
,
pathToAlias
,
NULL
);
jsize
length
=
(
*
env
)
->
GetArrayLength
(
env
,
pathToAlias
);
jsize
length
=
(
*
env
)
->
GetArrayLength
(
env
,
pathToAlias
);
if
(
length
>
pathSize
)
{
if
(
length
>
maxPathLen
)
{
length
=
pathSize
;
length
=
maxPathLen
;
}
}
strncpy
((
char
*
)
pathCString
,
(
char
*
)
byteArray
,
length
);
strncpy
((
char
*
)
pathCString
,
(
char
*
)
byteArray
,
length
);
// make sure it's null terminated
// make sure it's null terminated
...
...
src/macosx/native/sun/awt/AWTWindow.m
浏览文件 @
7f94d1c9
...
@@ -447,6 +447,8 @@ AWT_ASSERT_APPKIT_THREAD;
...
@@ -447,6 +447,8 @@ AWT_ASSERT_APPKIT_THREAD;
// TODO: create generic AWT assert
// TODO: create generic AWT assert
}
}
[
AWTWindow
synthesizeMouseEnteredExitedEventsForAllWindows
];
NSRect
frame
=
ConvertNSScreenRect
(
env
,
[
self
.
nsWindow
frame
]);
NSRect
frame
=
ConvertNSScreenRect
(
env
,
[
self
.
nsWindow
frame
]);
static
JNF_MEMBER_CACHE
(
jm_deliverMoveResizeEvent
,
jc_CPlatformWindow
,
"deliverMoveResizeEvent"
,
"(IIIIZ)V"
);
static
JNF_MEMBER_CACHE
(
jm_deliverMoveResizeEvent
,
jc_CPlatformWindow
,
"deliverMoveResizeEvent"
,
"(IIIIZ)V"
);
...
@@ -630,6 +632,7 @@ AWT_ASSERT_APPKIT_THREAD;
...
@@ -630,6 +632,7 @@ AWT_ASSERT_APPKIT_THREAD;
[
self
_notifyFullScreenOp
:
com_apple_eawt_FullScreenHandler_FULLSCREEN_DID_ENTER
withEnv
:
env
];
[
self
_notifyFullScreenOp
:
com_apple_eawt_FullScreenHandler_FULLSCREEN_DID_ENTER
withEnv
:
env
];
(
*
env
)
->
DeleteLocalRef
(
env
,
platformWindow
);
(
*
env
)
->
DeleteLocalRef
(
env
,
platformWindow
);
}
}
[
AWTWindow
synthesizeMouseEnteredExitedEventsForAllWindows
];
}
}
-
(
void
)
windowWillExitFullScreen
:(
NSNotification
*
)
notification
{
-
(
void
)
windowWillExitFullScreen
:(
NSNotification
*
)
notification
{
...
@@ -652,6 +655,7 @@ AWT_ASSERT_APPKIT_THREAD;
...
@@ -652,6 +655,7 @@ AWT_ASSERT_APPKIT_THREAD;
[
self
_notifyFullScreenOp
:
com_apple_eawt_FullScreenHandler_FULLSCREEN_DID_EXIT
withEnv
:
env
];
[
self
_notifyFullScreenOp
:
com_apple_eawt_FullScreenHandler_FULLSCREEN_DID_EXIT
withEnv
:
env
];
(
*
env
)
->
DeleteLocalRef
(
env
,
platformWindow
);
(
*
env
)
->
DeleteLocalRef
(
env
,
platformWindow
);
}
}
[
AWTWindow
synthesizeMouseEnteredExitedEventsForAllWindows
];
}
}
-
(
void
)
sendEvent
:(
NSEvent
*
)
event
{
-
(
void
)
sendEvent
:(
NSEvent
*
)
event
{
...
@@ -891,8 +895,6 @@ JNF_COCOA_ENTER(env);
...
@@ -891,8 +895,6 @@ JNF_COCOA_ENTER(env);
// ensure we repaint the whole window after the resize operation
// ensure we repaint the whole window after the resize operation
// (this will also re-enable screen updates, which were disabled above)
// (this will also re-enable screen updates, which were disabled above)
// TODO: send PaintEvent
// TODO: send PaintEvent
[
AWTWindow
synthesizeMouseEnteredExitedEventsForAllWindows
];
}];
}];
JNF_COCOA_EXIT
(
env
);
JNF_COCOA_EXIT
(
env
);
...
...
src/share/classes/java/awt/DefaultKeyboardFocusManager.java
浏览文件 @
7f94d1c9
...
@@ -285,13 +285,20 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
...
@@ -285,13 +285,20 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
TimedWindowEvent
we
=
(
TimedWindowEvent
)
e
;
TimedWindowEvent
we
=
(
TimedWindowEvent
)
e
;
long
time
=
we
.
getWhen
();
long
time
=
we
.
getWhen
();
synchronized
(
this
)
{
synchronized
(
this
)
{
for
(
KeyEvent
ke:
enqueuedKeyEvents
)
{
KeyEvent
ke
=
enqueuedKeyEvents
.
isEmpty
()
?
null
:
enqueuedKeyEvents
.
getFirst
();
if
(
time
>=
ke
.
getWhen
())
{
if
(
ke
!=
null
&&
time
>=
ke
.
getWhen
())
{
TypeAheadMarker
marker
=
typeAheadMarkers
.
getFirst
();
if
(
marker
!=
null
)
{
Window
toplevel
=
marker
.
untilFocused
.
getContainingWindow
();
// Check that the component awaiting focus belongs to
// the current focused window. See 8015454.
if
(
toplevel
!=
null
&&
toplevel
.
isFocused
())
{
SunToolkit
.
postEvent
(
AppContext
.
getAppContext
(),
new
SequencedEvent
(
e
));
SunToolkit
.
postEvent
(
AppContext
.
getAppContext
(),
new
SequencedEvent
(
e
));
return
true
;
return
true
;
}
}
}
}
}
}
}
return
false
;
return
false
;
}
}
...
...
src/share/classes/java/awt/color/ICC_Profile.java
浏览文件 @
7f94d1c9
...
@@ -37,6 +37,7 @@ package java.awt.color;
...
@@ -37,6 +37,7 @@ package java.awt.color;
import
sun.java2d.cmm.PCMM
;
import
sun.java2d.cmm.PCMM
;
import
sun.java2d.cmm.CMSManager
;
import
sun.java2d.cmm.CMSManager
;
import
sun.java2d.cmm.ProfileDataVerifier
;
import
sun.java2d.cmm.ProfileDeferralMgr
;
import
sun.java2d.cmm.ProfileDeferralMgr
;
import
sun.java2d.cmm.ProfileDeferralInfo
;
import
sun.java2d.cmm.ProfileDeferralInfo
;
import
sun.java2d.cmm.ProfileActivator
;
import
sun.java2d.cmm.ProfileActivator
;
...
@@ -775,6 +776,8 @@ public class ICC_Profile implements Serializable {
...
@@ -775,6 +776,8 @@ public class ICC_Profile implements Serializable {
ProfileDeferralMgr
.
activateProfiles
();
ProfileDeferralMgr
.
activateProfiles
();
}
}
ProfileDataVerifier
.
verify
(
data
);
try
{
try
{
theID
=
CMSManager
.
getModule
().
loadProfile
(
data
);
theID
=
CMSManager
.
getModule
().
loadProfile
(
data
);
}
catch
(
CMMException
c
)
{
}
catch
(
CMMException
c
)
{
...
...
src/share/classes/java/nio/CharBufferSpliterator.java
浏览文件 @
7f94d1c9
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
* 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
* under the terms of the GNU General Public License version 2 only, as
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
* by Oracle in the LICENSE file that accompanied this code.
*
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* This code is distributed in the hope that it will be useful, but WITHOUT
...
...
src/share/classes/javax/swing/JFileChooser.java
浏览文件 @
7f94d1c9
...
@@ -1146,10 +1146,26 @@ public class JFileChooser extends JComponent implements Accessible {
...
@@ -1146,10 +1146,26 @@ public class JFileChooser extends JComponent implements Accessible {
* @see #resetChoosableFileFilters
* @see #resetChoosableFileFilters
*/
*/
public
boolean
removeChoosableFileFilter
(
FileFilter
f
)
{
public
boolean
removeChoosableFileFilter
(
FileFilter
f
)
{
if
(
filters
.
contains
(
f
))
{
int
index
=
filters
.
indexOf
(
f
);
if
(
index
>=
0
)
{
if
(
getFileFilter
()
==
f
)
{
if
(
getFileFilter
()
==
f
)
{
if
(
isAcceptAllFileFilterUsed
())
{
// choose default filter if it is used
setFileFilter
(
getAcceptAllFileFilter
());
}
else
if
(
index
>
0
)
{
// choose the first filter, because it is not removed
setFileFilter
(
filters
.
get
(
0
));
}
else
if
(
filters
.
size
()
>
1
)
{
// choose the second filter, because the first one is removed
setFileFilter
(
filters
.
get
(
1
));
}
else
{
// no more filters
setFileFilter
(
null
);
setFileFilter
(
null
);
}
}
}
FileFilter
[]
oldValue
=
getChoosableFileFilters
();
FileFilter
[]
oldValue
=
getChoosableFileFilters
();
filters
.
removeElement
(
f
);
filters
.
removeElement
(
f
);
firePropertyChange
(
CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY
,
oldValue
,
getChoosableFileFilters
());
firePropertyChange
(
CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY
,
oldValue
,
getChoosableFileFilters
());
...
...
src/share/classes/javax/swing/JTree.java
浏览文件 @
7f94d1c9
...
@@ -3751,7 +3751,7 @@ public class JTree extends JComponent implements Scrollable, Accessible
...
@@ -3751,7 +3751,7 @@ public class JTree extends JComponent implements Scrollable, Accessible
* the nodes identified by in <code>e</code>.
* the nodes identified by in <code>e</code>.
*/
*/
void
removeDescendantSelectedPaths
(
TreeModelEvent
e
)
{
void
removeDescendantSelectedPaths
(
TreeModelEvent
e
)
{
TreePath
pPath
=
e
.
getTreePath
(
);
TreePath
pPath
=
SwingUtilities2
.
getTreePath
(
e
,
getModel
()
);
Object
[]
oldChildren
=
e
.
getChildren
();
Object
[]
oldChildren
=
e
.
getChildren
();
TreeSelectionModel
sm
=
getSelectionModel
();
TreeSelectionModel
sm
=
getSelectionModel
();
...
@@ -3785,7 +3785,7 @@ public class JTree extends JComponent implements Scrollable, Accessible
...
@@ -3785,7 +3785,7 @@ public class JTree extends JComponent implements Scrollable, Accessible
// and update BasicTreeUIs treeStructureChanged method
// and update BasicTreeUIs treeStructureChanged method
// to update descendants in response to a treeStructureChanged
// to update descendants in response to a treeStructureChanged
// event, all the children of the event won't collapse!
// event, all the children of the event won't collapse!
TreePath
parent
=
e
.
getTreePath
(
);
TreePath
parent
=
SwingUtilities2
.
getTreePath
(
e
,
getModel
()
);
if
(
parent
==
null
)
if
(
parent
==
null
)
return
;
return
;
...
@@ -3822,7 +3822,7 @@ public class JTree extends JComponent implements Scrollable, Accessible
...
@@ -3822,7 +3822,7 @@ public class JTree extends JComponent implements Scrollable, Accessible
if
(
e
==
null
)
if
(
e
==
null
)
return
;
return
;
TreePath
parent
=
e
.
getTreePath
(
);
TreePath
parent
=
SwingUtilities2
.
getTreePath
(
e
,
getModel
()
);
Object
[]
children
=
e
.
getChildren
();
Object
[]
children
=
e
.
getChildren
();
if
(
children
==
null
)
if
(
children
==
null
)
...
...
src/share/classes/javax/swing/event/TreeModelEvent.java
浏览文件 @
7f94d1c9
...
@@ -128,7 +128,7 @@ public class TreeModelEvent extends EventObject {
...
@@ -128,7 +128,7 @@ public class TreeModelEvent extends EventObject {
public
TreeModelEvent
(
Object
source
,
Object
[]
path
,
int
[]
childIndices
,
public
TreeModelEvent
(
Object
source
,
Object
[]
path
,
int
[]
childIndices
,
Object
[]
children
)
Object
[]
children
)
{
{
this
(
source
,
new
TreePath
(
path
),
childIndices
,
children
);
this
(
source
,
(
path
==
null
)
?
null
:
new
TreePath
(
path
),
childIndices
,
children
);
}
}
/**
/**
...
@@ -183,7 +183,7 @@ public class TreeModelEvent extends EventObject {
...
@@ -183,7 +183,7 @@ public class TreeModelEvent extends EventObject {
*/
*/
public
TreeModelEvent
(
Object
source
,
Object
[]
path
)
public
TreeModelEvent
(
Object
source
,
Object
[]
path
)
{
{
this
(
source
,
new
TreePath
(
path
));
this
(
source
,
(
path
==
null
)
?
null
:
new
TreePath
(
path
));
}
}
/**
/**
...
...
src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java
浏览文件 @
7f94d1c9
...
@@ -73,6 +73,9 @@ public class BasicComboBoxEditor implements ComboBoxEditor,FocusListener {
...
@@ -73,6 +73,9 @@ public class BasicComboBoxEditor implements ComboBoxEditor,FocusListener {
if
(
anObject
!=
null
)
{
if
(
anObject
!=
null
)
{
text
=
anObject
.
toString
();
text
=
anObject
.
toString
();
if
(
text
==
null
)
{
text
=
""
;
}
oldValue
=
anObject
;
oldValue
=
anObject
;
}
else
{
}
else
{
text
=
""
;
text
=
""
;
...
...
src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java
浏览文件 @
7f94d1c9
...
@@ -3827,7 +3827,7 @@ public class BasicTreeUI extends TreeUI
...
@@ -3827,7 +3827,7 @@ public class BasicTreeUI extends TreeUI
//
//
public
void
treeNodesChanged
(
TreeModelEvent
e
)
{
public
void
treeNodesChanged
(
TreeModelEvent
e
)
{
if
(
treeState
!=
null
&&
e
!=
null
)
{
if
(
treeState
!=
null
&&
e
!=
null
)
{
TreePath
parentPath
=
e
.
getTreePath
(
);
TreePath
parentPath
=
SwingUtilities2
.
getTreePath
(
e
,
getModel
()
);
int
[]
indices
=
e
.
getChildIndices
();
int
[]
indices
=
e
.
getChildIndices
();
if
(
indices
==
null
||
indices
.
length
==
0
)
{
if
(
indices
==
null
||
indices
.
length
==
0
)
{
// The root has changed
// The root has changed
...
@@ -3882,7 +3882,7 @@ public class BasicTreeUI extends TreeUI
...
@@ -3882,7 +3882,7 @@ public class BasicTreeUI extends TreeUI
updateLeadSelectionRow
();
updateLeadSelectionRow
();
TreePath
path
=
e
.
getTreePath
(
);
TreePath
path
=
SwingUtilities2
.
getTreePath
(
e
,
getModel
()
);
if
(
treeState
.
isExpanded
(
path
))
{
if
(
treeState
.
isExpanded
(
path
))
{
updateSize
();
updateSize
();
...
@@ -3907,7 +3907,7 @@ public class BasicTreeUI extends TreeUI
...
@@ -3907,7 +3907,7 @@ public class BasicTreeUI extends TreeUI
updateLeadSelectionRow
();
updateLeadSelectionRow
();
TreePath
path
=
e
.
getTreePath
(
);
TreePath
path
=
SwingUtilities2
.
getTreePath
(
e
,
getModel
()
);
if
(
treeState
.
isExpanded
(
path
)
||
if
(
treeState
.
isExpanded
(
path
)
||
treeModel
.
getChildCount
(
path
.
getLastPathComponent
())
==
0
)
treeModel
.
getChildCount
(
path
.
getLastPathComponent
())
==
0
)
...
@@ -3921,7 +3921,7 @@ public class BasicTreeUI extends TreeUI
...
@@ -3921,7 +3921,7 @@ public class BasicTreeUI extends TreeUI
updateLeadSelectionRow
();
updateLeadSelectionRow
();
TreePath
pPath
=
e
.
getTreePath
(
);
TreePath
pPath
=
SwingUtilities2
.
getTreePath
(
e
,
getModel
()
);
if
(
pPath
!=
null
)
{
if
(
pPath
!=
null
)
{
pPath
=
pPath
.
getParentPath
();
pPath
=
pPath
.
getParentPath
();
...
...
src/share/classes/javax/swing/text/View.java
浏览文件 @
7f94d1c9
...
@@ -1174,7 +1174,7 @@ public abstract class View implements SwingConstants {
...
@@ -1174,7 +1174,7 @@ public abstract class View implements SwingConstants {
// formed by added elements (i.e. they will be updated
// formed by added elements (i.e. they will be updated
// by initialization.
// by initialization.
index0
=
Math
.
max
(
index0
,
0
);
index0
=
Math
.
max
(
index0
,
0
);
index1
=
getViewIndex
(
elem
.
getDocument
().
getLength
(),
Position
.
Bias
.
Forward
);
index1
=
Math
.
max
((
getViewCount
()
-
1
),
0
);
for
(
int
i
=
index0
;
i
<=
index1
;
i
++)
{
for
(
int
i
=
index0
;
i
<=
index1
;
i
++)
{
if
(!
((
i
>=
hole0
)
&&
(
i
<=
hole1
)))
{
if
(!
((
i
>=
hole0
)
&&
(
i
<=
hole1
)))
{
v
=
getView
(
i
);
v
=
getView
(
i
);
...
...
src/share/classes/javax/swing/tree/FixedHeightLayoutCache.java
浏览文件 @
7f94d1c9
...
@@ -26,13 +26,14 @@
...
@@ -26,13 +26,14 @@
package
javax.swing.tree
;
package
javax.swing.tree
;
import
javax.swing.event.TreeModelEvent
;
import
javax.swing.event.TreeModelEvent
;
import
java.awt.Dimension
;
import
java.awt.Rectangle
;
import
java.awt.Rectangle
;
import
java.util.Enumeration
;
import
java.util.Enumeration
;
import
java.util.Hashtable
;
import
java.util.Hashtable
;
import
java.util.NoSuchElementException
;
import
java.util.NoSuchElementException
;
import
java.util.Stack
;
import
java.util.Stack
;
import
sun.swing.SwingUtilities2
;
/**
/**
* NOTE: This will become more open in a future release.
* NOTE: This will become more open in a future release.
* <p>
* <p>
...
@@ -346,7 +347,7 @@ public class FixedHeightLayoutCache extends AbstractLayoutCache {
...
@@ -346,7 +347,7 @@ public class FixedHeightLayoutCache extends AbstractLayoutCache {
if
(
e
!=
null
)
{
if
(
e
!=
null
)
{
int
changedIndexs
[];
int
changedIndexs
[];
FHTreeStateNode
changedParent
=
getNodeForPath
FHTreeStateNode
changedParent
=
getNodeForPath
(
e
.
getTreePath
(
),
false
,
false
);
(
SwingUtilities2
.
getTreePath
(
e
,
getModel
()
),
false
,
false
);
int
maxCounter
;
int
maxCounter
;
changedIndexs
=
e
.
getChildIndices
();
changedIndexs
=
e
.
getChildIndices
();
...
@@ -390,7 +391,7 @@ public class FixedHeightLayoutCache extends AbstractLayoutCache {
...
@@ -390,7 +391,7 @@ public class FixedHeightLayoutCache extends AbstractLayoutCache {
if
(
e
!=
null
)
{
if
(
e
!=
null
)
{
int
changedIndexs
[];
int
changedIndexs
[];
FHTreeStateNode
changedParent
=
getNodeForPath
FHTreeStateNode
changedParent
=
getNodeForPath
(
e
.
getTreePath
(
),
false
,
false
);
(
SwingUtilities2
.
getTreePath
(
e
,
getModel
()
),
false
,
false
);
int
maxCounter
;
int
maxCounter
;
changedIndexs
=
e
.
getChildIndices
();
changedIndexs
=
e
.
getChildIndices
();
...
@@ -429,7 +430,7 @@ public class FixedHeightLayoutCache extends AbstractLayoutCache {
...
@@ -429,7 +430,7 @@ public class FixedHeightLayoutCache extends AbstractLayoutCache {
if
(
e
!=
null
)
{
if
(
e
!=
null
)
{
int
changedIndexs
[];
int
changedIndexs
[];
int
maxCounter
;
int
maxCounter
;
TreePath
parentPath
=
e
.
getTreePath
(
);
TreePath
parentPath
=
SwingUtilities2
.
getTreePath
(
e
,
getModel
()
);
FHTreeStateNode
changedParentNode
=
getNodeForPath
FHTreeStateNode
changedParentNode
=
getNodeForPath
(
parentPath
,
false
,
false
);
(
parentPath
,
false
,
false
);
...
@@ -475,7 +476,7 @@ public class FixedHeightLayoutCache extends AbstractLayoutCache {
...
@@ -475,7 +476,7 @@ public class FixedHeightLayoutCache extends AbstractLayoutCache {
*/
*/
public
void
treeStructureChanged
(
TreeModelEvent
e
)
{
public
void
treeStructureChanged
(
TreeModelEvent
e
)
{
if
(
e
!=
null
)
{
if
(
e
!=
null
)
{
TreePath
changedPath
=
e
.
getTreePath
(
);
TreePath
changedPath
=
SwingUtilities2
.
getTreePath
(
e
,
getModel
()
);
FHTreeStateNode
changedNode
=
getNodeForPath
FHTreeStateNode
changedNode
=
getNodeForPath
(
changedPath
,
false
,
false
);
(
changedPath
,
false
,
false
);
...
...
src/share/classes/javax/swing/tree/VariableHeightLayoutCache.java
浏览文件 @
7f94d1c9
...
@@ -26,7 +26,6 @@
...
@@ -26,7 +26,6 @@
package
javax.swing.tree
;
package
javax.swing.tree
;
import
javax.swing.event.TreeModelEvent
;
import
javax.swing.event.TreeModelEvent
;
import
java.awt.Dimension
;
import
java.awt.Rectangle
;
import
java.awt.Rectangle
;
import
java.util.Enumeration
;
import
java.util.Enumeration
;
import
java.util.Hashtable
;
import
java.util.Hashtable
;
...
@@ -34,6 +33,8 @@ import java.util.NoSuchElementException;
...
@@ -34,6 +33,8 @@ import java.util.NoSuchElementException;
import
java.util.Stack
;
import
java.util.Stack
;
import
java.util.Vector
;
import
java.util.Vector
;
import
sun.swing.SwingUtilities2
;
/**
/**
* NOTE: This will become more open in a future release.
* NOTE: This will become more open in a future release.
* <p>
* <p>
...
@@ -413,7 +414,7 @@ public class VariableHeightLayoutCache extends AbstractLayoutCache {
...
@@ -413,7 +414,7 @@ public class VariableHeightLayoutCache extends AbstractLayoutCache {
TreeStateNode
changedNode
;
TreeStateNode
changedNode
;
changedIndexs
=
e
.
getChildIndices
();
changedIndexs
=
e
.
getChildIndices
();
changedNode
=
getNodeForPath
(
e
.
getTreePath
(
),
false
,
false
);
changedNode
=
getNodeForPath
(
SwingUtilities2
.
getTreePath
(
e
,
getModel
()
),
false
,
false
);
if
(
changedNode
!=
null
)
{
if
(
changedNode
!=
null
)
{
Object
changedValue
=
changedNode
.
getValue
();
Object
changedValue
=
changedNode
.
getValue
();
...
@@ -466,7 +467,7 @@ public class VariableHeightLayoutCache extends AbstractLayoutCache {
...
@@ -466,7 +467,7 @@ public class VariableHeightLayoutCache extends AbstractLayoutCache {
TreeStateNode
changedParentNode
;
TreeStateNode
changedParentNode
;
changedIndexs
=
e
.
getChildIndices
();
changedIndexs
=
e
.
getChildIndices
();
changedParentNode
=
getNodeForPath
(
e
.
getTreePath
(
),
false
,
false
);
changedParentNode
=
getNodeForPath
(
SwingUtilities2
.
getTreePath
(
e
,
getModel
()
),
false
,
false
);
/* Only need to update the children if the node has been
/* Only need to update the children if the node has been
expanded once. */
expanded once. */
// PENDING(scott): make sure childIndexs is sorted!
// PENDING(scott): make sure childIndexs is sorted!
...
@@ -540,7 +541,7 @@ public class VariableHeightLayoutCache extends AbstractLayoutCache {
...
@@ -540,7 +541,7 @@ public class VariableHeightLayoutCache extends AbstractLayoutCache {
TreeStateNode
changedParentNode
;
TreeStateNode
changedParentNode
;
changedIndexs
=
e
.
getChildIndices
();
changedIndexs
=
e
.
getChildIndices
();
changedParentNode
=
getNodeForPath
(
e
.
getTreePath
(
),
false
,
false
);
changedParentNode
=
getNodeForPath
(
SwingUtilities2
.
getTreePath
(
e
,
getModel
()
),
false
,
false
);
// PENDING(scott): make sure that changedIndexs are sorted in
// PENDING(scott): make sure that changedIndexs are sorted in
// ascending order.
// ascending order.
if
(
changedParentNode
!=
null
&&
changedIndexs
!=
null
&&
if
(
changedParentNode
!=
null
&&
changedIndexs
!=
null
&&
...
@@ -628,7 +629,7 @@ public class VariableHeightLayoutCache extends AbstractLayoutCache {
...
@@ -628,7 +629,7 @@ public class VariableHeightLayoutCache extends AbstractLayoutCache {
public
void
treeStructureChanged
(
TreeModelEvent
e
)
{
public
void
treeStructureChanged
(
TreeModelEvent
e
)
{
if
(
e
!=
null
)
if
(
e
!=
null
)
{
{
TreePath
changedPath
=
e
.
getTreePath
(
);
TreePath
changedPath
=
SwingUtilities2
.
getTreePath
(
e
,
getModel
()
);
TreeStateNode
changedNode
;
TreeStateNode
changedNode
;
changedNode
=
getNodeForPath
(
changedPath
,
false
,
false
);
changedNode
=
getNodeForPath
(
changedPath
,
false
,
false
);
...
...
src/share/classes/sun/java2d/cmm/ProfileDataVerifier.java
0 → 100644
浏览文件 @
7f94d1c9
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package
sun.java2d.cmm
;
public
class
ProfileDataVerifier
{
/**
* Throws an IllegalArgumentException if the data does not correspond
* to a valid ICC Profile.
*
* @param data the specified profile data.
*/
public
static
void
verify
(
byte
[]
data
)
{
if
(
data
==
null
)
{
throw
new
IllegalArgumentException
(
"Invalid ICC Profile Data"
);
}
if
(
data
.
length
<
TOC_OFFSET
)
{
// not enough data for profile header
throw
new
IllegalArgumentException
(
"Invalid ICC Profile Data"
);
}
// check profile size
final
int
size
=
readInt32
(
data
,
0
);
final
int
tagCount
=
readInt32
(
data
,
HEADER_SIZE
);
if
(
tagCount
<
0
||
tagCount
>
MAX_TAG_COUNT
)
{
throw
new
IllegalArgumentException
(
"Invalid ICC Profile Data"
);
}
if
(
size
<
(
TOC_OFFSET
+
(
tagCount
*
TOC_RECORD_SIZE
))
||
size
>
data
.
length
)
{
throw
new
IllegalArgumentException
(
"Invalid ICC Profile Data"
);
}
final
int
sig
=
readInt32
(
data
,
36
);
if
(
PROFILE_FILE_SIGNATURE
!=
sig
)
{
throw
new
IllegalArgumentException
(
"Invalid ICC Profile Data"
);
}
// verify table of content
for
(
int
i
=
0
;
i
<
tagCount
;
i
++)
{
final
int
tag_offset
=
getTagOffset
(
i
,
data
);
final
int
tag_size
=
getTagSize
(
i
,
data
);
if
(
tag_offset
<
TOC_OFFSET
||
tag_offset
>
size
)
{
throw
new
IllegalArgumentException
(
"Invalid ICC Profile Data"
);
}
if
(
tag_size
<
0
||
tag_size
>
(
Integer
.
MAX_VALUE
-
tag_offset
)
||
tag_size
+
tag_offset
>
size
)
{
throw
new
IllegalArgumentException
(
"Invalid ICC Profile Data"
);
}
}
}
private
static
int
getTagOffset
(
int
idx
,
byte
[]
data
)
{
final
int
pos
=
TOC_OFFSET
+
idx
*
TOC_RECORD_SIZE
+
4
;
return
readInt32
(
data
,
pos
);
}
private
static
int
getTagSize
(
int
idx
,
byte
[]
data
)
{
final
int
pos
=
TOC_OFFSET
+
idx
*
TOC_RECORD_SIZE
+
8
;
return
readInt32
(
data
,
pos
);
}
private
static
int
readInt32
(
byte
[]
data
,
int
off
)
{
int
res
=
0
;
for
(
int
i
=
0
;
i
<
4
;
i
++)
{
res
=
res
<<
8
;
res
|=
(
0xff
&
data
[
off
++]);
}
return
res
;
}
/**
* Lcms limit for the number of tags: 100
* Kcms limit for the number of tags: N/A
*/
private
static
final
int
MAX_TAG_COUNT
=
100
;
private
static
final
int
HEADER_SIZE
=
128
;
private
static
final
int
TOC_OFFSET
=
HEADER_SIZE
+
4
;
private
static
final
int
TOC_RECORD_SIZE
=
12
;
private
static
final
int
PROFILE_FILE_SIGNATURE
=
0x61637370
;
}
src/share/classes/sun/swing/SwingUtilities2.java
浏览文件 @
7f94d1c9
...
@@ -33,18 +33,19 @@ import java.awt.event.*;
...
@@ -33,18 +33,19 @@ import java.awt.event.*;
import
java.awt.font.*
;
import
java.awt.font.*
;
import
java.awt.geom.*
;
import
java.awt.geom.*
;
import
java.awt.print.PrinterGraphics
;
import
java.awt.print.PrinterGraphics
;
import
java.text.Bidi
;
import
java.text.AttributedCharacterIterator
;
import
java.text.AttributedCharacterIterator
;
import
java.text.AttributedString
;
import
java.text.AttributedString
;
import
javax.swing.*
;
import
javax.swing.*
;
import
javax.swing.
plaf.*
;
import
javax.swing.
event.TreeModelEvent
;
import
javax.swing.text.Highlighter
;
import
javax.swing.text.Highlighter
;
import
javax.swing.text.JTextComponent
;
import
javax.swing.text.JTextComponent
;
import
javax.swing.text.DefaultHighlighter
;
import
javax.swing.text.DefaultHighlighter
;
import
javax.swing.text.DefaultCaret
;
import
javax.swing.text.DefaultCaret
;
import
javax.swing.table.TableCellRenderer
;
import
javax.swing.table.TableCellRenderer
;
import
javax.swing.table.TableColumnModel
;
import
javax.swing.table.TableColumnModel
;
import
javax.swing.tree.TreeModel
;
import
javax.swing.tree.TreePath
;
import
sun.swing.PrintColorUIResource
;
import
sun.swing.PrintColorUIResource
;
import
sun.swing.ImageIconUIResource
;
import
sun.swing.ImageIconUIResource
;
...
@@ -1887,4 +1888,22 @@ public class SwingUtilities2 {
...
@@ -1887,4 +1888,22 @@ public class SwingUtilities2 {
}
}
return
InputEvent
.
ALT_MASK
;
return
InputEvent
.
ALT_MASK
;
}
}
/**
* Returns the {@link TreePath} that identifies the changed nodes.
*
* @param event changes in a tree model
* @param model corresponing tree model
* @return the path to the changed nodes
*/
public
static
TreePath
getTreePath
(
TreeModelEvent
event
,
TreeModel
model
)
{
TreePath
path
=
event
.
getTreePath
();
if
((
path
==
null
)
&&
(
model
!=
null
))
{
Object
root
=
model
.
getRoot
();
if
(
root
!=
null
)
{
path
=
new
TreePath
(
root
);
}
}
return
path
;
}
}
}
src/share/native/sun/font/layout/KernTable.cpp
浏览文件 @
7f94d1c9
...
@@ -96,7 +96,7 @@ LE_CORRECT_SIZE(KernTableHeader, KERN_TABLE_HEADER_SIZE)
...
@@ -96,7 +96,7 @@ LE_CORRECT_SIZE(KernTableHeader, KERN_TABLE_HEADER_SIZE)
* TODO: respect header flags
* TODO: respect header flags
*/
*/
KernTable
::
KernTable
(
const
LETableReference
&
base
,
LEErrorCode
&
success
)
KernTable
::
KernTable
(
const
LETableReference
&
base
,
LEErrorCode
&
success
)
:
pairs
(),
pairs
Swapped
(
NULL
),
fTable
(
base
)
:
pairsSwapped
(
NULL
),
fTable
(
base
)
{
{
if
(
LE_FAILURE
(
success
)
||
(
fTable
.
isEmpty
()))
{
if
(
LE_FAILURE
(
success
)
||
(
fTable
.
isEmpty
()))
{
#if DEBUG
#if DEBUG
...
@@ -143,15 +143,17 @@ KernTable::KernTable(const LETableReference& base, LEErrorCode &success)
...
@@ -143,15 +143,17 @@ KernTable::KernTable(const LETableReference& base, LEErrorCode &success)
#endif
#endif
if
(
LE_SUCCESS
(
success
)
&&
nPairs
>
0
)
{
if
(
LE_SUCCESS
(
success
)
&&
nPairs
>
0
)
{
// pairs is an instance member, and table is on the stack.
// pairs
Swapped
is an instance member, and table is on the stack.
// set 'pairs' based on table.getAlias(). This will range check it.
// set 'pairs
Swapped
' based on table.getAlias(). This will range check it.
pairs
=
LEReferenceToArrayOf
<
PairInfo
>
(
fTable
,
// based on overall table
pairsSwapped
=
(
PairInfo
*
)(
fTable
.
getFont
()
->
getKernPairs
());
if
(
pairsSwapped
==
NULL
)
{
LEReferenceToArrayOf
<
PairInfo
>
pairs
=
LEReferenceToArrayOf
<
PairInfo
>
(
fTable
,
// based on overall table
success
,
success
,
(
const
PairInfo
*
)
table
.
getAlias
(),
// subtable 0 + ..
(
const
PairInfo
*
)
table
.
getAlias
(),
// subtable 0 + ..
KERN_SUBTABLE_0_HEADER_SIZE
,
// .. offset of header size
KERN_SUBTABLE_0_HEADER_SIZE
,
// .. offset of header size
nPairs
);
// count
nPairs
);
// count
}
if
(
LE_SUCCESS
(
success
)
&&
pairs
.
isValid
())
{
if
(
LE_SUCCESS
(
success
)
&&
pairs
.
isValid
())
{
pairsSwapped
=
(
PairInfo
*
)(
malloc
(
nPairs
*
sizeof
(
PairInfo
)));
pairsSwapped
=
(
PairInfo
*
)(
malloc
(
nPairs
*
sizeof
(
PairInfo
)));
PairInfo
*
p
=
(
PairInfo
*
)
pairsSwapped
;
PairInfo
*
p
=
(
PairInfo
*
)
pairsSwapped
;
...
@@ -161,14 +163,16 @@ KernTable::KernTable(const LETableReference& base, LEErrorCode &success)
...
@@ -161,14 +163,16 @@ KernTable::KernTable(const LETableReference& base, LEErrorCode &success)
}
}
fTable
.
getFont
()
->
setKernPairs
((
void
*
)
pairsSwapped
);
// store it
fTable
.
getFont
()
->
setKernPairs
((
void
*
)
pairsSwapped
);
// store it
}
}
}
}
#if 0
#if 0
fprintf(stderr, "coverage: %0.4x nPairs: %d pairs %p\n", coverage, nPairs, pairs
.getAlias()
);
fprintf(stderr, "coverage: %0.4x nPairs: %d pairs %p\n", coverage, nPairs, pairs
Swapped
);
fprintf(stderr, " searchRange: %d entrySelector: %d rangeShift: %d\n", searchRange, entrySelector, rangeShift);
fprintf(stderr, " searchRange: %d entrySelector: %d rangeShift: %d\n", searchRange, entrySelector, rangeShift);
fprintf(stderr, "[[ ignored font table entries: range %d selector %d shift %d ]]\n", SWAPW(table->searchRange), SWAPW(table->entrySelector), SWAPW(table->rangeShift));
fprintf(stderr, "[[ ignored font table entries: range %d selector %d shift %d ]]\n", SWAPW(table->searchRange), SWAPW(table->entrySelector), SWAPW(table->rangeShift));
#endif
#endif
#if DEBUG
#if DEBUG
fprintf
(
stderr
,
"coverage: %0.4x nPairs: %d pairs 0x%x
\n
"
,
coverage
,
nPairs
,
pairs
);
fprintf
(
stderr
,
"coverage: %0.4x nPairs: %d pairs 0x%x
\n
"
,
coverage
,
nPairs
,
pairs
Swapped
);
fprintf
(
stderr
,
fprintf
(
stderr
,
" searchRange(pairs): %d entrySelector: %d rangeShift(pairs): %d
\n
"
,
" searchRange(pairs): %d entrySelector: %d rangeShift(pairs): %d
\n
"
,
searchRange
,
entrySelector
,
rangeShift
);
searchRange
,
entrySelector
,
rangeShift
);
...
@@ -182,7 +186,7 @@ KernTable::KernTable(const LETableReference& base, LEErrorCode &success)
...
@@ -182,7 +186,7 @@ KernTable::KernTable(const LETableReference& base, LEErrorCode &success)
ids
[
id
]
=
(
char
)
i
;
ids
[
id
]
=
(
char
)
i
;
}
}
}
}
PairInfo
*
p
=
pairs
;
PairInfo
*
p
=
pairs
Swapped
;
for
(
int
i
=
0
;
i
<
nPairs
;
++
i
,
p
++
)
{
for
(
int
i
=
0
;
i
<
nPairs
;
++
i
,
p
++
)
{
le_uint32
k
=
p
->
key
;
le_uint32
k
=
p
->
key
;
le_uint16
left
=
(
k
>>
16
)
&
0xffff
;
le_uint16
left
=
(
k
>>
16
)
&
0xffff
;
...
...
src/share/native/sun/font/layout/KernTable.h
浏览文件 @
7f94d1c9
...
@@ -57,7 +57,6 @@ class U_LAYOUT_API KernTable
...
@@ -57,7 +57,6 @@ class U_LAYOUT_API KernTable
private:
private:
le_uint16
coverage
;
le_uint16
coverage
;
le_uint16
nPairs
;
le_uint16
nPairs
;
LEReferenceToArrayOf
<
PairInfo
>
pairs
;
PairInfo
*
pairsSwapped
;
PairInfo
*
pairsSwapped
;
const
LETableReference
&
fTable
;
const
LETableReference
&
fTable
;
le_uint16
searchRange
;
le_uint16
searchRange
;
...
...
src/share/native/sun/font/layout/LayoutEngine.cpp
浏览文件 @
7f94d1c9
...
@@ -569,7 +569,6 @@ void LayoutEngine::reset()
...
@@ -569,7 +569,6 @@ void LayoutEngine::reset()
{
{
if
(
fGlyphStorage
!=
NULL
)
{
if
(
fGlyphStorage
!=
NULL
)
{
fGlyphStorage
->
reset
();
fGlyphStorage
->
reset
();
fGlyphStorage
=
NULL
;
}
}
}
}
...
...
src/share/native/sun/management/DiagnosticCommandImpl.c
浏览文件 @
7f94d1c9
src/solaris/classes/sun/awt/X11/XKeyboardFocusManagerPeer.java
浏览文件 @
7f94d1c9
/*
/*
* Copyright (c) 2003, 20
08
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
13
, 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
...
@@ -26,9 +26,11 @@ package sun.awt.X11;
...
@@ -26,9 +26,11 @@ package sun.awt.X11;
import
java.awt.Component
;
import
java.awt.Component
;
import
java.awt.Window
;
import
java.awt.Window
;
import
sun.util.logging.PlatformLogger
;
import
sun.awt.AWTAccessor
;
import
sun.awt.CausedFocusEvent
;
import
sun.awt.CausedFocusEvent
;
import
sun.awt.KeyboardFocusManagerPeerImpl
;
import
sun.awt.KeyboardFocusManagerPeerImpl
;
import
sun.util.logging.PlatformLogger
;
public
class
XKeyboardFocusManagerPeer
extends
KeyboardFocusManagerPeerImpl
{
public
class
XKeyboardFocusManagerPeer
extends
KeyboardFocusManagerPeerImpl
{
private
static
final
PlatformLogger
focusLog
=
PlatformLogger
.
getLogger
(
"sun.awt.X11.focus.XKeyboardFocusManagerPeer"
);
private
static
final
PlatformLogger
focusLog
=
PlatformLogger
.
getLogger
(
"sun.awt.X11.focus.XKeyboardFocusManagerPeer"
);
...
@@ -68,13 +70,13 @@ public class XKeyboardFocusManagerPeer extends KeyboardFocusManagerPeerImpl {
...
@@ -68,13 +70,13 @@ public class XKeyboardFocusManagerPeer extends KeyboardFocusManagerPeerImpl {
synchronized
(
this
)
{
synchronized
(
this
)
{
if
(
currentFocusedWindow
!=
null
)
{
if
(
currentFocusedWindow
!=
null
)
{
from
=
(
XWindowPeer
)
currentFocusedWindow
.
getPeer
(
);
from
=
(
XWindowPeer
)
AWTAccessor
.
getComponentAccessor
().
getPeer
(
currentFocusedWindow
);
}
}
currentFocusedWindow
=
win
;
currentFocusedWindow
=
win
;
if
(
currentFocusedWindow
!=
null
)
{
if
(
currentFocusedWindow
!=
null
)
{
to
=
(
XWindowPeer
)
currentFocusedWindow
.
getPeer
(
);
to
=
(
XWindowPeer
)
AWTAccessor
.
getComponentAccessor
().
getPeer
(
currentFocusedWindow
);
}
}
}
}
...
...
src/solaris/classes/sun/print/UnixPrintServiceLookup.java
浏览文件 @
7f94d1c9
...
@@ -362,10 +362,33 @@ public class UnixPrintServiceLookup extends PrintServiceLookup
...
@@ -362,10 +362,33 @@ public class UnixPrintServiceLookup extends PrintServiceLookup
*/
*/
private
PrintService
getServiceByName
(
PrinterName
nameAttr
)
{
private
PrintService
getServiceByName
(
PrinterName
nameAttr
)
{
String
name
=
nameAttr
.
getValue
();
String
name
=
nameAttr
.
getValue
();
PrintService
printer
=
null
;
if
(
name
==
null
||
name
.
equals
(
""
)
||
!
checkPrinterName
(
name
))
{
if
(
name
==
null
||
name
.
equals
(
""
)
||
!
checkPrinterName
(
name
))
{
return
null
;
return
null
;
}
}
/* check is all printers are already available */
if
(
printServices
!=
null
)
{
for
(
PrintService
printService
:
printServices
)
{
if
(
printService
.
getName
().
equals
(
name
))
{
return
printService
;
}
}
}
/* take CUPS into account first */
if
(
CUPSPrinter
.
isCupsRunning
())
{
try
{
return
new
IPPPrintService
(
name
,
new
URL
(
"http://"
+
CUPSPrinter
.
getServer
()+
":"
+
CUPSPrinter
.
getPort
()+
"/"
+
name
));
}
catch
(
Exception
e
)
{
IPPPrintService
.
debug_println
(
debugPrefix
+
" getServiceByName Exception "
+
e
);
}
}
/* fallback if nothing not having a printer at this point */
PrintService
printer
=
null
;
if
(
isMac
()
||
isSysV
())
{
if
(
isMac
()
||
isSysV
())
{
printer
=
getNamedPrinterNameSysV
(
name
);
printer
=
getNamedPrinterNameSysV
(
name
);
}
else
{
}
else
{
...
...
src/solaris/native/sun/awt/awt_GraphicsEnv.c
浏览文件 @
7f94d1c9
...
@@ -1369,12 +1369,18 @@ Java_sun_awt_X11GraphicsConfig_pGetBounds(JNIEnv *env, jobject this, jint screen
...
@@ -1369,12 +1369,18 @@ Java_sun_awt_X11GraphicsConfig_pGetBounds(JNIEnv *env, jobject this, jint screen
mid
=
(
*
env
)
->
GetMethodID
(
env
,
clazz
,
"<init>"
,
"(IIII)V"
);
mid
=
(
*
env
)
->
GetMethodID
(
env
,
clazz
,
"<init>"
,
"(IIII)V"
);
if
(
mid
!=
NULL
)
{
if
(
mid
!=
NULL
)
{
if
(
usingXinerama
)
{
if
(
usingXinerama
)
{
if
(
0
<=
screen
&&
screen
<
awt_numScreens
)
{
bounds
=
(
*
env
)
->
NewObject
(
env
,
clazz
,
mid
,
fbrects
[
screen
].
x
,
bounds
=
(
*
env
)
->
NewObject
(
env
,
clazz
,
mid
,
fbrects
[
screen
].
x
,
fbrects
[
screen
].
y
,
fbrects
[
screen
].
y
,
fbrects
[
screen
].
width
,
fbrects
[
screen
].
width
,
fbrects
[
screen
].
height
);
fbrects
[
screen
].
height
);
}
else
{
jclass
exceptionClass
=
(
*
env
)
->
FindClass
(
env
,
"java/lang/IllegalArgumentException"
);
if
(
exceptionClass
!=
NULL
)
{
(
*
env
)
->
ThrowNew
(
env
,
exceptionClass
,
"Illegal screen index"
);
}
}
else
{
}
}
else
{
XWindowAttributes
xwa
;
XWindowAttributes
xwa
;
memset
(
&
xwa
,
0
,
sizeof
(
xwa
));
memset
(
&
xwa
,
0
,
sizeof
(
xwa
));
...
...
src/solaris/native/sun/awt/awt_InputMethod.c
浏览文件 @
7f94d1c9
...
@@ -447,7 +447,7 @@ setXICWindowFocus(XIC ic, Window w)
...
@@ -447,7 +447,7 @@ setXICWindowFocus(XIC ic, Window w)
*/
*/
#define INITIAL_LOOKUP_BUF_SIZE 512
#define INITIAL_LOOKUP_BUF_SIZE 512
Bool
Bool
ean
awt_x11inputmethod_lookupString
(
XKeyPressedEvent
*
event
,
KeySym
*
keysymp
)
awt_x11inputmethod_lookupString
(
XKeyPressedEvent
*
event
,
KeySym
*
keysymp
)
{
{
JNIEnv
*
env
=
GetJNIEnv
();
JNIEnv
*
env
=
GetJNIEnv
();
...
@@ -457,8 +457,8 @@ awt_x11inputmethod_lookupString(XKeyPressedEvent *event, KeySym *keysymp)
...
@@ -457,8 +457,8 @@ awt_x11inputmethod_lookupString(XKeyPressedEvent *event, KeySym *keysymp)
int
mblen
;
int
mblen
;
jstring
javastr
;
jstring
javastr
;
XIC
ic
;
XIC
ic
;
Bool
result
=
True
;
Bool
ean
result
=
True
;
static
Bool
composing
=
False
;
static
Bool
ean
composing
=
False
;
/*
/*
printf("lookupString: entering...\n");
printf("lookupString: entering...\n");
...
...
src/solaris/native/sun/xawt/XToolkit.c
浏览文件 @
7f94d1c9
...
@@ -685,8 +685,7 @@ performPoll(JNIEnv *env, jlong nextTaskTime) {
...
@@ -685,8 +685,7 @@ performPoll(JNIEnv *env, jlong nextTaskTime) {
if
(
result
==
0
)
{
if
(
result
==
0
)
{
/* poll() timed out -- update timeout value */
/* poll() timed out -- update timeout value */
update_poll_timeout
(
TIMEOUT_TIMEDOUT
);
update_poll_timeout
(
TIMEOUT_TIMEDOUT
);
PRINT2
(
"%s(): TIMEOUT_TIMEDOUT curPollTimeout = %d
\n
"
,
PRINT2
(
"performPoll(): TIMEOUT_TIMEDOUT curPollTimeout = %d
\n
"
,
curPollTimeout
);
performPoll
,
curPollTimeout
);
}
}
if
(
pollFds
[
1
].
revents
)
{
if
(
pollFds
[
1
].
revents
)
{
int
count
;
int
count
;
...
@@ -695,14 +694,12 @@ performPoll(JNIEnv *env, jlong nextTaskTime) {
...
@@ -695,14 +694,12 @@ performPoll(JNIEnv *env, jlong nextTaskTime) {
do
{
do
{
count
=
read
(
AWT_READPIPE
,
read_buf
,
AWT_POLL_BUFSIZE
);
count
=
read
(
AWT_READPIPE
,
read_buf
,
AWT_POLL_BUFSIZE
);
}
while
(
count
==
AWT_POLL_BUFSIZE
);
}
while
(
count
==
AWT_POLL_BUFSIZE
);
PRINT2
(
"%s(): data on the AWT pipe: curPollTimeout = %d
\n
"
,
PRINT2
(
"performPoll(): data on the AWT pipe: curPollTimeout = %d
\n
"
,
curPollTimeout
);
performPoll
,
curPollTimeout
);
}
}
if
(
pollFds
[
0
].
revents
)
{
if
(
pollFds
[
0
].
revents
)
{
// Events in X pipe
// Events in X pipe
update_poll_timeout
(
TIMEOUT_EVENTS
);
update_poll_timeout
(
TIMEOUT_EVENTS
);
PRINT2
(
"%s(): TIMEOUT_EVENTS curPollTimeout = %ld
\n
"
,
PRINT2
(
"performPoll(): TIMEOUT_EVENTS curPollTimeout = %ld
\n
"
,
curPollTimeout
);
performPoll
,
curPollTimeout
);
}
}
return
;
return
;
...
...
src/windows/classes/sun/awt/windows/WPrinterJob.java
浏览文件 @
7f94d1c9
...
@@ -1269,11 +1269,13 @@ public class WPrinterJob extends RasterPrinterJob implements DisposerTarget {
...
@@ -1269,11 +1269,13 @@ public class WPrinterJob extends RasterPrinterJob implements DisposerTarget {
mLastFontFamily
=
null
;
mLastFontFamily
=
null
;
}
}
private
boolean
defaultCopies
=
true
;
/**
/**
* Set the number of copies to be printed.
* Set the number of copies to be printed.
*/
*/
public
void
setCopies
(
int
copies
)
{
public
void
setCopies
(
int
copies
)
{
super
.
setCopies
(
copies
);
super
.
setCopies
(
copies
);
defaultCopies
=
false
;
mAttCopies
=
copies
;
mAttCopies
=
copies
;
setNativeCopies
(
copies
);
setNativeCopies
(
copies
);
}
}
...
@@ -1529,8 +1531,9 @@ public class WPrinterJob extends RasterPrinterJob implements DisposerTarget {
...
@@ -1529,8 +1531,9 @@ public class WPrinterJob extends RasterPrinterJob implements DisposerTarget {
}
}
/* SheetCollate */
/* SheetCollate */
private
final
boolean
getCollateAttrib
()
{
private
final
int
getCollateAttrib
()
{
return
(
mAttCollate
==
1
);
// -1 means unset, 0 uncollated, 1 collated.
return
mAttCollate
;
}
}
private
void
setCollateAttrib
(
Attribute
attr
)
{
private
void
setCollateAttrib
(
Attribute
attr
)
{
...
@@ -1553,6 +1556,10 @@ public class WPrinterJob extends RasterPrinterJob implements DisposerTarget {
...
@@ -1553,6 +1556,10 @@ public class WPrinterJob extends RasterPrinterJob implements DisposerTarget {
int
orient
=
PageFormat
.
PORTRAIT
;
int
orient
=
PageFormat
.
PORTRAIT
;
OrientationRequested
orientReq
=
(
attributes
==
null
)
?
null
:
OrientationRequested
orientReq
=
(
attributes
==
null
)
?
null
:
(
OrientationRequested
)
attributes
.
get
(
OrientationRequested
.
class
);
(
OrientationRequested
)
attributes
.
get
(
OrientationRequested
.
class
);
if
(
orientReq
==
null
)
{
orientReq
=
(
OrientationRequested
)
myService
.
getDefaultAttributeValue
(
OrientationRequested
.
class
);
}
if
(
orientReq
!=
null
)
{
if
(
orientReq
!=
null
)
{
if
(
orientReq
==
OrientationRequested
.
REVERSE_LANDSCAPE
)
{
if
(
orientReq
==
OrientationRequested
.
REVERSE_LANDSCAPE
)
{
orient
=
PageFormat
.
REVERSE_LANDSCAPE
;
orient
=
PageFormat
.
REVERSE_LANDSCAPE
;
...
@@ -1573,8 +1580,12 @@ public class WPrinterJob extends RasterPrinterJob implements DisposerTarget {
...
@@ -1573,8 +1580,12 @@ public class WPrinterJob extends RasterPrinterJob implements DisposerTarget {
/* Copies and Page Range. */
/* Copies and Page Range. */
private
final
int
getCopiesAttrib
()
{
private
final
int
getCopiesAttrib
()
{
if
(
defaultCopies
)
{
return
0
;
}
else
{
return
getCopiesInt
();
return
getCopiesInt
();
}
}
}
private
final
void
setRangeCopiesAttribute
(
int
from
,
int
to
,
private
final
void
setRangeCopiesAttribute
(
int
from
,
int
to
,
boolean
isRangeSet
,
boolean
isRangeSet
,
...
@@ -1584,6 +1595,7 @@ public class WPrinterJob extends RasterPrinterJob implements DisposerTarget {
...
@@ -1584,6 +1595,7 @@ public class WPrinterJob extends RasterPrinterJob implements DisposerTarget {
attributes
.
add
(
new
PageRanges
(
from
,
to
));
attributes
.
add
(
new
PageRanges
(
from
,
to
));
setPageRange
(
from
,
to
);
setPageRange
(
from
,
to
);
}
}
defaultCopies
=
false
;
attributes
.
add
(
new
Copies
(
copies
));
attributes
.
add
(
new
Copies
(
copies
));
/* Since this is called from native to tell Java to sync
/* Since this is called from native to tell Java to sync
* up with native, we don't call this class's own setCopies()
* up with native, we don't call this class's own setCopies()
...
...
src/windows/classes/sun/print/Win32PrintService.java
浏览文件 @
7f94d1c9
...
@@ -180,6 +180,9 @@ public class Win32PrintService implements PrintService, AttributeUpdater,
...
@@ -180,6 +180,9 @@ public class Win32PrintService implements PrintService, AttributeUpdater,
private
static
final
int
DMDUP_VERTICAL
=
2
;
private
static
final
int
DMDUP_VERTICAL
=
2
;
private
static
final
int
DMDUP_HORIZONTAL
=
3
;
private
static
final
int
DMDUP_HORIZONTAL
=
3
;
private
static
final
int
DMCOLLATE_TRUE
=
1
;
private
static
final
int
DMCOLLATE_TRUE
=
1
;
private
static
final
int
DMCOLOR_MONOCHROME
=
1
;
private
static
final
int
DMCOLOR_COLOR
=
2
;
// media sizes with indices above dmPaperToPrintService' length
// media sizes with indices above dmPaperToPrintService' length
private
static
final
int
DMPAPER_A2
=
66
;
private
static
final
int
DMPAPER_A2
=
66
;
...
@@ -1041,6 +1044,7 @@ public class Win32PrintService implements PrintService, AttributeUpdater,
...
@@ -1041,6 +1044,7 @@ public class Win32PrintService implements PrintService, AttributeUpdater,
int
defOrient
=
defaults
[
5
];
int
defOrient
=
defaults
[
5
];
int
defSides
=
defaults
[
6
];
int
defSides
=
defaults
[
6
];
int
defCollate
=
defaults
[
7
];
int
defCollate
=
defaults
[
7
];
int
defColor
=
defaults
[
8
];
if
(
category
==
Copies
.
class
)
{
if
(
category
==
Copies
.
class
)
{
if
(
defCopies
>
0
)
{
if
(
defCopies
>
0
)
{
...
@@ -1049,11 +1053,10 @@ public class Win32PrintService implements PrintService, AttributeUpdater,
...
@@ -1049,11 +1053,10 @@ public class Win32PrintService implements PrintService, AttributeUpdater,
return
new
Copies
(
1
);
return
new
Copies
(
1
);
}
}
}
else
if
(
category
==
Chromaticity
.
class
)
{
}
else
if
(
category
==
Chromaticity
.
class
)
{
int
caps
=
getPrinterCapabilities
();
if
(
defColor
==
DMCOLOR_COLOR
)
{
if
((
caps
&
DEVCAP_COLOR
)
==
0
)
{
return
Chromaticity
.
MONOCHROME
;
}
else
{
return
Chromaticity
.
COLOR
;
return
Chromaticity
.
COLOR
;
}
else
{
return
Chromaticity
.
MONOCHROME
;
}
}
}
else
if
(
category
==
JobName
.
class
)
{
}
else
if
(
category
==
JobName
.
class
)
{
return
new
JobName
(
"Java Printing"
,
null
);
return
new
JobName
(
"Java Printing"
,
null
);
...
...
src/windows/native/sun/windows/WPrinterJob.cpp
浏览文件 @
7f94d1c9
...
@@ -750,7 +750,7 @@ Java_sun_print_Win32PrintService_getCapabilities(JNIEnv *env,
...
@@ -750,7 +750,7 @@ Java_sun_print_Win32PrintService_getCapabilities(JNIEnv *env,
#define GETDEFAULT_ERROR -50
#define GETDEFAULT_ERROR -50
#define NDEFAULT
8
#define NDEFAULT
9
JNIEXPORT
jintArray
JNICALL
JNIEXPORT
jintArray
JNICALL
Java_sun_print_Win32PrintService_getDefaultSettings
(
JNIEnv
*
env
,
Java_sun_print_Win32PrintService_getDefaultSettings
(
JNIEnv
*
env
,
...
@@ -859,6 +859,11 @@ Java_sun_print_Win32PrintService_getDefaultSettings(JNIEnv *env,
...
@@ -859,6 +859,11 @@ Java_sun_print_Win32PrintService_getDefaultSettings(JNIEnv *env,
defIndices
[
7
]
=
pDevMode
->
dmCollate
;
defIndices
[
7
]
=
pDevMode
->
dmCollate
;
}
}
if
(
pDevMode
->
dmFields
&
DM_COLOR
)
{
defIndices
[
8
]
=
pDevMode
->
dmColor
;
}
GlobalFree
(
pDevMode
);
GlobalFree
(
pDevMode
);
::
ClosePrinter
(
hPrinter
);
::
ClosePrinter
(
hPrinter
);
...
...
src/windows/native/sun/windows/awt_Frame.cpp
浏览文件 @
7f94d1c9
...
@@ -380,9 +380,11 @@ LRESULT AwtFrame::ProxyWindowProc(UINT message, WPARAM wParam, LPARAM lParam, Ms
...
@@ -380,9 +380,11 @@ LRESULT AwtFrame::ProxyWindowProc(UINT message, WPARAM wParam, LPARAM lParam, Ms
if
(
!
sm_suppressFocusAndActivation
)
{
if
(
!
sm_suppressFocusAndActivation
)
{
if
(
IsLightweightFrame
()
||
IsEmbeddedFrame
())
{
if
(
IsLightweightFrame
()
||
IsEmbeddedFrame
())
{
HWND
oppositeToplevelHWnd
=
AwtComponent
::
GetTopLevelParentForWindow
((
HWND
)
wParam
);
if
(
oppositeToplevelHWnd
!=
AwtComponent
::
GetFocusedWindow
())
{
AwtWindow
::
SynthesizeWmActivate
(
FALSE
,
GetHWnd
(),
NULL
);
AwtWindow
::
SynthesizeWmActivate
(
FALSE
,
GetHWnd
(),
NULL
);
}
}
}
}
else
if
(
sm_restoreFocusAndActivation
)
{
}
else
if
(
sm_restoreFocusAndActivation
)
{
if
(
AwtComponent
::
GetFocusedWindow
()
!=
NULL
)
{
if
(
AwtComponent
::
GetFocusedWindow
()
!=
NULL
)
{
AwtWindow
*
focusedWindow
=
(
AwtWindow
*
)
GetComponent
(
AwtComponent
::
GetFocusedWindow
());
AwtWindow
*
focusedWindow
=
(
AwtWindow
*
)
GetComponent
(
AwtComponent
::
GetFocusedWindow
());
...
...
src/windows/native/sun/windows/awt_PrintControl.cpp
浏览文件 @
7f94d1c9
...
@@ -252,7 +252,7 @@ void AwtPrintControl::initIDs(JNIEnv *env, jclass cls)
...
@@ -252,7 +252,7 @@ void AwtPrintControl::initIDs(JNIEnv *env, jclass cls)
AwtPrintControl
::
getCopiesID
=
AwtPrintControl
::
getCopiesID
=
env
->
GetMethodID
(
cls
,
"getCopiesAttrib"
,
"()I"
);
env
->
GetMethodID
(
cls
,
"getCopiesAttrib"
,
"()I"
);
AwtPrintControl
::
getCollateID
=
AwtPrintControl
::
getCollateID
=
env
->
GetMethodID
(
cls
,
"getCollateAttrib"
,
"()
Z
"
);
env
->
GetMethodID
(
cls
,
"getCollateAttrib"
,
"()
I
"
);
AwtPrintControl
::
getOrientID
=
AwtPrintControl
::
getOrientID
=
env
->
GetMethodID
(
cls
,
"getOrientAttrib"
,
"()I"
);
env
->
GetMethodID
(
cls
,
"getOrientAttrib"
,
"()I"
);
AwtPrintControl
::
getFromPageID
=
AwtPrintControl
::
getFromPageID
=
...
@@ -690,12 +690,6 @@ BOOL AwtPrintControl::InitPrintDialog(JNIEnv *env,
...
@@ -690,12 +690,6 @@ BOOL AwtPrintControl::InitPrintDialog(JNIEnv *env,
pd
.
Flags
=
PD_ENABLEPRINTHOOK
|
PD_RETURNDC
|
PD_USEDEVMODECOPIESANDCOLLATE
;
pd
.
Flags
=
PD_ENABLEPRINTHOOK
|
PD_RETURNDC
|
PD_USEDEVMODECOPIESANDCOLLATE
;
pd
.
lpfnPrintHook
=
(
LPPRINTHOOKPROC
)
PrintDlgHook
;
pd
.
lpfnPrintHook
=
(
LPPRINTHOOKPROC
)
PrintDlgHook
;
if
(
env
->
CallBooleanMethod
(
printCtrl
,
AwtPrintControl
::
getCollateID
))
{
pd
.
Flags
|=
PD_COLLATE
;
}
pd
.
nCopies
=
(
WORD
)
env
->
CallIntMethod
(
printCtrl
,
AwtPrintControl
::
getCopiesID
);
pd
.
nFromPage
=
(
WORD
)
env
->
CallIntMethod
(
printCtrl
,
pd
.
nFromPage
=
(
WORD
)
env
->
CallIntMethod
(
printCtrl
,
AwtPrintControl
::
getFromPageID
);
AwtPrintControl
::
getFromPageID
);
pd
.
nToPage
=
(
WORD
)
env
->
CallIntMethod
(
printCtrl
,
pd
.
nToPage
=
(
WORD
)
env
->
CallIntMethod
(
printCtrl
,
...
@@ -729,37 +723,52 @@ BOOL AwtPrintControl::InitPrintDialog(JNIEnv *env,
...
@@ -729,37 +723,52 @@ BOOL AwtPrintControl::InitPrintDialog(JNIEnv *env,
DEVMODE
*
devmode
=
(
DEVMODE
*
)
::
GlobalLock
(
pd
.
hDevMode
);
DEVMODE
*
devmode
=
(
DEVMODE
*
)
::
GlobalLock
(
pd
.
hDevMode
);
DASSERT
(
!
IsBadWritePtr
(
devmode
,
sizeof
(
DEVMODE
)));
DASSERT
(
!
IsBadWritePtr
(
devmode
,
sizeof
(
DEVMODE
)));
devmode
->
dmFields
|=
DM_COPIES
|
DM_COLLATE
|
DM_ORIENTATION
|
WORD
copies
=
(
WORD
)
env
->
CallIntMethod
(
printCtrl
,
DM_PAPERSIZE
|
DM_PRINTQUALITY
|
DM_COLOR
|
DM_DUPLEX
;
AwtPrintControl
::
getCopiesID
);
if
(
copies
>
0
)
{
devmode
->
dmCopies
=
pd
.
nCopies
;
devmode
->
dmFields
|=
DM_COPIES
;
devmode
->
dmCopies
=
copies
;
}
jint
orient
=
env
->
CallIntMethod
(
printCtrl
,
jint
orient
=
env
->
CallIntMethod
(
printCtrl
,
AwtPrintControl
::
getOrientID
);
AwtPrintControl
::
getOrientID
);
if
(
orient
==
0
)
{
if
(
orient
==
0
)
{
// PageFormat.LANDSCAPE == 0
devmode
->
dmFields
|=
DM_ORIENTATION
;
devmode
->
dmOrientation
=
DMORIENT_LANDSCAPE
;
devmode
->
dmOrientation
=
DMORIENT_LANDSCAPE
;
}
else
if
(
orient
==
1
)
{
}
else
if
(
orient
==
1
)
{
// PageFormat.PORTRAIT == 1
devmode
->
dmFields
|=
DM_ORIENTATION
;
devmode
->
dmOrientation
=
DMORIENT_PORTRAIT
;
devmode
->
dmOrientation
=
DMORIENT_PORTRAIT
;
}
}
devmode
->
dmCollate
=
(
pd
.
Flags
&
PD_COLLATE
)
?
DMCOLLATE_TRUE
// -1 means unset, so we'll accept the printer default.
:
DMCOLLATE_FALSE
;
int
collate
=
env
->
CallIntMethod
(
printCtrl
,
AwtPrintControl
::
getCollateID
);
if
(
collate
==
1
)
{
devmode
->
dmFields
|=
DM_COLLATE
;
devmode
->
dmCollate
=
DMCOLLATE_TRUE
;
}
else
if
(
collate
==
0
)
{
devmode
->
dmFields
|=
DM_COLLATE
;
devmode
->
dmCollate
=
DMCOLLATE_FALSE
;
}
int
quality
=
env
->
CallIntMethod
(
printCtrl
,
int
quality
=
env
->
CallIntMethod
(
printCtrl
,
AwtPrintControl
::
getQualityID
);
AwtPrintControl
::
getQualityID
);
if
(
quality
)
{
if
(
quality
)
{
devmode
->
dmFields
|=
DM_PRINTQUALITY
;
devmode
->
dmPrintQuality
=
quality
;
devmode
->
dmPrintQuality
=
quality
;
}
}
int
color
=
env
->
CallIntMethod
(
printCtrl
,
int
color
=
env
->
CallIntMethod
(
printCtrl
,
AwtPrintControl
::
getColorID
);
AwtPrintControl
::
getColorID
);
if
(
color
)
{
if
(
color
)
{
devmode
->
dmFields
|=
DM_COLOR
;
devmode
->
dmColor
=
color
;
devmode
->
dmColor
=
color
;
}
}
int
sides
=
env
->
CallIntMethod
(
printCtrl
,
int
sides
=
env
->
CallIntMethod
(
printCtrl
,
AwtPrintControl
::
getSidesID
);
AwtPrintControl
::
getSidesID
);
if
(
sides
)
{
if
(
sides
)
{
devmode
->
dmFields
|=
DM_DUPLEX
;
devmode
->
dmDuplex
=
(
int
)
sides
;
devmode
->
dmDuplex
=
(
int
)
sides
;
}
}
...
@@ -771,6 +780,7 @@ BOOL AwtPrintControl::InitPrintDialog(JNIEnv *env,
...
@@ -771,6 +780,7 @@ BOOL AwtPrintControl::InitPrintDialog(JNIEnv *env,
double
newWid
=
0.0
,
newHt
=
0.0
;
double
newWid
=
0.0
,
newHt
=
0.0
;
if
(
wid_ht
!=
NULL
&&
wid_ht
[
0
]
!=
0
&&
wid_ht
[
1
]
!=
0
)
{
if
(
wid_ht
!=
NULL
&&
wid_ht
[
0
]
!=
0
&&
wid_ht
[
1
]
!=
0
)
{
devmode
->
dmFields
|=
DM_PAPERSIZE
;
devmode
->
dmPaperSize
=
AwtPrintControl
::
getNearestMatchingPaper
(
devmode
->
dmPaperSize
=
AwtPrintControl
::
getNearestMatchingPaper
(
printName
,
printName
,
portName
,
portName
,
...
...
test/com/sun/java/swing/plaf/gtk/4928019/bug4928019.java
0 → 100644
浏览文件 @
7f94d1c9
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* 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 4928019
* @summary Makes sure all the basic classes can be created with GTK.
* @author Scott Violet
*/
import
javax.swing.*
;
import
javax.swing.plaf.basic.*
;
public
class
bug4928019
{
public
static
void
main
(
String
[]
args
)
throws
Throwable
{
try
{
UIManager
.
setLookAndFeel
(
"com.sun.java.swing.plaf.gtk.GTKLookAndFeel"
);
}
catch
(
UnsupportedLookAndFeelException
ex
)
{
System
.
err
.
println
(
"GTKLookAndFeel is not supported on this platform."
+
" Test is considered passed."
);
return
;
}
catch
(
ClassNotFoundException
ex
)
{
System
.
err
.
println
(
"GTKLookAndFeel class is not found."
+
" Test is considered passed."
);
return
;
}
new
JButton
()
{
public
void
updateUI
()
{
setUI
(
new
BasicButtonUI
());
}
};
new
JCheckBox
()
{
public
void
updateUI
()
{
setUI
(
new
BasicCheckBoxUI
());
}
};
new
JCheckBoxMenuItem
()
{
public
void
updateUI
()
{
setUI
(
new
BasicCheckBoxMenuItemUI
());
}
};
new
JColorChooser
()
{
public
void
updateUI
()
{
setUI
(
new
BasicColorChooserUI
());
}
};
new
JComboBox
()
{
public
void
updateUI
()
{
setUI
(
new
BasicComboBoxUI
());
}
};
new
JDesktopPane
()
{
public
void
updateUI
()
{
setUI
(
new
BasicDesktopPaneUI
());
}
};
new
JEditorPane
()
{
public
void
updateUI
()
{
setUI
(
new
BasicEditorPaneUI
());
}
};
new
JFileChooser
()
{
public
void
updateUI
()
{
setUI
(
new
BasicFileChooserUI
(
null
));
}
};
new
JFormattedTextField
()
{
public
void
updateUI
()
{
setUI
(
new
BasicFormattedTextFieldUI
());
}
};
new
JInternalFrame
()
{
public
void
updateUI
()
{
setUI
(
new
BasicInternalFrameUI
(
null
));
}
};
new
JLabel
()
{
public
void
updateUI
()
{
setUI
(
new
BasicLabelUI
());
}
};
new
JList
()
{
public
void
updateUI
()
{
setUI
(
new
BasicListUI
());
}
};
new
JMenuBar
()
{
public
void
updateUI
()
{
setUI
(
new
BasicMenuBarUI
());
}
};
new
JMenuItem
()
{
public
void
updateUI
()
{
setUI
(
new
BasicMenuItemUI
());
}
};
new
JMenu
()
{
public
void
updateUI
()
{
setUI
(
new
BasicMenuUI
());
}
};
new
JOptionPane
()
{
public
void
updateUI
()
{
setUI
(
new
BasicOptionPaneUI
());
}
};
new
JPanel
()
{
public
void
updateUI
()
{
setUI
(
new
BasicPanelUI
());
}
};
new
JPasswordField
()
{
public
void
updateUI
()
{
setUI
(
new
BasicPasswordFieldUI
());
}
};
new
JPopupMenu
()
{
public
void
updateUI
()
{
setUI
(
new
BasicPopupMenuUI
());
}
};
new
JProgressBar
()
{
public
void
updateUI
()
{
setUI
(
new
BasicProgressBarUI
());
}
};
new
JRadioButton
()
{
public
void
updateUI
()
{
setUI
(
new
BasicRadioButtonUI
());
}
};
new
JRadioButtonMenuItem
()
{
public
void
updateUI
()
{
setUI
(
new
BasicRadioButtonMenuItemUI
());
}
};
new
JRootPane
()
{
public
void
updateUI
()
{
setUI
(
new
BasicRootPaneUI
());
}
};
new
JScrollBar
()
{
public
void
updateUI
()
{
setUI
(
new
BasicScrollBarUI
());
}
};
new
JScrollPane
()
{
public
void
updateUI
()
{
setUI
(
new
BasicScrollPaneUI
());
}
};
new
JSeparator
()
{
public
void
updateUI
()
{
setUI
(
new
BasicSeparatorUI
());
}
};
new
JSlider
()
{
public
void
updateUI
()
{
setUI
(
new
BasicSliderUI
(
null
));
}
};
new
JSpinner
()
{
public
void
updateUI
()
{
setUI
(
new
BasicSpinnerUI
());
}
};
new
JSplitPane
()
{
public
void
updateUI
()
{
setUI
(
new
BasicSplitPaneUI
());
}
};
new
JTabbedPane
()
{
public
void
updateUI
()
{
setUI
(
new
BasicTabbedPaneUI
());
}
};
new
JTable
()
{
public
void
updateUI
()
{
setUI
(
new
BasicTableUI
());
}
};
new
JTextArea
()
{
public
void
updateUI
()
{
setUI
(
new
BasicTextAreaUI
());
}
};
new
JTextField
()
{
public
void
updateUI
()
{
setUI
(
new
BasicTextFieldUI
());
}
};
new
JTextPane
()
{
public
void
updateUI
()
{
setUI
(
new
BasicTextPaneUI
());
}
};
new
JToggleButton
()
{
public
void
updateUI
()
{
setUI
(
new
BasicToggleButtonUI
());
}
};
new
JToolBar
()
{
public
void
updateUI
()
{
setUI
(
new
BasicToolBarUI
());
}
};
new
JToolTip
()
{
public
void
updateUI
()
{
setUI
(
new
BasicToolTipUI
());
}
};
new
JTree
()
{
public
void
updateUI
()
{
setUI
(
new
BasicTreeUI
());
}
};
new
JViewport
()
{
public
void
updateUI
()
{
setUI
(
new
BasicViewportUI
());
}
};
System
.
out
.
println
(
"DONE"
);
}
}
test/java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.html
浏览文件 @
7f94d1c9
<html>
<html>
<!--
<!--
@test
@test
@bug 8005932
@bug 8005932
@summary Java 7 on mac os x only provides text clipboard formats
@summary Java 7 on mac os x only provides text clipboard formats
...
@@ -9,10 +8,9 @@
...
@@ -9,10 +8,9 @@
@library ../../regtesthelpers/process
@library ../../regtesthelpers/process
@build Util
@build Util
@build ProcessResults ProcessCommunicator
@build ProcessResults ProcessCommunicator
@run applet/othervm MissedHtmlAndRtfBug.html
@run applet/othervm MissedHtmlAndRtfBug.html
*/>
-->
<head>
<head>
<title>
Java 7 on mac os x only provides text clipboard formats
</title>
<title>
Java 7 on mac os x only provides text clipboard formats
</title>
</head>
</head>
...
...
test/java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.java
浏览文件 @
7f94d1c9
...
@@ -22,7 +22,6 @@
...
@@ -22,7 +22,6 @@
*/
*/
/*
/*
@test
@bug 8005932
@bug 8005932
@summary Java 7 on mac os x only provides text clipboard formats
@summary Java 7 on mac os x only provides text clipboard formats
@author mikhail.cherkasov@oracle.com
@author mikhail.cherkasov@oracle.com
...
@@ -30,10 +29,9 @@
...
@@ -30,10 +29,9 @@
@library ../../regtesthelpers/process
@library ../../regtesthelpers/process
@build Util
@build Util
@build ProcessResults ProcessCommunicator
@build ProcessResults ProcessCommunicator
@run applet/othervm MissedHtmlAndRtfBug.html
@run applet/othervm MissedHtmlAndRtfBug.html
*/
*/
import
java.awt.*
;
import
java.awt.*
;
import
java.awt.datatransfer.DataFlavor
;
import
java.awt.datatransfer.DataFlavor
;
import
java.awt.event.*
;
import
java.awt.event.*
;
...
...
test/java/awt/Focus/TypeAhead/TestFocusFreeze.java
浏览文件 @
7f94d1c9
...
@@ -132,6 +132,7 @@ class TestKFM extends DefaultKeyboardFocusManager {
...
@@ -132,6 +132,7 @@ class TestKFM extends DefaultKeyboardFocusManager {
}
}
protected
synchronized
void
enqueueKeyEvents
(
long
after
,
Component
untilFocused
)
{
protected
synchronized
void
enqueueKeyEvents
(
long
after
,
Component
untilFocused
)
{
super
.
enqueueKeyEvents
(
after
,
untilFocused
);
super
.
enqueueKeyEvents
(
after
,
untilFocused
);
robot
.
delay
(
1
);
robot
.
keyPress
(
KeyEvent
.
VK_SPACE
);
robot
.
keyPress
(
KeyEvent
.
VK_SPACE
);
robot
.
delay
(
50
);
robot
.
delay
(
50
);
robot
.
keyRelease
(
KeyEvent
.
VK_SPACE
);
robot
.
keyRelease
(
KeyEvent
.
VK_SPACE
);
...
...
test/java/awt/GraphicsDevice/CheckDisplayModes.java
浏览文件 @
7f94d1c9
...
@@ -37,6 +37,10 @@ public class CheckDisplayModes {
...
@@ -37,6 +37,10 @@ public class CheckDisplayModes {
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
GraphicsEnvironment
ge
=
GraphicsEnvironment
.
getLocalGraphicsEnvironment
();
GraphicsEnvironment
ge
=
GraphicsEnvironment
.
getLocalGraphicsEnvironment
();
GraphicsDevice
graphicDevice
=
ge
.
getDefaultScreenDevice
();
GraphicsDevice
graphicDevice
=
ge
.
getDefaultScreenDevice
();
if
(!
graphicDevice
.
isDisplayChangeSupported
())
{
System
.
err
.
println
(
"Display mode change is not supported on this host. Test is considered passed."
);
return
;
}
DisplayMode
defaultDisplayMode
=
graphicDevice
.
getDisplayMode
();
DisplayMode
defaultDisplayMode
=
graphicDevice
.
getDisplayMode
();
checkDisplayMode
(
defaultDisplayMode
);
checkDisplayMode
(
defaultDisplayMode
);
graphicDevice
.
setDisplayMode
(
defaultDisplayMode
);
graphicDevice
.
setDisplayMode
(
defaultDisplayMode
);
...
...
test/java/awt/Mixing/MixingInHwPanel.java
浏览文件 @
7f94d1c9
/*
/*
* Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009,
2013,
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
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
*/
*/
/*
/*
@test
%W% %E%
@test
@bug 6829858
@bug 6829858
@summary Mixing should work inside heavyweight containers
@summary Mixing should work inside heavyweight containers
@author anthony.petrov@sun.com: area=awt.mixing
@author anthony.petrov@sun.com: area=awt.mixing
...
@@ -104,7 +104,7 @@ public class MixingInHwPanel
...
@@ -104,7 +104,7 @@ public class MixingInHwPanel
// And click the part of the button that has been previously hidden
// And click the part of the button that has been previously hidden
Point
bLoc
=
button
.
getLocationOnScreen
();
Point
bLoc
=
button
.
getLocationOnScreen
();
robot
.
mouseMove
(
bLoc
.
x
+
button
.
getWidth
()
-
6
,
bLoc
.
y
+
button
.
getHeight
()
/
2
);
robot
.
mouseMove
(
bLoc
.
x
+
button
.
getWidth
()
-
15
,
bLoc
.
y
+
button
.
getHeight
()
/
2
);
Util
.
waitForIdle
(
robot
);
Util
.
waitForIdle
(
robot
);
...
...
test/java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java
0 → 100644
浏览文件 @
7f94d1c9
/*
* Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* 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.
*/
import
sun.misc.OSEnvironment
;
import
test.java.awt.regtesthelpers.Util
;
import
javax.swing.*
;
import
java.awt.*
;
import
java.awt.event.InputEvent
;
import
java.awt.event.MouseAdapter
;
import
java.awt.event.MouseEvent
;
import
java.lang.reflect.InvocationHandler
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Proxy
;
/*
* @test
* @bug 8013468
* @summary Cursor does not update properly when in fullscreen mode on Mac
* The core reason of the issue was the lack of a mouse entered event in fullscreen
* @library ../../regtesthelpers
* @build Util
* @author Petr Pchelko area=awt.event
* @run main FullscreenEnterEventTest
*/
public
class
FullscreenEnterEventTest
{
private
static
String
OS
=
System
.
getProperty
(
"os.name"
).
toLowerCase
();
private
static
JFrame
frame
;
private
static
volatile
int
mouseEnterCount
=
0
;
private
static
volatile
boolean
windowEnteringFullScreen
=
false
;
private
static
volatile
boolean
windowEnteredFullScreen
=
false
;
public
static
void
main
(
String
[]
args
)
throws
Exception
{
if
(!
OS
.
contains
(
"mac"
))
{
System
.
out
.
println
(
"The test is applicable only to Mac OS X. Passed"
);
return
;
}
SwingUtilities
.
invokeAndWait
(
new
Runnable
()
{
@Override
public
void
run
()
{
createAndShowGUI
();
}
});
//Move the mouse away from the frame and check the View-base full screen mode
Robot
r
=
Util
.
createRobot
();
Util
.
waitForIdle
(
r
);
r
.
mouseMove
(
500
,
500
);
Util
.
waitForIdle
(
r
);
mouseEnterCount
=
0
;
SwingUtilities
.
invokeAndWait
(
new
Runnable
()
{
@Override
public
void
run
()
{
GraphicsEnvironment
.
getLocalGraphicsEnvironment
().
getDefaultScreenDevice
().
setFullScreenWindow
(
frame
);
}
});
Util
.
waitForIdle
(
r
);
if
(
mouseEnterCount
!=
1
)
{
throw
new
RuntimeException
(
"No MouseEntered event for view-base full screen. Failed."
);
}
SwingUtilities
.
invokeAndWait
(
new
Runnable
()
{
@Override
public
void
run
()
{
GraphicsEnvironment
.
getLocalGraphicsEnvironment
().
getDefaultScreenDevice
().
setFullScreenWindow
(
null
);
}
});
//Test native full screen support
Point
fullScreenButtonPos
=
frame
.
getLocation
();
fullScreenButtonPos
.
translate
(
frame
.
getWidth
()
-
10
,
10
);
r
.
mouseMove
(
fullScreenButtonPos
.
x
,
fullScreenButtonPos
.
y
);
mouseEnterCount
=
0
;
//Cant use waitForIdle for full screen transition.
int
waitCount
=
0
;
while
(!
windowEnteringFullScreen
)
{
r
.
mousePress
(
InputEvent
.
BUTTON1_MASK
);
r
.
mouseRelease
(
InputEvent
.
BUTTON1_MASK
);
Thread
.
sleep
(
100
);
if
(
waitCount
++
>
10
)
throw
new
RuntimeException
(
"Can't enter full screen mode. Failed"
);
}
waitCount
=
0
;
while
(!
windowEnteredFullScreen
)
{
Thread
.
sleep
(
200
);
if
(
waitCount
++
>
10
)
throw
new
RuntimeException
(
"Can't enter full screen mode. Failed"
);
}
if
(
mouseEnterCount
!=
1
)
{
throw
new
RuntimeException
(
"No MouseEntered event for native full screen. Failed."
);
}
}
private
static
void
createAndShowGUI
()
{
frame
=
new
JFrame
(
" Fullscreen OSX Bug "
);
frame
.
setDefaultCloseOperation
(
JFrame
.
EXIT_ON_CLOSE
);
enableFullScreen
(
frame
);
frame
.
addMouseListener
(
new
MouseAdapter
()
{
@Override
public
void
mouseEntered
(
MouseEvent
e
)
{
mouseEnterCount
++;
}
});
frame
.
setBounds
(
100
,
100
,
100
,
100
);
frame
.
pack
();
frame
.
setVisible
(
true
);
}
/*
* Use reflection to make a test compilable on not Mac OS X
*/
private
static
void
enableFullScreen
(
Window
window
)
{
try
{
Class
fullScreenUtilities
=
Class
.
forName
(
"com.apple.eawt.FullScreenUtilities"
);
Method
setWindowCanFullScreen
=
fullScreenUtilities
.
getMethod
(
"setWindowCanFullScreen"
,
Window
.
class
,
boolean
.
class
);
setWindowCanFullScreen
.
invoke
(
fullScreenUtilities
,
window
,
true
);
Class
fullScreenListener
=
Class
.
forName
(
"com.apple.eawt.FullScreenListener"
);
Object
listenerObject
=
Proxy
.
newProxyInstance
(
fullScreenListener
.
getClassLoader
(),
new
Class
[]{
fullScreenListener
},
new
InvocationHandler
()
{
@Override
public
Object
invoke
(
Object
proxy
,
Method
method
,
Object
[]
args
)
throws
Throwable
{
switch
(
method
.
getName
())
{
case
"windowEnteringFullScreen"
:
windowEnteringFullScreen
=
true
;
break
;
case
"windowEnteredFullScreen"
:
windowEnteredFullScreen
=
true
;
break
;
}
return
null
;
}
});
Method
addFullScreenListener
=
fullScreenUtilities
.
getMethod
(
"addFullScreenListenerTo"
,
Window
.
class
,
fullScreenListener
);
addFullScreenListener
.
invoke
(
fullScreenUtilities
,
window
,
listenerObject
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"FullScreen utilities not available"
,
e
);
}
}
}
test/java/awt/event/KeyEvent/KeyReleasedInAppletTest/KeyReleasedInAppletTest.java
浏览文件 @
7f94d1c9
...
@@ -39,7 +39,6 @@ import java.lang.Throwable;
...
@@ -39,7 +39,6 @@ import java.lang.Throwable;
import
java.util.Hashtable
;
import
java.util.Hashtable
;
/*
/*
@test
@bug 8010009
@bug 8010009
@summary [macosx] Unable type into online word games on MacOSX
@summary [macosx] Unable type into online word games on MacOSX
@author petr.pchelko : area=awt.keyboard
@author petr.pchelko : area=awt.keyboard
...
...
test/java/awt/font/TextLayout/KerningLeak.java
0 → 100644
浏览文件 @
7f94d1c9
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* 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.
*/
/**
* @bug 8015334
* @summary Memory leak with kerning.
*/
import
java.awt.EventQueue
;
import
java.awt.Font
;
import
java.awt.FontMetrics
;
import
java.awt.font.TextAttribute
;
import
java.util.HashMap
;
import
java.util.Map
;
import
javax.swing.JLabel
;
import
javax.swing.SwingUtilities
;
public
class
KerningLeak
{
public
static
void
main
(
String
[]
args
)
{
EventQueue
.
invokeLater
(
new
Runnable
()
{
@Override
public
void
run
()
{
leak
();
}
});
}
private
static
void
leak
()
{
Map
<
TextAttribute
,
Object
>
textAttributes
=
new
HashMap
<>();
textAttributes
.
put
(
TextAttribute
.
FAMILY
,
"Sans Serif"
);
textAttributes
.
put
(
TextAttribute
.
SIZE
,
12
);
textAttributes
.
put
(
TextAttribute
.
KERNING
,
TextAttribute
.
KERNING_ON
);
Font
font
=
Font
.
getFont
(
textAttributes
);
JLabel
label
=
new
JLabel
();
int
dummy
=
0
;
for
(
int
i
=
0
;
i
<
500
;
i
++)
{
if
(
i
%
10
==
0
)
System
.
out
.
println
(
"Starting iter "
+
(
i
+
1
));
for
(
int
j
=
0
;
j
<
1000
;
j
++)
{
FontMetrics
fm
=
label
.
getFontMetrics
(
font
);
dummy
+=
SwingUtilities
.
computeStringWidth
(
fm
,
Integer
.
toString
(
j
));
}
}
System
.
out
.
println
(
"done "
+
dummy
);
}
}
test/java/lang/management/MXBean/MXBeanBehavior.java
浏览文件 @
7f94d1c9
/*
/*
* Copyright (c) 2005, 2013 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2013
,
Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* 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
...
...
test/java/lang/management/ManagementFactory/MBeanServerMXBeanUnsupportedTest.java
浏览文件 @
7f94d1c9
/*
/*
* Copyright (c) 2006, 2013 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2013
,
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
...
...
test/javax/print/PrintServiceLookup/GetPrintServices.java
0 → 100644
浏览文件 @
7f94d1c9
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* 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.
*/
import
javax.print.PrintService
;
import
javax.print.PrintServiceLookup
;
import
javax.print.attribute.AttributeSet
;
import
javax.print.attribute.HashAttributeSet
;
import
javax.print.attribute.standard.PrinterName
;
/*
* @test
* @bug 8013810
* @summary Test that print service returned without filter are of the same class as with name filter
*/
public
class
GetPrintServices
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
for
(
PrintService
service
:
PrintServiceLookup
.
lookupPrintServices
(
null
,
null
))
{
String
serviceName
=
service
.
getName
();
PrintService
serviceByName
=
lookupByName
(
serviceName
);
if
(!
service
.
equals
(
serviceByName
))
{
throw
new
RuntimeException
(
"NOK "
+
serviceName
+
" expected: "
+
service
.
getClass
().
getName
()
+
" got: "
+
serviceByName
.
getClass
().
getName
());
}
}
System
.
out
.
println
(
"Test PASSED"
);
}
private
static
PrintService
lookupByName
(
String
name
)
{
AttributeSet
attributes
=
new
HashAttributeSet
();
attributes
.
add
(
new
PrinterName
(
name
,
null
));
for
(
PrintService
service
:
PrintServiceLookup
.
lookupPrintServices
(
null
,
attributes
))
{
return
service
;
}
return
null
;
}
}
test/javax/swing/JFileChooser/8013442/Test8013442.java
0 → 100644
浏览文件 @
7f94d1c9
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* 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 8013442
* @summary Tests that at least one file filter is selected
* @author Sergey Malenkov
*/
import
java.io.File
;
import
java.util.concurrent.CountDownLatch
;
import
javax.swing.JFileChooser
;
import
javax.swing.JFrame
;
import
javax.swing.SwingUtilities
;
import
javax.swing.UIManager
;
import
javax.swing.UIManager.LookAndFeelInfo
;
import
javax.swing.filechooser.FileFilter
;
public
class
Test8013442
extends
FileFilter
implements
Runnable
,
Thread
.
UncaughtExceptionHandler
{
private
static
final
CountDownLatch
LATCH
=
new
CountDownLatch
(
1
);
public
static
void
main
(
String
[]
args
)
throws
InterruptedException
{
SwingUtilities
.
invokeLater
(
new
Test8013442
());
LATCH
.
await
();
// workaround for jtreg
}
private
int
index
;
private
LookAndFeelInfo
[]
infos
;
private
JFileChooser
chooser
;
@Override
public
boolean
accept
(
File
file
)
{
return
!
file
.
isFile
()
||
file
.
getName
().
toLowerCase
().
endsWith
(
".txt"
);
}
@Override
public
String
getDescription
()
{
return
"Text files"
;
}
@Override
public
void
run
()
{
if
(
this
.
infos
==
null
)
{
this
.
infos
=
UIManager
.
getInstalledLookAndFeels
();
Thread
.
currentThread
().
setUncaughtExceptionHandler
(
this
);
}
if
(
this
.
infos
.
length
==
this
.
index
)
{
LATCH
.
countDown
();
// release main thread
}
else
if
(
this
.
chooser
==
null
)
{
// change LaF before creation of Swing components
LookAndFeelInfo
info
=
this
.
infos
[
this
.
index
];
System
.
out
.
println
(
info
.
getName
());
try
{
UIManager
.
setLookAndFeel
(
info
.
getClassName
());
}
catch
(
Exception
exception
)
{
throw
new
Error
(
"could not change look and feel"
,
exception
);
}
// create and show new file chooser
JFrame
frame
=
new
JFrame
(
getClass
().
getSimpleName
());
frame
.
add
(
this
.
chooser
=
new
JFileChooser
());
frame
.
setSize
(
800
,
600
);
frame
.
setLocationRelativeTo
(
null
);
frame
.
setVisible
(
true
);
SwingUtilities
.
invokeLater
(
this
);
}
else
{
int
count
=
this
.
chooser
.
getChoosableFileFilters
().
length
;
System
.
out
.
println
(
"count = "
+
count
+
"; "
+
this
.
chooser
.
isAcceptAllFileFilterUsed
());
if
(
count
==
0
)
{
if
(
null
!=
this
.
chooser
.
getFileFilter
())
{
throw
new
Error
(
"file filter is selected"
);
}
// close window and stop testing file chooser for current LaF
SwingUtilities
.
getWindowAncestor
(
this
.
chooser
).
dispose
();
this
.
chooser
=
null
;
this
.
index
++;
}
else
{
if
(
null
==
this
.
chooser
.
getFileFilter
())
{
throw
new
Error
(
"file filter is not selected"
);
}
if
(
count
==
2
)
{
// remove default file filter
this
.
chooser
.
setAcceptAllFileFilterUsed
(
false
);
}
else
if
(
this
.
chooser
.
isAcceptAllFileFilterUsed
())
{
// remove add file filter
this
.
chooser
.
addChoosableFileFilter
(
this
);
}
else
{
// remove custom file filter
this
.
chooser
.
removeChoosableFileFilter
(
this
);
}
}
SwingUtilities
.
invokeLater
(
this
);
}
}
public
void
uncaughtException
(
Thread
thread
,
Throwable
throwable
)
{
throwable
.
printStackTrace
();
System
.
exit
(
1
);
}
}
test/javax/swing/JMenu/4692443/bug4692443.java
0 → 100644
浏览文件 @
7f94d1c9
/*
* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* 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
* @library ../../regtesthelpers
* @build Util
* @bug 4692443 7105030
* @summary JMenu: MenuListener.menuSelected() event fired too late when using mnemonics
* @author Alexander Zuev
* @run main bug4692443
*/
import
javax.swing.*
;
import
javax.swing.event.*
;
import
java.awt.event.*
;
import
java.awt.*
;
import
sun.awt.SunToolkit
;
public
class
bug4692443
{
public
static
PassedListener
pass
;
public
static
FailedListener
fail
;
public
static
volatile
Boolean
passed
;
public
static
void
main
(
String
args
[])
throws
Throwable
{
fail
=
new
FailedListener
();
pass
=
new
PassedListener
();
passed
=
false
;
Robot
robo
=
new
Robot
();
SwingUtilities
.
invokeAndWait
(
new
Runnable
()
{
public
void
run
()
{
createAndShowGUI
();
}
});
SunToolkit
toolkit
=
(
SunToolkit
)
Toolkit
.
getDefaultToolkit
();
toolkit
.
realSync
();
try
{
robo
=
new
Robot
();
}
catch
(
AWTException
e
)
{
throw
new
RuntimeException
(
"Robot could not be created"
);
}
int
altKey
=
java
.
awt
.
event
.
KeyEvent
.
VK_ALT
;
robo
.
setAutoDelay
(
100
);
Util
.
hitMnemonics
(
robo
,
KeyEvent
.
VK_F
);
// Enter File menu
robo
.
keyPress
(
KeyEvent
.
VK_S
);
// Enter submenu
robo
.
keyRelease
(
KeyEvent
.
VK_S
);
robo
.
keyPress
(
KeyEvent
.
VK_O
);
// Launch "One" action
robo
.
keyRelease
(
KeyEvent
.
VK_O
);
robo
.
keyPress
(
KeyEvent
.
VK_M
);
// Launch "One" action
robo
.
keyRelease
(
KeyEvent
.
VK_M
);
toolkit
.
realSync
();
if
(!
passed
)
{
throw
new
RuntimeException
(
"Test failed."
);
}
}
private
static
void
createAndShowGUI
()
{
JFrame
mainFrame
=
new
JFrame
(
"Bug 4692443"
);
JMenuBar
mbar
=
new
JMenuBar
();
JMenu
menu
=
new
JMenu
(
"File"
);
menu
.
setMnemonic
(
'F'
);
menu
.
add
(
new
JMenuItem
(
"Menu Item 1"
)).
setMnemonic
(
'I'
);
final
JMenu
submenu
=
new
JMenu
(
"Submenu"
);
submenu
.
setMnemonic
(
'S'
);
submenu
.
addMenuListener
(
new
MenuListener
()
{
public
void
menuSelected
(
MenuEvent
e
)
{
JMenuItem
item
=
submenu
.
add
(
new
JMenuItem
(
"One"
,
'O'
));
item
.
addActionListener
(
pass
);
submenu
.
add
(
new
JMenuItem
(
"Two"
,
'w'
));
submenu
.
add
(
new
JMenuItem
(
"Three"
,
'r'
));
}
public
void
menuDeselected
(
MenuEvent
e
)
{
submenu
.
removeAll
();
}
public
void
menuCanceled
(
MenuEvent
e
)
{
submenu
.
removeAll
();
}
});
menu
.
add
(
submenu
);
JMenuItem
menuItem
=
menu
.
add
(
new
JMenuItem
(
"Menu Item 2"
));
menuItem
.
setMnemonic
(
'M'
);
menuItem
.
addActionListener
(
fail
);
mbar
.
add
(
menu
);
mainFrame
.
setJMenuBar
(
mbar
);
mainFrame
.
setSize
(
200
,
200
);
mainFrame
.
setLocation
(
200
,
200
);
mainFrame
.
setVisible
(
true
);
mainFrame
.
toFront
();
}
public
static
class
FailedListener
implements
ActionListener
{
public
void
actionPerformed
(
ActionEvent
ev
)
{
throw
new
RuntimeException
(
"Test failed."
);
}
}
public
static
class
PassedListener
implements
ActionListener
{
public
void
actionPerformed
(
ActionEvent
ev
)
{
passed
=
true
;
}
}
}
test/javax/swing/JTree/8013571/Test8013571.java
0 → 100644
浏览文件 @
7f94d1c9
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* 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.
*/
import
javax.swing.JTree
;
import
javax.swing.tree.DefaultMutableTreeNode
;
import
javax.swing.tree.DefaultTreeModel
;
/*
* @test
* @bug 8016545
* @summary Tests beans with public fields
* @author Sergey Malenkov
*/
public
class
Test8013571
extends
DefaultTreeModel
{
public
static
void
main
(
String
[]
args
)
{
DefaultMutableTreeNode
root
=
create
(
"root"
);
root
.
add
(
create
(
"colors"
,
"blue"
,
"violet"
,
"red"
,
"yellow"
));
root
.
add
(
create
(
"sports"
,
"basketball"
,
"soccer"
,
"football"
,
"hockey"
));
root
.
add
(
create
(
"food"
,
"hot dogs"
,
"pizza"
,
"ravioli"
,
"bananas"
));
Test8013571
model
=
new
Test8013571
(
root
);
JTree
tree
=
new
JTree
(
model
);
model
.
fireTreeChanged
(
tree
);
}
private
static
DefaultMutableTreeNode
create
(
String
name
,
String
...
values
)
{
DefaultMutableTreeNode
node
=
new
DefaultMutableTreeNode
(
name
);
for
(
String
value
:
values
)
{
node
.
add
(
create
(
value
));
}
return
node
;
}
private
Test8013571
(
DefaultMutableTreeNode
root
)
{
super
(
root
);
}
private
void
fireTreeChanged
(
Object
source
)
{
fireTreeNodesInserted
(
source
,
null
,
null
,
null
);
fireTreeNodesChanged
(
source
,
null
,
null
,
null
);
fireTreeNodesRemoved
(
source
,
null
,
null
,
null
);
fireTreeStructureChanged
(
source
,
null
,
null
,
null
);
}
}
test/javax/swing/plaf/basic/BasicComboBoxEditor/Test8015336.java
0 → 100644
浏览文件 @
7f94d1c9
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* 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.
*/
import
javax.swing.JComboBox
;
/*
* @test
* @bug 8015336
* @summary No NPE for BasicComboBoxEditor.setItem(null)
* @author Sergey Malenkov
*/
public
class
Test8015336
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
new
JComboBox
().
getEditor
().
setItem
(
new
Test8015336
());
}
@Override
public
String
toString
()
{
return
null
;
}
}
test/javax/swing/text/View/8015853/bug8015853.java
0 → 100644
浏览文件 @
7f94d1c9
/*
* Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* 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 8015853
* @summary Tests the rendering of a large HTML document
* @author Dmitry Markov
* @run main bug8015853
*/
import
java.io.*
;
import
java.net.URL
;
import
java.util.Scanner
;
import
javax.swing.*
;
import
javax.swing.text.html.HTMLEditorKit
;
public
class
bug8015853
{
private
static
String
text
=
""
;
public
static
void
main
(
String
[]
args
)
throws
Exception
{
try
{
URL
path
=
ClassLoader
.
getSystemResource
(
"bug8015853.txt"
);
File
file
=
new
File
(
path
.
toURI
());
Scanner
scanner
=
new
Scanner
(
file
);
while
(
scanner
.
hasNextLine
())
{
text
+=
scanner
.
nextLine
()
+
"\n"
;
}
scanner
.
close
();
}
catch
(
Exception
ex
)
{
throw
new
RuntimeException
(
ex
);
}
text
+=
text
;
SwingUtilities
.
invokeAndWait
(
new
Runnable
()
{
public
void
run
()
{
createAndShowGUI
();
}
});
}
private
static
void
createAndShowGUI
()
{
try
{
UIManager
.
setLookAndFeel
(
"javax.swing.plaf.metal.MetalLookAndFeel"
);
}
catch
(
Exception
ex
)
{
throw
new
RuntimeException
(
ex
);
}
JFrame
frame
=
new
JFrame
();
frame
.
setDefaultCloseOperation
(
JFrame
.
EXIT_ON_CLOSE
);
JEditorPane
editorPane
=
new
JEditorPane
();
HTMLEditorKit
editorKit
=
new
HTMLEditorKit
();
editorPane
.
setEditorKit
(
editorKit
);
editorPane
.
setText
(
text
);
frame
.
add
(
editorPane
);
frame
.
setVisible
(
true
);
}
}
test/javax/swing/text/View/8015853/bug8015853.txt
0 → 100644
浏览文件 @
7f94d1c9
</font><font size=2 color="#0000aa"><i>/*
* Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* 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.
*/</font></i><font size=2 color=black>
<b>import</b> java.io.*;
<b>import</b> java.net.URL;
<b>import</b> java.util.Scanner;
<b>import</b> javax.swing.*;
<b>import</b> javax.swing.text.html.HTMLEditorKit;
<b>public</b> <b>class</b> bug8015853 {
<b>private</b> <b>static</b> String text = </font><font size=2 color="#00bb00">""</font><font size=2 color=black>;
<b>public</b> <b>static</b> <b>void</b> main(String[] args) throws Exception {
<b>try</b> {
URL path = ClassLoader.getSystemResource(</font><font size=2 color="#00bb00">"bug8015853.txt"</font><font size=2 color=black>);
File file = <b>new</b> File(path.toURI());
Scanner scanner = <b>new</b> Scanner(file);
<b>while</b> (scanner.hasNextLine()) {
text += scanner.nextLine() + </font><font size=2 color="#00bb00">"\n"</font><font size=2 color=black>;
}
scanner.close();
} <b>catch</b> (Exception ex) {
<b>throw</b> <b>new</b> RuntimeException(ex);
}
System.out.println(text);
SwingUtilities.invokeAndWait(<b>new</b> Runnable() {
<b>public</b> <b>void</b> run() {
createAndShowGUI();
}
});
}
<b>private</b> <b>static</b> <b>void</b> createAndShowGUI() {
<b>try</b> {
UIManager.setLookAndFeel(</font><font size=2 color="#00bb00">"javax.swing.plaf.metal.MetalLookAndFeel"</font><font size=2 color=black>);
} <b>catch</b> (Exception ex) {
<b>throw</b> <b>new</b> RuntimeException(ex);
}
JFrame frame = <b>new</b> JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JEditorPane editorPane = <b>new</b> JEditorPane();
HTMLEditorKit editorKit = <b>new</b> HTMLEditorKit();
editorPane.setEditorKit(editorKit);
editorPane.setText(text);
frame.add(editorPane);
frame.setVisible(<b>true</b>);
}
}
\ No newline at end of file
test/sun/java2d/cmm/ColorConvertOp/ColConvCCMTest.java
浏览文件 @
7f94d1c9
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
/**
/**
* @test
* @test
* @bug 6476665 7033534
* @bug 6476665 7033534
6830714
* @summary Verifies color conversion of Component Color Model based images
* @summary Verifies color conversion of Component Color Model based images
* @run main ColConvCCMTest
* @run main ColConvCCMTest
*/
*/
...
@@ -57,9 +57,9 @@ public class ColConvCCMTest extends ColConvTest {
...
@@ -57,9 +57,9 @@ public class ColConvCCMTest extends ColConvTest {
final
static
double
[]
ACCURACY
=
{
final
static
double
[]
ACCURACY
=
{
// Accuracy for color conversions
// Accuracy for color conversions
2.5
,
// sRGB
2.5
,
// sRGB
6.5
,
// LINEAR_RGB
(
isOpenProfile
()
?
45.0
:
10.1
),
// LINEAR_RGB
10.5
,
// GRAY
10.5
,
// GRAY
45.5
,
// PYCC
(
isOpenProfile
()
?
207
:
45.5
),
// PYCC
47.5
// CIEXYZ
47.5
// CIEXYZ
};
};
...
...
test/sun/java2d/cmm/ColorConvertOp/ColConvDCMTest.java
浏览文件 @
7f94d1c9
...
@@ -62,7 +62,11 @@ public class ColConvDCMTest extends ColConvTest {
...
@@ -62,7 +62,11 @@ public class ColConvDCMTest extends ColConvTest {
ColorSpace
.
CS_LINEAR_RGB
,
ColorSpace
.
CS_LINEAR_RGB
,
};
};
final
static
double
ACCURACY
=
2.5
;
final
static
double
[]
ACCURACY
=
{
// Accuracy for color conversions
2.5
,
// sRGB
(
isOpenProfile
()
?
45.0
:
2.5
),
// LINEAR_RGB
};
final
static
String
[]
gldImgNames
=
{
final
static
String
[]
gldImgNames
=
{
"SRGB.png"
,
"SRGB555.png"
,
"SRGB565.png"
,
"LRGB.png"
,
"LRGB555.png"
,
"SRGB.png"
,
"SRGB555.png"
,
"SRGB565.png"
,
"LRGB.png"
,
"LRGB555.png"
,
...
@@ -142,7 +146,7 @@ public class ColConvDCMTest extends ColConvTest {
...
@@ -142,7 +146,7 @@ public class ColConvDCMTest extends ColConvTest {
if
(!
testImage
(
imgTypes
[
i
][
0
],
imgTypes
[
i
][
1
],
imgTypes
[
i
][
2
],
if
(!
testImage
(
imgTypes
[
i
][
0
],
imgTypes
[
i
][
1
],
imgTypes
[
i
][
2
],
imgTypes
[
i
][
3
],
cSpaces
[
imgTypes
[
i
][
4
]],
gldImage
,
imgTypes
[
i
][
3
],
cSpaces
[
imgTypes
[
i
][
4
]],
gldImage
,
ACCURACY
))
ACCURACY
[
imgTypes
[
i
][
4
]]
))
{
{
throw
new
RuntimeException
(
throw
new
RuntimeException
(
"Invalid result of the ColorConvertOp for "
+
"Invalid result of the ColorConvertOp for "
+
...
@@ -154,7 +158,8 @@ public class ColConvDCMTest extends ColConvTest {
...
@@ -154,7 +158,8 @@ public class ColConvDCMTest extends ColConvTest {
if
(!
testSubImage
(
SI_X
,
SI_Y
,
SI_W
,
SI_H
,
imgTypes
[
i
][
0
],
if
(!
testSubImage
(
SI_X
,
SI_Y
,
SI_W
,
SI_H
,
imgTypes
[
i
][
0
],
imgTypes
[
i
][
1
],
imgTypes
[
i
][
2
],
imgTypes
[
i
][
3
],
imgTypes
[
i
][
1
],
imgTypes
[
i
][
2
],
imgTypes
[
i
][
3
],
cSpaces
[
imgTypes
[
i
][
4
]],
gldImage
,
ACCURACY
))
cSpaces
[
imgTypes
[
i
][
4
]],
gldImage
,
ACCURACY
[
imgTypes
[
i
][
4
]]))
{
{
throw
new
RuntimeException
(
throw
new
RuntimeException
(
"Invalid result of the ColorConvertOp for "
+
"Invalid result of the ColorConvertOp for "
+
...
...
test/sun/java2d/cmm/ColorConvertOp/ColConvTest.java
浏览文件 @
7f94d1c9
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
*/
*/
import
java.awt.color.ColorSpace
;
import
java.awt.color.ColorSpace
;
import
java.awt.color.ICC_Profile
;
import
java.awt.image.BufferedImage
;
import
java.awt.image.BufferedImage
;
import
java.awt.image.DataBuffer
;
import
java.awt.image.DataBuffer
;
...
@@ -126,4 +127,33 @@ public abstract class ColConvTest implements Runnable {
...
@@ -126,4 +127,33 @@ public abstract class ColConvTest implements Runnable {
public
boolean
isPassed
()
{
public
boolean
isPassed
()
{
return
passed
;
return
passed
;
}
}
private
static
Boolean
isOpenProfile
=
null
;
public
static
boolean
isOpenProfile
()
{
if
(
isOpenProfile
==
null
)
{
ICC_Profile
p
=
ICC_Profile
.
getInstance
(
ColorSpace
.
CS_sRGB
);
byte
[]
h
=
p
.
getData
(
ICC_Profile
.
icSigHead
);
if
(
h
==
null
||
h
.
length
<
128
)
{
throw
new
RuntimeException
(
"Test failed: invalid sRGB header"
);
}
final
byte
[]
lcmsID
=
new
byte
[]
{
(
byte
)
0x6c
,
// l
(
byte
)
0x63
,
// c
(
byte
)
0x6d
,
// m
(
byte
)
0x73
,
// s
};
int
off
=
ICC_Profile
.
icHdrCmmId
;
isOpenProfile
=
((
h
[
off
+
0
]
==
lcmsID
[
0
])
&&
(
h
[
off
+
1
]
==
lcmsID
[
1
])
&&
(
h
[
off
+
2
]
==
lcmsID
[
2
])
&&
(
h
[
off
+
3
]
==
lcmsID
[
3
]));
}
return
isOpenProfile
;
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录