Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
1c3d2eab
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1c3d2eab
编写于
6月 26, 2008
作者:
M
malenkov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6718964: Swing border tests should be open source
Reviewed-by: peterz
上级
5e864098
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
354 addition
and
0 deletion
+354
-0
test/javax/swing/border/Test4120351.java
test/javax/swing/border/Test4120351.java
+43
-0
test/javax/swing/border/Test4124729.java
test/javax/swing/border/Test4124729.java
+38
-0
test/javax/swing/border/Test4243289.html
test/javax/swing/border/Test4243289.html
+9
-0
test/javax/swing/border/Test4243289.java
test/javax/swing/border/Test4243289.java
+52
-0
test/javax/swing/border/Test4247606.html
test/javax/swing/border/Test4247606.html
+10
-0
test/javax/swing/border/Test4247606.java
test/javax/swing/border/Test4247606.java
+62
-0
test/javax/swing/border/Test4252164.html
test/javax/swing/border/Test4252164.html
+10
-0
test/javax/swing/border/Test4252164.java
test/javax/swing/border/Test4252164.java
+73
-0
test/javax/swing/border/Test6461042.java
test/javax/swing/border/Test6461042.java
+57
-0
未找到文件。
test/javax/swing/border/Test4120351.java
0 → 100644
浏览文件 @
1c3d2eab
/*
* Copyright 1999-2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 4120351
* @summary Tests that the methods createEtchedBorder(int type) and
* createEtchedBorder(int type, Color highlight, Color shadows) are added
* @author Andrey Pikalev
*/
import
java.awt.Color
;
import
javax.swing.BorderFactory
;
import
javax.swing.border.EtchedBorder
;
public
class
Test4120351
{
public
static
void
main
(
String
[]
args
)
{
BorderFactory
.
createEtchedBorder
(
EtchedBorder
.
RAISED
);
BorderFactory
.
createEtchedBorder
(
EtchedBorder
.
LOWERED
);
BorderFactory
.
createEtchedBorder
(
EtchedBorder
.
RAISED
,
Color
.
BLACK
,
Color
.
WHITE
);
BorderFactory
.
createEtchedBorder
(
EtchedBorder
.
LOWERED
,
Color
.
WHITE
,
Color
.
BLACK
);
}
}
test/javax/swing/border/Test4124729.java
0 → 100644
浏览文件 @
1c3d2eab
/*
* Copyright 1999-2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 4124729
* @summary Test that constrtructor LineBorder(?,?,?) is public
* @author Andrey Pikalev
*/
import
java.awt.Color
;
import
javax.swing.border.LineBorder
;
public
class
Test4124729
{
public
static
void
main
(
String
[]
args
)
{
new
LineBorder
(
Color
.
BLUE
,
3
,
true
);
}
}
test/javax/swing/border/Test4243289.html
0 → 100644
浏览文件 @
1c3d2eab
<html>
<body>
When applet starts, you'll see a panel with a TitledBorder with title "Panel Title".
If this title is overstriken with the border line, test fails, otherwise it passes.
<applet
width=
"600"
height=
"300"
code=
"Test4243289.class"
>
</applet>
</body>
</html>
test/javax/swing/border/Test4243289.java
0 → 100644
浏览文件 @
1c3d2eab
/*
* Copyright 1999-2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 4243289
* @summary Tests that TitledBorder do not draw line through its caption
* @author Peter Zhelezniakov
* @run applet/manual=yesno Test4243289.html
*/
import
java.awt.Font
;
import
javax.swing.BorderFactory
;
import
javax.swing.JApplet
;
import
javax.swing.JPanel
;
import
javax.swing.border.TitledBorder
;
public
class
Test4243289
extends
JApplet
{
public
void
init
()
{
Font
font
=
new
Font
(
"Dialog"
,
Font
.
PLAIN
,
12
);
// NON-NLS: the font name
TitledBorder
border
=
BorderFactory
.
createTitledBorder
(
BorderFactory
.
createEtchedBorder
(),
"Panel Title"
,
// NON-NLS: the title of the border
TitledBorder
.
DEFAULT_JUSTIFICATION
,
TitledBorder
.
DEFAULT_POSITION
,
font
);
JPanel
panel
=
new
JPanel
();
panel
.
setBorder
(
border
);
getContentPane
().
add
(
panel
);
}
}
test/javax/swing/border/Test4247606.html
0 → 100644
浏览文件 @
1c3d2eab
<html>
<body>
If the button do not fit into the titled border bounds
and cover the bottom border's line then test fails.
Otherwise test passes.
<applet
width=
"200"
height=
"200"
code=
"Test4247606.class"
>
</applet>
</body>
</html>
test/javax/swing/border/Test4247606.java
0 → 100644
浏览文件 @
1c3d2eab
/*
* Copyright 2001-2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 4247606
* @summary BorderedPane appears wrong with Title Position Below Bottom
* @author Andrey Pikalev
* @run applet/manual=yesno Test4247606.html
*/
import
java.awt.BorderLayout
;
import
java.awt.Color
;
import
javax.swing.BorderFactory
;
import
javax.swing.JApplet
;
import
javax.swing.JButton
;
import
javax.swing.JComponent
;
import
javax.swing.JPanel
;
import
javax.swing.border.Border
;
import
javax.swing.border.TitledBorder
;
public
class
Test4247606
extends
JApplet
{
public
void
init
()
{
JButton
button
=
new
JButton
(
"Button"
);
// NON-NLS: the button text
button
.
setBorder
(
BorderFactory
.
createLineBorder
(
Color
.
red
,
1
));
TitledBorder
border
=
new
TitledBorder
(
"Bordered Pane"
);
// NON-NLS: the panel title
border
.
setTitlePosition
(
TitledBorder
.
BELOW_BOTTOM
);
JPanel
panel
=
create
(
button
,
border
);
panel
.
setBackground
(
Color
.
green
);
getContentPane
().
add
(
create
(
panel
,
BorderFactory
.
createEmptyBorder
(
10
,
10
,
10
,
10
)));
}
private
static
JPanel
create
(
JComponent
component
,
Border
border
)
{
JPanel
panel
=
new
JPanel
(
new
BorderLayout
());
panel
.
setBorder
(
border
);
panel
.
add
(
component
);
return
panel
;
}
}
test/javax/swing/border/Test4252164.html
0 → 100644
浏览文件 @
1c3d2eab
<html>
<body>
Please, ensure that rounded border is filled completely.
It should not contain white points inside.
Use Mouse Wheel to change thickness of the border.
<applet
width=
"400"
height=
"200"
code=
"Test4252164.class"
>
</applet>
</body>
</html>
test/javax/swing/border/Test4252164.java
0 → 100644
浏览文件 @
1c3d2eab
/*
* Copyright 2007-2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 4252164
* @summary Tests rounded LineBorder for components
* @author Sergey Malenkov
* @run applet/manual=yesno Test4252164.html
*/
import
java.awt.Color
;
import
java.awt.event.MouseWheelEvent
;
import
java.awt.event.MouseWheelListener
;
import
javax.swing.JApplet
;
import
javax.swing.JLabel
;
import
javax.swing.JPanel
;
import
javax.swing.border.LineBorder
;
public
class
Test4252164
extends
JApplet
implements
MouseWheelListener
{
private
int
thickness
;
private
JLabel
rounded
;
private
JLabel
straight
;
public
void
mouseWheelMoved
(
MouseWheelEvent
event
)
{
update
(
event
.
getWheelRotation
());
}
public
void
init
()
{
add
(
createUI
());
addMouseWheelListener
(
this
);
}
private
JPanel
createUI
()
{
this
.
rounded
=
new
JLabel
(
"ROUNDED"
);
// NON-NLS: the label for rounded border
this
.
straight
=
new
JLabel
(
"STRAIGHT"
);
// NON-NLS: the label for straight border
JPanel
panel
=
new
JPanel
();
panel
.
add
(
this
.
rounded
);
panel
.
add
(
this
.
straight
);
update
(
10
);
return
panel
;
}
private
void
update
(
int
thickness
)
{
this
.
thickness
+=
thickness
;
this
.
rounded
.
setBorder
(
new
LineBorder
(
Color
.
RED
,
this
.
thickness
,
true
));
this
.
straight
.
setBorder
(
new
LineBorder
(
Color
.
RED
,
this
.
thickness
,
false
));
}
}
test/javax/swing/border/Test6461042.java
0 → 100644
浏览文件 @
1c3d2eab
/*
* Copyright 2006-2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 6461042
* @summary Tests that toString() doesn't cause StackOverflowException
* when a JComponent is its own border
* @author Shannon Hickey
*/
import
java.awt.Component
;
import
java.awt.Graphics
;
import
java.awt.Insets
;
import
javax.swing.JComponent
;
import
javax.swing.border.Border
;
public
class
Test6461042
extends
JComponent
implements
Border
{
public
static
void
main
(
String
[]
args
)
{
new
Test6461042
().
toString
();
}
public
Test6461042
()
{
setBorder
(
this
);
}
public
void
paintBorder
(
Component
c
,
Graphics
g
,
int
x
,
int
y
,
int
width
,
int
height
)
{
}
public
Insets
getBorderInsets
(
Component
c
)
{
return
null
;
}
public
boolean
isBorderOpaque
()
{
return
false
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录