Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
2f8ccf10
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看板
提交
2f8ccf10
编写于
4月 18, 2011
作者:
L
lana
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
8de34fca
ba84861c
变更
26
隐藏空白更改
内联
并排
Showing
26 changed file
with
610 addition
and
35 deletion
+610
-35
src/share/classes/java/awt/Dialog.java
src/share/classes/java/awt/Dialog.java
+1
-1
src/share/classes/java/awt/GraphicsDevice.java
src/share/classes/java/awt/GraphicsDevice.java
+4
-2
src/share/classes/java/awt/Toolkit.java
src/share/classes/java/awt/Toolkit.java
+33
-2
src/share/classes/java/awt/Window.java
src/share/classes/java/awt/Window.java
+51
-0
src/solaris/native/sun/awt/awt_LoadLibrary.c
src/solaris/native/sun/awt/awt_LoadLibrary.c
+3
-14
src/solaris/native/sun/awt/awt_mgrsel.c
src/solaris/native/sun/awt/awt_mgrsel.c
+1
-1
src/solaris/native/sun/awt/gtk2_interface.c
src/solaris/native/sun/awt/gtk2_interface.c
+2
-0
src/solaris/native/sun/awt/gtk2_interface.h
src/solaris/native/sun/awt/gtk2_interface.h
+2
-0
src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c
src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c
+7
-2
src/windows/classes/sun/awt/Win32GraphicsEnvironment.java
src/windows/classes/sun/awt/Win32GraphicsEnvironment.java
+0
-6
src/windows/classes/sun/awt/windows/WToolkit.java
src/windows/classes/sun/awt/windows/WToolkit.java
+0
-3
src/windows/native/sun/windows/awt_Button.cpp
src/windows/native/sun/windows/awt_Button.cpp
+3
-1
src/windows/native/sun/windows/awt_Checkbox.cpp
src/windows/native/sun/windows/awt_Checkbox.cpp
+3
-1
src/windows/native/sun/windows/awt_FileDialog.cpp
src/windows/native/sun/windows/awt_FileDialog.cpp
+1
-2
test/java/awt/Dialog/ValidateOnShow/ValidateOnShow.java
test/java/awt/Dialog/ValidateOnShow/ValidateOnShow.java
+84
-0
test/java/awt/FileDialog/FileNameOverrideTest/FileNameOverrideTest.html
...FileDialog/FileNameOverrideTest/FileNameOverrideTest.html
+22
-0
test/java/awt/FileDialog/FileNameOverrideTest/FileNameOverrideTest.java
...FileDialog/FileNameOverrideTest/FileNameOverrideTest.java
+73
-0
test/java/awt/FileDialog/SaveFileNameOverrideTest/SaveFileNameOverrideTest.html
...og/SaveFileNameOverrideTest/SaveFileNameOverrideTest.html
+22
-0
test/java/awt/FileDialog/SaveFileNameOverrideTest/SaveFileNameOverrideTest.java
...og/SaveFileNameOverrideTest/SaveFileNameOverrideTest.java
+65
-0
test/java/awt/GraphicsEnvironment/LoadLock/GE_init1.java
test/java/awt/GraphicsEnvironment/LoadLock/GE_init1.java
+37
-0
test/java/awt/GraphicsEnvironment/LoadLock/GE_init2.java
test/java/awt/GraphicsEnvironment/LoadLock/GE_init2.java
+38
-0
test/java/awt/GraphicsEnvironment/LoadLock/GE_init3.java
test/java/awt/GraphicsEnvironment/LoadLock/GE_init3.java
+38
-0
test/java/awt/GraphicsEnvironment/LoadLock/GE_init4.java
test/java/awt/GraphicsEnvironment/LoadLock/GE_init4.java
+37
-0
test/java/awt/GraphicsEnvironment/LoadLock/GE_init5.java
test/java/awt/GraphicsEnvironment/LoadLock/GE_init5.java
+37
-0
test/java/awt/GraphicsEnvironment/LoadLock/GE_init6.java
test/java/awt/GraphicsEnvironment/LoadLock/GE_init6.java
+45
-0
test/java/awt/Window/TranslucentJAppletTest/TranslucentJAppletTest.java
...Window/TranslucentJAppletTest/TranslucentJAppletTest.java
+1
-0
未找到文件。
src/share/classes/java/awt/Dialog.java
浏览文件 @
2f8ccf10
...
...
@@ -903,7 +903,7 @@ public class Dialog extends Window {
if
(
peer
==
null
)
{
addNotify
();
}
validate
();
validate
Unconditionally
();
if
(
visible
)
{
toFront
();
retval
=
false
;
...
...
src/share/classes/java/awt/GraphicsDevice.java
浏览文件 @
2f8ccf10
...
...
@@ -243,8 +243,10 @@ public abstract class GraphicsDevice {
* a non-client of the input method framework.
* </ul>
* <p>
* Simulated full-screen mode resizes
* the window to the size of the screen and positions it at (0,0).
* The simulated full-screen mode places and resizes the window to the maximum
* possible visible area of the screen. However, the native windowing system
* may modify the requested geometry-related data, so that the {@code Window} object
* is placed and sized in a way that corresponds closely to the desktop settings.
* <p>
* When entering full-screen mode, if the window to be used as a
* full-screen window is not visible, this method will make it visible.
...
...
src/share/classes/java/awt/Toolkit.java
浏览文件 @
2f8ccf10
...
...
@@ -466,6 +466,10 @@ public abstract class Toolkit {
*/
protected
void
loadSystemColors
(
int
[]
systemColors
)
throws
HeadlessException
{
if
(
GraphicsEnvironment
.
isHeadless
()){
throw
new
HeadlessException
();
}
}
/**
...
...
@@ -500,6 +504,10 @@ public abstract class Toolkit {
*/
public
void
setDynamicLayout
(
boolean
dynamic
)
throws
HeadlessException
{
if
(
GraphicsEnvironment
.
isHeadless
()){
throw
new
HeadlessException
();
}
}
/**
...
...
@@ -523,6 +531,9 @@ public abstract class Toolkit {
*/
protected
boolean
isDynamicLayoutSet
()
throws
HeadlessException
{
if
(
GraphicsEnvironment
.
isHeadless
()){
throw
new
HeadlessException
();
}
if
(
this
!=
Toolkit
.
getDefaultToolkit
())
{
return
Toolkit
.
getDefaultToolkit
().
isDynamicLayoutSet
();
}
else
{
...
...
@@ -558,6 +569,9 @@ public abstract class Toolkit {
*/
public
boolean
isDynamicLayoutActive
()
throws
HeadlessException
{
if
(
GraphicsEnvironment
.
isHeadless
()){
throw
new
HeadlessException
();
}
if
(
this
!=
Toolkit
.
getDefaultToolkit
())
{
return
Toolkit
.
getDefaultToolkit
().
isDynamicLayoutActive
();
}
else
{
...
...
@@ -601,6 +615,9 @@ public abstract class Toolkit {
*/
public
Insets
getScreenInsets
(
GraphicsConfiguration
gc
)
throws
HeadlessException
{
if
(
GraphicsEnvironment
.
isHeadless
()){
throw
new
HeadlessException
();
}
if
(
this
!=
Toolkit
.
getDefaultToolkit
())
{
return
Toolkit
.
getDefaultToolkit
().
getScreenInsets
(
gc
);
}
else
{
...
...
@@ -1342,6 +1359,9 @@ public abstract class Toolkit {
* @since 1.4
*/
public
Clipboard
getSystemSelection
()
throws
HeadlessException
{
if
(
GraphicsEnvironment
.
isHeadless
()){
throw
new
HeadlessException
();
}
if
(
this
!=
Toolkit
.
getDefaultToolkit
())
{
return
Toolkit
.
getDefaultToolkit
().
getSystemSelection
();
}
else
{
...
...
@@ -1371,6 +1391,10 @@ public abstract class Toolkit {
* @since JDK1.1
*/
public
int
getMenuShortcutKeyMask
()
throws
HeadlessException
{
if
(
GraphicsEnvironment
.
isHeadless
()){
throw
new
HeadlessException
();
}
return
Event
.
CTRL_MASK
;
}
...
...
@@ -1499,6 +1523,9 @@ public abstract class Toolkit {
*/
public
Dimension
getBestCursorSize
(
int
preferredWidth
,
int
preferredHeight
)
throws
HeadlessException
{
if
(
GraphicsEnvironment
.
isHeadless
()){
throw
new
HeadlessException
();
}
// Override to implement custom cursor support.
if
(
this
!=
Toolkit
.
getDefaultToolkit
())
{
return
Toolkit
.
getDefaultToolkit
().
...
...
@@ -1526,6 +1553,9 @@ public abstract class Toolkit {
* @since 1.2
*/
public
int
getMaximumCursorColors
()
throws
HeadlessException
{
if
(
GraphicsEnvironment
.
isHeadless
()){
throw
new
HeadlessException
();
}
// Override to implement custom cursor support.
if
(
this
!=
Toolkit
.
getDefaultToolkit
())
{
return
Toolkit
.
getDefaultToolkit
().
getMaximumCursorColors
();
...
...
@@ -2561,8 +2591,6 @@ public abstract class Toolkit {
* initialized with {@code true}.
* Changing this value after the {@code Toolkit} class initialization will have no effect.
* <p>
* The current value could be queried by using the
* {@code System.getProperty("sun.awt.enableExtraMouseButtons")} method.
* @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true
* @return {@code true} if events from extra mouse buttons are allowed to be processed and posted;
* {@code false} otherwise
...
...
@@ -2572,6 +2600,9 @@ public abstract class Toolkit {
* @since 1.7
*/
public
boolean
areExtraMouseButtonsEnabled
()
throws
HeadlessException
{
if
(
GraphicsEnvironment
.
isHeadless
()){
throw
new
HeadlessException
();
}
return
Toolkit
.
getDefaultToolkit
().
areExtraMouseButtonsEnabled
();
}
}
src/share/classes/java/awt/Window.java
浏览文件 @
2f8ccf10
...
...
@@ -870,6 +870,11 @@ public class Window extends Container implements Accessible {
* are automatically enlarged if either is less than
* the minimum size as specified by previous call to
* {@code setMinimumSize}.
* <p>
* The method changes the geometry-related data. Therefore,
* the native windowing system may ignore such requests, or it may modify
* the requested data, so that the {@code Window} object is placed and sized
* in a way that corresponds closely to the desktop settings.
*
* @see #getSize
* @see #setBounds
...
...
@@ -887,6 +892,11 @@ public class Window extends Container implements Accessible {
* are automatically enlarged if either is less than
* the minimum size as specified by previous call to
* {@code setMinimumSize}.
* <p>
* The method changes the geometry-related data. Therefore,
* the native windowing system may ignore such requests, or it may modify
* the requested data, so that the {@code Window} object is placed and sized
* in a way that corresponds closely to the desktop settings.
*
* @see #getSize
* @see #setBounds
...
...
@@ -897,6 +907,32 @@ public class Window extends Container implements Accessible {
super
.
setSize
(
width
,
height
);
}
/**
* {@inheritDoc}
* <p>
* The method changes the geometry-related data. Therefore,
* the native windowing system may ignore such requests, or it may modify
* the requested data, so that the {@code Window} object is placed and sized
* in a way that corresponds closely to the desktop settings.
*/
@Override
public
void
setLocation
(
int
x
,
int
y
)
{
super
.
setLocation
(
x
,
y
);
}
/**
* {@inheritDoc}
* <p>
* The method changes the geometry-related data. Therefore,
* the native windowing system may ignore such requests, or it may modify
* the requested data, so that the {@code Window} object is placed and sized
* in a way that corresponds closely to the desktop settings.
*/
@Override
public
void
setLocation
(
Point
p
)
{
super
.
setLocation
(
p
);
}
/**
* @deprecated As of JDK version 1.1,
* replaced by <code>setBounds(int, int, int, int)</code>.
...
...
@@ -3147,6 +3183,11 @@ public class Window extends Container implements Accessible {
* placed at the left side of the screen. The similar placement
* will occur if both top and bottom edges are out of the screen.
* In that case, the window is placed at the top side of the screen.
* <p>
* The method changes the geometry-related data. Therefore,
* the native windowing system may ignore such requests, or it may modify
* the requested data, so that the {@code Window} object is placed and sized
* in a way that corresponds closely to the desktop settings.
*
* @param c the component in relation to which the window's location
* is determined
...
...
@@ -3395,6 +3436,11 @@ public class Window extends Container implements Accessible {
* are automatically enlarged if either is less than
* the minimum size as specified by previous call to
* {@code setMinimumSize}.
* <p>
* The method changes the geometry-related data. Therefore,
* the native windowing system may ignore such requests, or it may modify
* the requested data, so that the {@code Window} object is placed and sized
* in a way that corresponds closely to the desktop settings.
*
* @see #getBounds
* @see #setLocation(int, int)
...
...
@@ -3424,6 +3470,11 @@ public class Window extends Container implements Accessible {
* will be automatically enlarged if either is less than
* the minimum size as specified by previous call to
* {@code setMinimumSize}.
* <p>
* The method changes the geometry-related data. Therefore,
* the native windowing system may ignore such requests, or it may modify
* the requested data, so that the {@code Window} object is placed and sized
* in a way that corresponds closely to the desktop settings.
*
* @see #getBounds
* @see #setLocation(int, int)
...
...
src/solaris/native/sun/awt/awt_LoadLibrary.c
浏览文件 @
2f8ccf10
...
...
@@ -128,12 +128,12 @@ AWT_OnLoad(JavaVM *vm, void *reserved)
}
}
/* Calculate
toolkit name, kind of toolkit (XAWT, Motif) and library
to load */
/* Calculate
library name
to load */
if
(
AWTIsHeadless
())
{
str
cpy
(
p
,
"/headless/libmawt"
);
str
ncpy
(
p
,
"/headless/libmawt.so"
,
MAXPATHLEN
-
len
-
1
);
}
else
{
/* Default AWT Toolkit on Linux and Solaris is XAWT. */
str
cpy
(
p
,
"/xawt/libmawt"
);
str
ncpy
(
p
,
"/xawt/libmawt.so"
,
MAXPATHLEN
-
len
-
1
);
}
if
(
toolkit
)
{
...
...
@@ -143,23 +143,12 @@ AWT_OnLoad(JavaVM *vm, void *reserved)
(
*
env
)
->
DeleteLocalRef
(
env
,
propname
);
}
strcat
(
p
,
".so"
);
JNU_CallStaticMethodByName
(
env
,
NULL
,
"java/lang/System"
,
"load"
,
"(Ljava/lang/String;)V"
,
JNU_NewStringPlatform
(
env
,
buf
));
awtHandle
=
dlopen
(
buf
,
RTLD_LAZY
|
RTLD_GLOBAL
);
/*
if (dlsym(awtHandle, "AWTCharRBearing") == NULL) {
printf("========= AWTCharRBearing not found\n"); fflush(stdout);
}
else {
printf("========= AWTCharRBearing was found\n"); fflush(stdout);
}
*/
return
JNI_VERSION_1_2
;
}
...
...
src/solaris/native/sun/awt/awt_mgrsel.c
浏览文件 @
2f8ccf10
...
...
@@ -136,7 +136,7 @@ awt_mgrsel_select(const char *selname, long extra_mask,
||
per_scr_owners
==
NULL
||
mgrsel
==
NULL
)
{
DTRACE_PRINTLN
(
"MG: select: unable to allocate memory"
);
if
(
namesbuf
!=
NULL
)
free
(
per_scr_atoms
);
if
(
namesbuf
!=
NULL
)
free
(
namesbuf
);
if
(
names
!=
NULL
)
free
(
names
);
if
(
per_scr_atoms
!=
NULL
)
free
(
per_scr_atoms
);
if
(
per_scr_owners
!=
NULL
)
free
(
per_scr_owners
);
...
...
src/solaris/native/sun/awt/gtk2_interface.c
浏览文件 @
2f8ccf10
...
...
@@ -443,6 +443,8 @@ void gtk2_file_chooser_load()
"gtk_file_chooser_set_current_folder"
);
fp_gtk_file_chooser_set_filename
=
dl_symbol
(
"gtk_file_chooser_set_filename"
);
fp_gtk_file_chooser_set_current_name
=
dl_symbol
(
"gtk_file_chooser_set_current_name"
);
fp_gtk_file_filter_add_custom
=
dl_symbol
(
"gtk_file_filter_add_custom"
);
fp_gtk_file_chooser_set_filter
=
dl_symbol
(
"gtk_file_chooser_set_filter"
);
fp_gtk_file_chooser_get_type
=
dl_symbol
(
"gtk_file_chooser_get_type"
);
...
...
src/solaris/native/sun/awt/gtk2_interface.h
浏览文件 @
2f8ccf10
...
...
@@ -766,6 +766,8 @@ gboolean (*fp_gtk_file_chooser_set_current_folder)(GtkFileChooser *chooser,
const
gchar
*
filename
);
gboolean
(
*
fp_gtk_file_chooser_set_filename
)(
GtkFileChooser
*
chooser
,
const
char
*
filename
);
void
(
*
fp_gtk_file_chooser_set_current_name
)(
GtkFileChooser
*
chooser
,
const
gchar
*
name
);
void
(
*
fp_gtk_file_filter_add_custom
)(
GtkFileFilter
*
filter
,
GtkFileFilterFlags
needed
,
GtkFileFilterFunc
func
,
gpointer
data
,
GDestroyNotify
notify
);
...
...
src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c
浏览文件 @
2f8ccf10
...
...
@@ -4,6 +4,7 @@
#include <string.h>
#include "gtk2_interface.h"
#include "sun_awt_X11_GtkFileDialogPeer.h"
#include "java_awt_FileDialog.h"
#include "debug_assert.h"
static
JavaVM
*
jvm
;
...
...
@@ -220,7 +221,7 @@ Java_sun_awt_X11_GtkFileDialogPeer_run(JNIEnv * env, jobject jpeer,
const
char
*
title
=
jtitle
==
NULL
?
""
:
(
*
env
)
->
GetStringUTFChars
(
env
,
jtitle
,
0
);
if
(
mode
==
1
)
{
if
(
mode
==
java_awt_FileDialog_SAVE
)
{
/* Save action */
dialog
=
fp_gtk_file_chooser_dialog_new
(
title
,
NULL
,
GTK_FILE_CHOOSER_ACTION_SAVE
,
GTK_STOCK_CANCEL
,
...
...
@@ -253,7 +254,11 @@ Java_sun_awt_X11_GtkFileDialogPeer_run(JNIEnv * env, jobject jpeer,
/* Set the filename */
if
(
jfile
!=
NULL
)
{
const
char
*
filename
=
(
*
env
)
->
GetStringUTFChars
(
env
,
jfile
,
0
);
fp_gtk_file_chooser_set_filename
(
GTK_FILE_CHOOSER
(
dialog
),
filename
);
if
(
mode
==
java_awt_FileDialog_SAVE
)
{
fp_gtk_file_chooser_set_current_name
(
GTK_FILE_CHOOSER
(
dialog
),
filename
);
}
else
{
fp_gtk_file_chooser_set_filename
(
GTK_FILE_CHOOSER
(
dialog
),
filename
);
}
(
*
env
)
->
ReleaseStringUTFChars
(
env
,
jfile
,
filename
);
}
...
...
src/windows/classes/sun/awt/Win32GraphicsEnvironment.java
浏览文件 @
2f8ccf10
...
...
@@ -71,12 +71,6 @@ public class Win32GraphicsEnvironment
SurfaceManagerFactory
.
setInstance
(
new
WindowsSurfaceManagerFactory
());
}
/**
* Noop function that just acts as an entry point for someone to force
* a static initialization of this class.
*/
public
static
void
init
()
{}
/**
* Initializes native components of the graphics environment. This
* includes everything from the native GraphicsDevice elements to
...
...
src/windows/classes/sun/awt/windows/WToolkit.java
浏览文件 @
2f8ccf10
...
...
@@ -103,9 +103,6 @@ public class WToolkit extends SunToolkit implements Runnable {
static
{
loadLibraries
();
// Force Win32GE to load if it is not already loaded; this loads
// various other classes that are required for basic awt functionality
Win32GraphicsEnvironment
.
init
();
initIDs
();
// Print out which version of Windows is running
...
...
src/windows/native/sun/windows/awt_Button.cpp
浏览文件 @
2f8ccf10
...
...
@@ -317,7 +317,9 @@ void AwtButton::_SetLabel(void *param)
badAlloc
=
1
;
}
else
{
c
->
SetText
(
labelStr
);
JNU_ReleaseStringPlatformChars
(
env
,
label
,
labelStr
);
if
(
label
!=
NULL
)
{
JNU_ReleaseStringPlatformChars
(
env
,
label
,
labelStr
);
}
}
}
...
...
src/windows/native/sun/windows/awt_Checkbox.cpp
浏览文件 @
2f8ccf10
...
...
@@ -384,7 +384,9 @@ void AwtCheckbox::_SetLabel(void *param)
{
c
->
SetText
(
labelStr
);
c
->
VerifyState
();
JNU_ReleaseStringPlatformChars
(
env
,
label
,
labelStr
);
if
(
label
!=
NULL
)
{
JNU_ReleaseStringPlatformChars
(
env
,
label
,
labelStr
);
}
}
}
...
...
src/windows/native/sun/windows/awt_FileDialog.cpp
浏览文件 @
2f8ccf10
...
...
@@ -225,7 +225,6 @@ AwtFileDialog::Show(void *p)
{
JNIEnv
*
env
=
(
JNIEnv
*
)
JNU_GetEnv
(
jvm
,
JNI_VERSION_1_2
);
jobject
peer
;
WCHAR
unicodeChar
=
L' '
;
LPTSTR
fileBuffer
=
NULL
;
LPTSTR
currentDirectory
=
NULL
;
jint
mode
=
0
;
...
...
@@ -263,7 +262,7 @@ AwtFileDialog::Show(void *p)
HWND
hwndOwner
=
awtParent
?
awtParent
->
GetHWnd
()
:
NULL
;
if
(
title
==
NULL
||
env
->
GetStringLength
(
title
)
==
0
)
{
title
=
JNU_NewStringPlatform
(
env
,
&
unicodeChar
);
title
=
JNU_NewStringPlatform
(
env
,
L" "
);
}
JavaStringBuffer
titleBuffer
(
env
,
title
);
...
...
test/java/awt/Dialog/ValidateOnShow/ValidateOnShow.java
0 → 100644
浏览文件 @
2f8ccf10
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
@test
@bug 7027013
@summary Dialog.show() should validate the window unconditionally
@author anthony.petrov@oracle.com: area=awt.toplevel
@run main ValidateOnShow
*/
import
java.awt.*
;
public
class
ValidateOnShow
{
private
static
Dialog
dialog
=
new
Dialog
((
Frame
)
null
);
private
static
Panel
panel
=
new
Panel
()
{
@Override
public
boolean
isValidateRoot
()
{
return
true
;
}
};
private
static
Button
button
=
new
Button
(
"Test"
);
private
static
void
sleep
()
{
try
{
Thread
.
sleep
(
500
);
}
catch
(
Exception
e
)
{}
}
private
static
void
test
()
{
System
.
out
.
println
(
"Before showing: panel.isValid="
+
panel
.
isValid
()
+
" dialog.isValid="
+
dialog
.
isValid
());
dialog
.
setVisible
(
true
);
sleep
();
System
.
out
.
println
(
"After showing: panel.isValid="
+
panel
.
isValid
()
+
" dialog.isValid="
+
dialog
.
isValid
());
if
(!
panel
.
isValid
())
{
dialog
.
dispose
();
throw
new
RuntimeException
(
"The panel hasn't been validated upon showing the dialog"
);
}
dialog
.
setVisible
(
false
);
sleep
();
}
public
static
void
main
(
String
[]
args
)
{
// setup
dialog
.
add
(
panel
);
panel
.
add
(
button
);
dialog
.
setBounds
(
200
,
200
,
300
,
200
);
// The first test should always succeed since the dialog is invalid initially
test
();
// now invalidate the button and the panel
button
.
setBounds
(
1
,
1
,
30
,
30
);
sleep
();
// since the panel is a validate root, the dialog is still valid
// w/o a fix this would fail
test
();
// cleanup
dialog
.
dispose
();
}
}
test/java/awt/FileDialog/FileNameOverrideTest/FileNameOverrideTest.html
0 → 100644
浏览文件 @
2f8ccf10
<html>
<!--
@test
@bug 6260659
@summary File Name set programmatically in FileDialog is overridden during navigation, XToolkit
@author Dmitry.Cherepanov@SUN.COM area=awt.filedialog
@library ../../regtesthelpers
@build Sysout
@run applet/manual=yesno FileNameOverrideTest.html
-->
<head>
<title>
FileNameOverrideTest
</title>
</head>
<body>
<h1>
FileNameOverrideTest
<br>
Bug ID: 6260659
</h1>
<p>
See the dialog box (usually in upper left corner) for instructions
</p>
<APPLET
CODE=
"FileNameOverrideTest.class"
WIDTH=
200
HEIGHT=
200
></APPLET>
</body>
</html>
test/java/awt/FileDialog/FileNameOverrideTest/FileNameOverrideTest.java
0 → 100644
浏览文件 @
2f8ccf10
/*
test
@bug 6260659
@summary File Name set programmatically in FileDialog is overridden during navigation, XToolkit
@author Dmitry.Cherepanov@SUN.COM area=awt.filedialog
@library ../../regtesthelpers
@build Sysout
@run applet/manual=yesno FileNameOverrideTest.html
*/
import
test.java.awt.regtesthelpers.Sysout
;
import
java.applet.Applet
;
import
java.awt.*
;
import
java.awt.event.ActionEvent
;
import
java.awt.event.ActionListener
;
import
java.io.File
;
import
java.io.IOException
;
public
class
FileNameOverrideTest
extends
Applet
implements
ActionListener
{
private
final
static
String
fileName
=
"input"
;
private
final
static
String
clickDirName
=
"Directory for double click"
;
private
final
static
String
dirPath
=
"."
;
private
Button
showBtn
;
private
FileDialog
fd
;
public
void
init
()
{
this
.
setLayout
(
new
GridLayout
(
1
,
1
));
fd
=
new
FileDialog
(
new
Frame
(),
"Open"
);
showBtn
=
new
Button
(
"Show File Dialog"
);
showBtn
.
addActionListener
(
this
);
add
(
showBtn
);
try
{
File
tmpFileUp
=
new
File
(
dirPath
+
File
.
separator
+
fileName
);
File
tmpDir
=
new
File
(
dirPath
+
File
.
separator
+
clickDirName
);
File
tmpFileIn
=
new
File
(
tmpDir
.
getAbsolutePath
()
+
File
.
separator
+
fileName
);
tmpDir
.
mkdir
();
tmpFileUp
.
createNewFile
();
tmpFileIn
.
createNewFile
();
}
catch
(
IOException
ex
)
{
throw
new
RuntimeException
(
"Cannot create test folder"
,
ex
);
}
String
[]
instructions
=
{
"1) Click on 'Show File Dialog' button. A file dialog will come up."
,
"2) Double-click on '"
+
clickDirName
+
"' and click OK."
,
"3) See result of the test below"
};
Sysout
.
createDialogWithInstructions
(
instructions
);
}
//End init()
public
void
start
()
{
setSize
(
200
,
200
);
show
();
}
// start()
public
void
actionPerformed
(
ActionEvent
e
)
{
if
(
e
.
getSource
()
==
showBtn
)
{
fd
.
setFile
(
fileName
);
fd
.
setDirectory
(
dirPath
);
fd
.
setVisible
(
true
);
String
output
=
fd
.
getFile
();
if
(
fileName
.
equals
(
output
))
{
Sysout
.
println
(
"TEST PASSED"
);
}
else
{
Sysout
.
println
(
"TEST FAILED (output file - "
+
output
+
")"
);
}
}
}
}
// class ManualYesNoTest
test/java/awt/FileDialog/SaveFileNameOverrideTest/SaveFileNameOverrideTest.html
0 → 100644
浏览文件 @
2f8ccf10
<html>
<!--
@test
@bug 6998877
@summary After double-click on the folder names, FileNameOverrideTest FAILED
@author Sergey.Bylokhov@oracle.com area=awt.filedialog
@library ../../regtesthelpers
@build Sysout
@run applet/manual=yesno SaveFileNameOverrideTest.html
-->
<head>
<title>
SaveFileNameOverrideTest
</title>
</head>
<body>
<h1>
SaveFileNameOverrideTest
<br>
Bug ID: 6260659
</h1>
<p>
See the dialog box (usually in upper left corner) for instructions
</p>
<APPLET
CODE=
"SaveFileNameOverrideTest.class"
WIDTH=
200
HEIGHT=
200
></APPLET>
</body>
</html>
test/java/awt/FileDialog/SaveFileNameOverrideTest/SaveFileNameOverrideTest.java
0 → 100644
浏览文件 @
2f8ccf10
/*
test
@bug 6998877
@summary After double-click on the folder names, FileNameOverrideTest FAILED
@author Sergey.Bylokhov@oracle.com area=awt.filedialog
@library ../../regtesthelpers
@build Sysout
@run applet/manual=yesno SaveFileNameOverrideTest.html
*/
import
test.java.awt.regtesthelpers.Sysout
;
import
java.applet.Applet
;
import
java.awt.*
;
import
java.awt.event.ActionEvent
;
import
java.awt.event.ActionListener
;
import
java.io.File
;
public
class
SaveFileNameOverrideTest
extends
Applet
implements
ActionListener
{
private
final
static
String
clickDirName
=
"Directory for double click"
;
private
final
static
String
dirPath
=
"."
;
private
Button
showBtn
;
private
FileDialog
fd
;
public
void
init
()
{
this
.
setLayout
(
new
GridLayout
(
1
,
1
));
fd
=
new
FileDialog
(
new
Frame
(),
"Save"
,
FileDialog
.
SAVE
);
showBtn
=
new
Button
(
"Show File Dialog"
);
showBtn
.
addActionListener
(
this
);
add
(
showBtn
);
File
tmpDir
=
new
File
(
dirPath
+
File
.
separator
+
clickDirName
);
tmpDir
.
mkdir
();
String
[]
instructions
=
{
"1) Click on 'Show File Dialog' button. A file dialog will come up."
,
"2) Double-click on '"
+
clickDirName
+
"' and click OK."
,
"3) See result of the test below"
};
Sysout
.
createDialogWithInstructions
(
instructions
);
}
//End init()
public
void
start
()
{
setSize
(
200
,
200
);
show
();
}
// start()
public
void
actionPerformed
(
ActionEvent
e
)
{
if
(
e
.
getSource
()
==
showBtn
)
{
fd
.
setFile
(
"input"
);
fd
.
setDirectory
(
dirPath
);
fd
.
setVisible
(
true
);
String
output
=
fd
.
getFile
();
if
(
"input"
.
equals
(
output
))
{
Sysout
.
println
(
"TEST PASSED"
);
}
else
{
Sysout
.
println
(
"TEST FAILED (output file - "
+
output
+
")"
);
}
}
}
}
// class ManualYesNoTest
test/java/awt/GraphicsEnvironment/LoadLock/GE_init1.java
0 → 100644
浏览文件 @
2f8ccf10
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 7002839
* @summary Static init deadlock Win32GraphicsEnvironment and WToolkit
* @run main GE_init1
*/
import
java.awt.Toolkit
;
public
class
GE_init1
{
public
static
void
main
(
String
[]
args
)
{
Toolkit
.
getDefaultToolkit
();
}
}
test/java/awt/GraphicsEnvironment/LoadLock/GE_init2.java
0 → 100644
浏览文件 @
2f8ccf10
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 7002839
* @summary Static init deadlock Win32GraphicsEnvironment and WToolkit
* @run main GE_init2
*/
import
java.awt.GraphicsEnvironment
;
public
class
GE_init2
{
public
static
void
main
(
String
[]
args
)
{
GraphicsEnvironment
.
getLocalGraphicsEnvironment
();
}
}
test/java/awt/GraphicsEnvironment/LoadLock/GE_init3.java
0 → 100644
浏览文件 @
2f8ccf10
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 7002839
* @summary Static init deadlock Win32GraphicsEnvironment and WToolkit
* @run main GE_init3
*/
import
java.awt.Frame
;
public
class
GE_init3
{
public
static
void
main
(
String
[]
args
)
{
new
Frame
(
"Test3"
).
setVisible
(
true
);
}
}
test/java/awt/GraphicsEnvironment/LoadLock/GE_init4.java
0 → 100644
浏览文件 @
2f8ccf10
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 7002839
* @summary Static init deadlock Win32GraphicsEnvironment and WToolkit
* @run main/othervm -Djava.awt.headless=true GE_init4
*/
import
java.awt.Toolkit
;
public
class
GE_init4
{
public
static
void
main
(
String
[]
args
)
{
Toolkit
.
getDefaultToolkit
();
}
}
test/java/awt/GraphicsEnvironment/LoadLock/GE_init5.java
0 → 100644
浏览文件 @
2f8ccf10
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 7002839
* @summary Static init deadlock Win32GraphicsEnvironment and WToolkit
* @run main/othervm -Djava.awt.headless=true GE_init4
*/
import
java.awt.Toolkit
;
public
class
GE_init5
{
public
static
void
main
(
String
[]
args
)
{
GraphicsEnvironment
.
getLocalGraphicsEnvironment
();
}
}
test/java/awt/GraphicsEnvironment/LoadLock/GE_init6.java
0 → 100644
浏览文件 @
2f8ccf10
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 7002839
* @summary Static init deadlock Win32GraphicsEnvironment and WToolkit
* @run main/othervm -Djava.awt.headless=true GE_init6
*/
import
java.awt.*
;
public
class
GE_init6
{
private
static
boolean
passed
=
false
;
public
static
void
main
(
String
[]
args
)
{
try
{
new
Frame
(
"Test3"
).
setVisible
(
true
);
}
catch
(
HeadlessException
e
){
passed
=
true
;
}
if
(!
passed
){
throw
new
RuntimeException
(
"Should have thrown HE but it either didn't throw any or just passed through."
);
}
}
}
test/java/awt/Window/TranslucentJAppletTest/TranslucentJAppletTest.java
浏览文件 @
2f8ccf10
...
...
@@ -43,6 +43,7 @@ public class TranslucentJAppletTest {
private
static
void
initAndShowGUI
()
{
frame
=
new
JFrame
();
JApplet
applet
=
new
JApplet
();
applet
.
setBackground
(
new
Color
(
0
,
0
,
0
,
0
));
JPanel
panel
=
new
JPanel
()
{
protected
void
paintComponent
(
Graphics
g
)
{
paintComponentCalled
=
true
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录