Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
47a08914
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
3
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,发现更多精彩内容 >>
提交
47a08914
编写于
9月 12, 2008
作者:
T
tdv
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6748082: remove platform-specific code from SwingUtilities2.isDisplayLocal
Reviewed-by: prr, tdv Contributed-by: rkennke@kennke.org
上级
1709d153
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
25 addition
and
19 deletion
+25
-19
src/share/classes/sun/java2d/SunGraphicsEnvironment.java
src/share/classes/sun/java2d/SunGraphicsEnvironment.java
+7
-0
src/share/classes/sun/swing/SwingUtilities2.java
src/share/classes/sun/swing/SwingUtilities2.java
+9
-16
src/solaris/classes/sun/awt/X11GraphicsEnvironment.java
src/solaris/classes/sun/awt/X11GraphicsEnvironment.java
+3
-2
src/solaris/native/sun/awt/fontpath.c
src/solaris/native/sun/awt/fontpath.c
+1
-1
src/windows/classes/sun/awt/Win32GraphicsEnvironment.java
src/windows/classes/sun/awt/Win32GraphicsEnvironment.java
+5
-0
未找到文件。
src/share/classes/sun/java2d/SunGraphicsEnvironment.java
浏览文件 @
47a08914
...
...
@@ -1272,6 +1272,13 @@ public abstract class SunGraphicsEnvironment extends GraphicsEnvironment
displayChanger
.
notifyPaletteChanged
();
}
/**
* Returns true when the display is local, false for remote displays.
*
* @return true when the display is local, false for remote displays
*/
public
abstract
boolean
isDisplayLocal
();
/*
* ----DISPLAY CHANGE SUPPORT----
*/
...
...
src/share/classes/sun/swing/SwingUtilities2.java
浏览文件 @
47a08914
...
...
@@ -55,6 +55,7 @@ import java.io.*;
import
java.util.*
;
import
sun.font.FontDesignMetrics
;
import
sun.font.FontManager
;
import
sun.java2d.SunGraphicsEnvironment
;
import
java.util.concurrent.Callable
;
import
java.util.concurrent.Future
;
...
...
@@ -1482,22 +1483,14 @@ public class SwingUtilities2 {
* appear capable of performing gamma correction needed for LCD text.
*/
public
static
boolean
isLocalDisplay
()
{
try
{
// On Windows just return true. Permission to read os.name
// is granted to all code but wrapped in try to be safe.
if
(
OSInfo
.
getOSType
()
==
OSInfo
.
OSType
.
WINDOWS
)
{
return
true
;
}
// Else probably Solaris or Linux in which case may be remote X11
Class
x11Class
=
Class
.
forName
(
"sun.awt.X11GraphicsEnvironment"
);
Method
isDisplayLocalMethod
=
x11Class
.
getMethod
(
"isDisplayLocal"
,
new
Class
[
0
]);
return
(
Boolean
)
isDisplayLocalMethod
.
invoke
(
null
,
(
Object
[])
null
);
}
catch
(
Throwable
t
)
{
}
// If we get here we're most likely being run on some other O/S
// or we didn't properly detect Windows.
return
true
;
boolean
isLocal
;
GraphicsEnvironment
ge
=
GraphicsEnvironment
.
getLocalGraphicsEnvironment
();
if
(
ge
instanceof
SunGraphicsEnvironment
)
{
isLocal
=
((
SunGraphicsEnvironment
)
ge
).
isDisplayLocal
();
}
else
{
isLocal
=
true
;
}
return
isLocal
;
}
/**
...
...
src/solaris/classes/sun/awt/X11GraphicsEnvironment.java
浏览文件 @
47a08914
...
...
@@ -209,7 +209,7 @@ public class X11GraphicsEnvironment
private
static
native
int
checkShmExt
();
private
static
native
String
getDisplayString
();
private
static
Boolean
isDisplayLocal
;
private
Boolean
isDisplayLocal
;
/**
* This should only be called from the static initializer, so no need for
...
...
@@ -234,7 +234,8 @@ public class X11GraphicsEnvironment
return
getScreenDevices
()[
getDefaultScreenNum
()];
}
public
static
boolean
isDisplayLocal
()
{
@Override
public
boolean
isDisplayLocal
()
{
if
(
isDisplayLocal
==
null
)
{
SunToolkit
.
awtLock
();
try
{
...
...
src/solaris/native/sun/awt/fontpath.c
浏览文件 @
47a08914
...
...
@@ -156,7 +156,7 @@ jboolean isDisplayLocal(JNIEnv *env) {
isLocal
=
JNU_CallStaticMethodByName
(
env
,
NULL
,
"sun/awt/X11GraphicsEnvironment"
,
"isDisplayLocal"
,
"
_
isDisplayLocal"
,
"()Z"
).
z
;
isLocalSet
=
True
;
return
isLocal
;
...
...
src/windows/classes/sun/awt/Win32GraphicsEnvironment.java
浏览文件 @
47a08914
...
...
@@ -393,4 +393,9 @@ public class Win32GraphicsEnvironment
private
static
void
dwmCompositionChanged
(
boolean
enabled
)
{
isDWMCompositionEnabled
=
enabled
;
}
@Override
public
boolean
isDisplayLocal
()
{
return
true
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录