Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
555a6d52
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看板
提交
555a6d52
编写于
10月 29, 2015
作者:
A
aivanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8134828: Scrollbar thumb disappears with Nimbus L&F
Reviewed-by: alexsch, alexp
上级
29617d3c
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
118 addition
and
18 deletion
+118
-18
src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java
...lasses/javax/swing/plaf/nimbus/AbstractRegionPainter.java
+0
-4
src/share/classes/javax/swing/plaf/nimbus/skin.laf
src/share/classes/javax/swing/plaf/nimbus/skin.laf
+11
-7
src/share/classes/javax/swing/plaf/synth/SynthProgressBarUI.java
...re/classes/javax/swing/plaf/synth/SynthProgressBarUI.java
+14
-7
test/javax/swing/plaf/nimbus/8041642/ScrollBarThumbVisibleTest.java
.../swing/plaf/nimbus/8041642/ScrollBarThumbVisibleTest.java
+93
-0
未找到文件。
src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java
浏览文件 @
555a6d52
...
...
@@ -625,10 +625,6 @@ public abstract class AbstractRegionPainter implements Painter<JComponent> {
// check if we can scale to the requested size
Dimension
canvas
=
ctx
.
canvasSize
;
Insets
insets
=
ctx
.
stretchingInsets
;
if
(
insets
.
left
+
insets
.
right
>
w
||
insets
.
top
+
insets
.
bottom
>
h
)
{
return
;
}
if
(
w
<=
(
canvas
.
width
*
ctx
.
maxHorizontalScaleFactor
)
&&
h
<=
(
canvas
.
height
*
ctx
.
maxVerticalScaleFactor
))
{
// get image at canvas size
VolatileImage
img
=
getImage
(
g
.
getDeviceConfiguration
(),
c
,
canvas
.
width
,
canvas
.
height
,
extendedCacheKeys
);
...
...
src/share/classes/javax/swing/plaf/nimbus/skin.laf
浏览文件 @
555a6d52
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 1998, 201
4
, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 1998, 201
5
, 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
...
...
@@ -16195,6 +16195,10 @@
<dimension width="150" height="19"/>
</uiProperty>
<uiProperty name="cycleTime" type="INT" value="250"/>
<uiProperty name="minBarSize" type="DIMENSION">
<dimension width="6" height="6"/>
</uiProperty>
<uiProperty name="glowWidth" type="INT" value="2"/>
</uiproperties>
</style>
<backgroundStates>
...
...
@@ -16351,7 +16355,7 @@
<canvas>
<size width="27" height="19"/>
<nextLayerNameIndex>2</nextLayerNameIndex>
<stretchingInsets top="
5" bottom="5" left="5" right="5
"/>
<stretchingInsets top="
3" bottom="3" left="3" right="3
"/>
<layer name="Layer 1">
<opacity>1.0</opacity>
<fillOpacity>1.0</fillOpacity>
...
...
@@ -16444,7 +16448,7 @@
<canvas>
<size width="27" height="19"/>
<nextLayerNameIndex>2</nextLayerNameIndex>
<stretchingInsets top="
5" bottom="5" left="5" right="5
"/>
<stretchingInsets top="
3" bottom="3" left="3" right="3
"/>
<layer name="Layer 1">
<opacity>1.0</opacity>
<fillOpacity>1.0</fillOpacity>
...
...
@@ -16528,7 +16532,7 @@
<canvas>
<size width="30" height="13"/>
<nextLayerNameIndex>2</nextLayerNameIndex>
<stretchingInsets top="
5" bottom="5" left="5" right="5
"/>
<stretchingInsets top="
3" bottom="3" left="3" right="3
"/>
<layer name="Layer 1">
<opacity>1.0</opacity>
<fillOpacity>1.0</fillOpacity>
...
...
@@ -16619,7 +16623,7 @@
<canvas>
<size width="27" height="19"/>
<nextLayerNameIndex>2</nextLayerNameIndex>
<stretchingInsets top="
5" bottom="5" left="5" right="5
"/>
<stretchingInsets top="
3" bottom="3" left="3" right="3
"/>
<layer name="Layer 1">
<opacity>1.0</opacity>
<fillOpacity>1.0</fillOpacity>
...
...
@@ -16701,7 +16705,7 @@
<canvas>
<size width="27" height="19"/>
<nextLayerNameIndex>2</nextLayerNameIndex>
<stretchingInsets top="
5" bottom="5" left="5" right="5
"/>
<stretchingInsets top="
3" bottom="3" left="3" right="3
"/>
<layer name="Layer 1">
<opacity>1.0</opacity>
<fillOpacity>1.0</fillOpacity>
...
...
@@ -16785,7 +16789,7 @@
<canvas>
<size width="30" height="13"/>
<nextLayerNameIndex>2</nextLayerNameIndex>
<stretchingInsets top="
5" bottom="5" left="5" right="5
"/>
<stretchingInsets top="
3" bottom="3" left="3" right="3
"/>
<layer name="Layer 1">
<opacity>1.0</opacity>
<fillOpacity>1.0</fillOpacity>
src/share/classes/javax/swing/plaf/synth/SynthProgressBarUI.java
浏览文件 @
555a6d52
/*
* Copyright (c) 2002, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 201
5
, 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
...
...
@@ -49,6 +49,8 @@ public class SynthProgressBarUI extends BasicProgressBarUI
private
boolean
paintOutsideClip
;
private
boolean
tileWhenIndeterminate
;
//whether to tile indeterminate painting
private
int
tileWidth
;
//the width of each tile
private
Dimension
minBarSize
;
// minimal visible bar size
private
int
glowWidth
;
// Glow around the bar foreground
/**
* Creates a new UI object for the given component.
...
...
@@ -114,6 +116,8 @@ public class SynthProgressBarUI extends BasicProgressBarUI
tileWidth
*=
0.784
;
}
}
minBarSize
=
(
Dimension
)
style
.
get
(
context
,
"ProgressBar.minBarSize"
);
glowWidth
=
style
.
getInt
(
context
,
"ProgressBar.glowWidth"
,
0
);
context
.
dispose
();
}
...
...
@@ -258,7 +262,7 @@ public class SynthProgressBarUI extends BasicProgressBarUI
if
(!
SynthLookAndFeel
.
isLeftToRight
(
pBar
))
{
x
=
pBar
.
getWidth
()
-
pBarInsets
.
right
-
width
-
progressPadding
;
-
progressPadding
-
glowWidth
;
}
}
else
{
// JProgressBar.VERTICAL
x
=
pBarInsets
.
left
+
progressPadding
;
...
...
@@ -271,9 +275,9 @@ public class SynthProgressBarUI extends BasicProgressBarUI
y
=
pBar
.
getHeight
()
-
pBarInsets
.
bottom
-
height
-
progressPadding
;
// When the progress bar is vertical we always paint
// from bottom to top, not matter what the component
// orientation is.
if
(
SynthLookAndFeel
.
isLeftToRight
(
pBar
))
{
y
-=
glowWidth
;
}
}
}
}
else
{
...
...
@@ -307,9 +311,12 @@ public class SynthProgressBarUI extends BasicProgressBarUI
}
g
.
setClip
(
clip
);
}
else
{
if
(
minBarSize
==
null
||
(
width
>=
minBarSize
.
width
&&
height
>=
minBarSize
.
height
))
{
context
.
getPainter
().
paintProgressBarForeground
(
context
,
g
,
x
,
y
,
width
,
height
,
pBar
.
getOrientation
());
}
}
if
(
pBar
.
isStringPainted
())
{
paintText
(
context
,
g
,
pBar
.
getString
());
...
...
test/javax/swing/plaf/nimbus/8041642/ScrollBarThumbVisibleTest.java
0 → 100644
浏览文件 @
555a6d52
/*
* Copyright (c) 2015, 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 8134828
@summary Scrollbar thumb disappears with Nimbus L&F
@author Semyon Sadetsky
*/
import
javax.swing.*
;
import
java.awt.*
;
public
class
ScrollBarThumbVisibleTest
{
private
static
JFrame
frame
;
private
static
Point
point
;
private
static
JScrollBar
bar
;
public
static
void
main
(
String
[]
args
)
throws
Exception
{
for
(
UIManager
.
LookAndFeelInfo
info
:
UIManager
.
getInstalledLookAndFeels
())
{
if
(
"Nimbus"
.
equals
(
info
.
getName
()))
{
try
{
UIManager
.
setLookAndFeel
(
info
.
getClassName
());
}
catch
(
Exception
ex
)
{
}
break
;
}
}
try
{
SwingUtilities
.
invokeAndWait
(
new
Runnable
()
{
public
void
run
()
{
frame
=
new
JFrame
();
frame
.
setUndecorated
(
true
);
frame
.
setDefaultCloseOperation
(
JFrame
.
EXIT_ON_CLOSE
);
setup
(
frame
);
}
});
final
Robot
robot
=
new
Robot
();
robot
.
delay
(
200
);
robot
.
waitForIdle
();
SwingUtilities
.
invokeAndWait
(
new
Runnable
()
{
@Override
public
void
run
()
{
point
=
bar
.
getLocationOnScreen
();
}
});
Color
color1
=
robot
.
getPixelColor
(
point
.
x
+
48
,
point
.
y
+
55
);
Color
color2
=
robot
.
getPixelColor
(
point
.
x
+
48
,
point
.
y
+
125
);
System
.
out
.
println
(
color1
);
System
.
out
.
println
(
color2
);
if
(
color1
.
equals
(
color2
))
{
throw
new
RuntimeException
(
"Thump is not visible"
);
}
}
finally
{
SwingUtilities
.
invokeAndWait
(
new
Runnable
()
{
@Override
public
void
run
()
{
frame
.
dispose
();
}
});
}
System
.
out
.
println
(
"ok"
);
}
static
void
setup
(
JFrame
frame
)
{
bar
=
new
JScrollBar
(
Adjustable
.
VERTICAL
,
500
,
0
,
0
,
1000
);
frame
.
getContentPane
().
add
(
bar
);
frame
.
setSize
(
50
,
250
);
frame
.
setLocation
(
100
,
100
);
frame
.
setVisible
(
true
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录