Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
e9b77ff3
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看板
提交
e9b77ff3
编写于
6月 15, 2010
作者:
M
malenkov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
5066685: BorderFactory lacks SoftBevelBorder support
Reviewed-by: alexp
上级
11c9e4cc
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
123 addition
and
6 deletion
+123
-6
src/share/classes/javax/swing/BorderFactory.java
src/share/classes/javax/swing/BorderFactory.java
+123
-6
未找到文件。
src/share/classes/javax/swing/BorderFactory.java
浏览文件 @
e9b77ff3
/*
* Copyright (c) 1997, 20
05
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 20
10
, 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
...
...
@@ -26,7 +26,6 @@ package javax.swing;
import
java.awt.Color
;
import
java.awt.Font
;
import
javax.swing.JComponent
;
import
javax.swing.border.*
;
/**
...
...
@@ -74,10 +73,20 @@ public class BorderFactory
return
new
LineBorder
(
color
,
thickness
);
}
// public static Border createLineBorder(Color color, int thickness,
// boolean drawRounded) {
// return new JLineBorder(color, thickness, drawRounded);
// }
/**
* Creates a line border with the specified color, thickness, and corner shape.
*
* @param color the color of the border
* @param thickness the thickness of the border
* @param rounded whether or not border corners should be round
* @return the {@code Border} object
*
* @see LineBorder#LineBorder(Color, int, boolean)
* @since 1.7
*/
public
static
Border
createLineBorder
(
Color
color
,
int
thickness
,
boolean
rounded
)
{
return
new
LineBorder
(
color
,
thickness
,
rounded
);
}
//// BevelBorder /////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
...
...
@@ -180,7 +189,115 @@ public class BorderFactory
}
return
null
;
}
//// SoftBevelBorder ///////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
private
static
Border
sharedSoftRaisedBevel
;
private
static
Border
sharedSoftLoweredBevel
;
/**
* Creates a beveled border with a raised edge and softened corners,
* using brighter shades of the component's current background color
* for highlighting, and darker shading for shadows.
* In a raised border, highlights are on top and shadows are underneath.
*
* @return the {@code Border} object
*
* @since 1.7
*/
public
static
Border
createRaisedSoftBevelBorder
()
{
if
(
sharedSoftRaisedBevel
==
null
)
{
sharedSoftRaisedBevel
=
new
SoftBevelBorder
(
BevelBorder
.
RAISED
);
}
return
sharedSoftRaisedBevel
;
}
/**
* Creates a beveled border with a lowered edge and softened corners,
* using brighter shades of the component's current background color
* for highlighting, and darker shading for shadows.
* In a lowered border, shadows are on top and highlights are underneath.
*
* @return the {@code Border} object
*
* @since 1.7
*/
public
static
Border
createLoweredSoftBevelBorder
()
{
if
(
sharedSoftLoweredBevel
==
null
)
{
sharedSoftLoweredBevel
=
new
SoftBevelBorder
(
BevelBorder
.
LOWERED
);
}
return
sharedSoftLoweredBevel
;
}
/**
* Creates a beveled border of the specified type with softened corners,
* using brighter shades of the component's current background color
* for highlighting, and darker shading for shadows.
* The type is either {@link BevelBorder#RAISED} or {@link BevelBorder#LOWERED}.
*
* @param type a type of a bevel
* @return the {@code Border} object or {@code null}
* if the specified type is not valid
*
* @see BevelBorder#BevelBorder(int)
* @since 1.7
*/
public
static
Border
createSoftBevelBorder
(
int
type
)
{
if
(
type
==
BevelBorder
.
RAISED
)
{
return
createRaisedSoftBevelBorder
();
}
if
(
type
==
BevelBorder
.
LOWERED
)
{
return
createLoweredSoftBevelBorder
();
}
return
null
;
}
/**
* Creates a beveled border of the specified type with softened corners,
* using the specified highlighting and shadowing.
* The type is either {@link BevelBorder#RAISED} or {@link BevelBorder#LOWERED}.
* The outer edge of the highlight area uses
* a brighter shade of the {@code highlight} color.
* The inner edge of the shadow area uses
* a brighter shade of the {@code shadow} color.
*
* @param type a type of a bevel
* @param highlight a basic color of the highlight area
* @param shadow a basic color of the shadow area
* @return the {@code Border} object
*
* @see BevelBorder#BevelBorder(int, Color, Color)
* @since 1.7
*/
public
static
Border
createSoftBevelBorder
(
int
type
,
Color
highlight
,
Color
shadow
)
{
return
new
BevelBorder
(
type
,
highlight
,
shadow
);
}
/**
* Creates a beveled border of the specified type with softened corners,
* using the specified colors for the inner and outer edges
* of the highlight and the shadow areas.
* The type is either {@link BevelBorder#RAISED} or {@link BevelBorder#LOWERED}.
* Note: The shadow inner and outer colors are switched
* for a lowered bevel border.
*
* @param type a type of a bevel
* @param highlightOuter a color of the outer edge of the highlight area
* @param highlightInner a color of the inner edge of the highlight area
* @param shadowOuter a color of the outer edge of the shadow area
* @param shadowInner a color of the inner edge of the shadow area
* @return the {@code Border} object
*
* @see BevelBorder#BevelBorder(int, Color, Color, Color, Color)
* @since 1.7
*/
public
static
Border
createSoftBevelBorder
(
int
type
,
Color
highlightOuter
,
Color
highlightInner
,
Color
shadowOuter
,
Color
shadowInner
)
{
return
new
BevelBorder
(
type
,
highlightOuter
,
highlightInner
,
shadowOuter
,
shadowInner
);
}
//// EtchedBorder ///////////////////////////////////////////////////////////
static
final
Border
sharedEtchedBorder
=
new
EtchedBorder
();
private
static
Border
sharedRaisedEtchedBorder
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录