Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell11
提交
cdce31c0
D
dragonwell11
项目概览
openanolis
/
dragonwell11
通知
7
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell11
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
cdce31c0
编写于
7月 20, 2009
作者:
P
peterz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6849331: Nimbus L&F: AbstractRegionPainter's paint context is not initialized
Reviewed-by: rupashka
上级
5069e52f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
34 addition
and
16 deletion
+34
-16
jdk/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java
...lasses/javax/swing/plaf/nimbus/AbstractRegionPainter.java
+34
-16
未找到文件。
jdk/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java
浏览文件 @
cdce31c0
...
...
@@ -227,10 +227,10 @@ public abstract class AbstractRegionPainter implements Painter<JComponent> {
*
* @param x an encoded x value (0...1, or 1...2, or 2...3)
* @return the decoded x value
* @throws IllegalArgumentException
* if {@code x < 0} or {@code x > 3}
*/
protected
final
float
decodeX
(
float
x
)
{
if
(
ctx
.
canvasSize
==
null
)
return
x
;
if
(
x
>=
0
&&
x
<=
1
)
{
return
x
*
leftWidth
;
}
else
if
(
x
>
1
&&
x
<
2
)
{
...
...
@@ -238,7 +238,7 @@ public abstract class AbstractRegionPainter implements Painter<JComponent> {
}
else
if
(
x
>=
2
&&
x
<=
3
)
{
return
((
x
-
2
)
*
rightWidth
)
+
leftWidth
+
centerWidth
;
}
else
{
throw
new
AssertionError
(
"Invalid x"
);
throw
new
IllegalArgumentException
(
"Invalid x"
);
}
}
...
...
@@ -248,10 +248,10 @@ public abstract class AbstractRegionPainter implements Painter<JComponent> {
*
* @param y an encoded y value (0...1, or 1...2, or 2...3)
* @return the decoded y value
* @throws IllegalArgumentException
* if {@code y < 0} or {@code y > 3}
*/
protected
final
float
decodeY
(
float
y
)
{
if
(
ctx
.
canvasSize
==
null
)
return
y
;
if
(
y
>=
0
&&
y
<=
1
)
{
return
y
*
topHeight
;
}
else
if
(
y
>
1
&&
y
<
2
)
{
...
...
@@ -259,7 +259,7 @@ public abstract class AbstractRegionPainter implements Painter<JComponent> {
}
else
if
(
y
>=
2
&&
y
<=
3
)
{
return
((
y
-
2
)
*
bottomHeight
)
+
topHeight
+
centerHeight
;
}
else
{
throw
new
AssertionError
(
"Invalid y"
);
throw
new
IllegalArgumentException
(
"Invalid y"
);
}
}
...
...
@@ -271,10 +271,10 @@ public abstract class AbstractRegionPainter implements Painter<JComponent> {
* @param x an encoded x value of the bezier control point (0...1, or 1...2, or 2...3)
* @param dx the offset distance to the anchor from the control point x
* @return the decoded x location of the control point
* @throws IllegalArgumentException
* if {@code x < 0} or {@code x > 3}
*/
protected
final
float
decodeAnchorX
(
float
x
,
float
dx
)
{
if
(
ctx
.
canvasSize
==
null
)
return
x
+
dx
;
if
(
x
>=
0
&&
x
<=
1
)
{
return
decodeX
(
x
)
+
(
dx
*
leftScale
);
}
else
if
(
x
>
1
&&
x
<
2
)
{
...
...
@@ -282,7 +282,7 @@ public abstract class AbstractRegionPainter implements Painter<JComponent> {
}
else
if
(
x
>=
2
&&
x
<=
3
)
{
return
decodeX
(
x
)
+
(
dx
*
rightScale
);
}
else
{
throw
new
AssertionError
(
"Invalid x"
);
throw
new
IllegalArgumentException
(
"Invalid x"
);
}
}
...
...
@@ -294,10 +294,10 @@ public abstract class AbstractRegionPainter implements Painter<JComponent> {
* @param y an encoded y value of the bezier control point (0...1, or 1...2, or 2...3)
* @param dy the offset distance to the anchor from the control point y
* @return the decoded y position of the control point
* @throws IllegalArgumentException
* if {@code y < 0} or {@code y > 3}
*/
protected
final
float
decodeAnchorY
(
float
y
,
float
dy
)
{
if
(
ctx
.
canvasSize
==
null
)
return
y
+
dy
;
if
(
y
>=
0
&&
y
<=
1
)
{
return
decodeY
(
y
)
+
(
dy
*
topScale
);
}
else
if
(
y
>
1
&&
y
<
2
)
{
...
...
@@ -305,7 +305,7 @@ public abstract class AbstractRegionPainter implements Painter<JComponent> {
}
else
if
(
y
>=
2
&&
y
<=
3
)
{
return
decodeY
(
y
)
+
(
dy
*
bottomScale
);
}
else
{
throw
new
AssertionError
(
"Invalid y"
);
throw
new
IllegalArgumentException
(
"Invalid y"
);
}
}
...
...
@@ -363,6 +363,15 @@ public abstract class AbstractRegionPainter implements Painter<JComponent> {
* @param midpoints
* @param colors
* @return a valid LinearGradientPaint. This method never returns null.
* @throws NullPointerException
* if {@code midpoints} array is null,
* or {@code colors} array is null,
* @throws IllegalArgumentException
* if start and end points are the same points,
* or {@code midpoints.length != colors.length},
* or {@code colors} is less than 2 in size,
* or a {@code midpoints} value is less than 0.0 or greater than 1.0,
* or the {@code midpoints} are not provided in strictly increasing order
*/
protected
final
LinearGradientPaint
decodeGradient
(
float
x1
,
float
y1
,
float
x2
,
float
y2
,
float
[]
midpoints
,
Color
[]
colors
)
{
if
(
x1
==
x2
&&
y1
==
y2
)
{
...
...
@@ -384,6 +393,15 @@ public abstract class AbstractRegionPainter implements Painter<JComponent> {
* @param midpoints
* @param colors
* @return a valid RadialGradientPaint. This method never returns null.
* @throws NullPointerException
* if {@code midpoints} array is null,
* or {@code colors} array is null
* @throws IllegalArgumentException
* if {@code r} is non-positive,
* or {@code midpoints.length != colors.length},
* or {@code colors} is less than 2 in size,
* or a {@code midpoints} value is less than 0.0 or greater than 1.0,
* or the {@code midpoints} are not provided in strictly increasing order
*/
protected
final
RadialGradientPaint
decodeRadialGradient
(
float
x
,
float
y
,
float
r
,
float
[]
midpoints
,
Color
[]
colors
)
{
if
(
r
==
0
f
)
{
...
...
@@ -537,10 +555,10 @@ public abstract class AbstractRegionPainter implements Painter<JComponent> {
this
.
maxVerticalScaleFactor
=
maxV
;
if
(
canvasSize
!=
null
)
{
a
=
i
nsets
.
left
;
b
=
canvasSize
.
width
-
i
nsets
.
right
;
c
=
i
nsets
.
top
;
d
=
canvasSize
.
height
-
i
nsets
.
bottom
;
a
=
stretchingI
nsets
.
left
;
b
=
canvasSize
.
width
-
stretchingI
nsets
.
right
;
c
=
stretchingI
nsets
.
top
;
d
=
canvasSize
.
height
-
stretchingI
nsets
.
bottom
;
this
.
canvasSize
=
canvasSize
;
this
.
inverted
=
inverted
;
if
(
inverted
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录