Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
c2e785bd
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,发现更多精彩内容 >>
提交
c2e785bd
编写于
9月 13, 2013
作者:
P
pchelko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8024170: [SwingNode] Implement cursor change
Reviewed-by: anthony, ant
上级
2eff0cdb
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
88 addition
and
7 deletion
+88
-7
src/macosx/classes/sun/lwawt/LWLightweightFramePeer.java
src/macosx/classes/sun/lwawt/LWLightweightFramePeer.java
+7
-5
src/share/classes/sun/swing/JLightweightFrame.java
src/share/classes/sun/swing/JLightweightFrame.java
+29
-1
src/share/classes/sun/swing/LightweightContent.java
src/share/classes/sun/swing/LightweightContent.java
+8
-0
src/share/classes/sun/swing/SwingAccessor.java
src/share/classes/sun/swing/SwingAccessor.java
+29
-0
src/solaris/classes/sun/awt/X11/XLightweightFramePeer.java
src/solaris/classes/sun/awt/X11/XLightweightFramePeer.java
+7
-0
src/windows/classes/sun/awt/windows/WComponentPeer.java
src/windows/classes/sun/awt/windows/WComponentPeer.java
+1
-1
src/windows/classes/sun/awt/windows/WLightweightFramePeer.java
...indows/classes/sun/awt/windows/WLightweightFramePeer.java
+7
-0
未找到文件。
src/macosx/classes/sun/lwawt/LWLightweightFramePeer.java
浏览文件 @
c2e785bd
...
...
@@ -34,6 +34,8 @@ import java.awt.dnd.DropTarget;
import
sun.awt.CausedFocusEvent
;
import
sun.awt.LightweightFrame
;
import
sun.swing.JLightweightFrame
;
import
sun.swing.SwingAccessor
;
public
class
LWLightweightFramePeer
extends
LWWindowPeer
{
...
...
@@ -90,11 +92,6 @@ public class LWLightweightFramePeer extends LWWindowPeer {
setBounds
(
x
,
y
,
w
,
h
,
op
,
true
,
false
);
}
@Override
public
void
updateCursorImmediately
()
{
// TODO: tries to switch to the awt/fx toolkit thread and causes a deadlock on macosx
}
@Override
public
void
addDropTarget
(
DropTarget
dt
)
{
}
...
...
@@ -112,4 +109,9 @@ public class LWLightweightFramePeer extends LWWindowPeer {
public
void
ungrab
()
{
getLwTarget
().
ungrabFocus
();
}
@Override
public
void
updateCursorImmediately
()
{
SwingAccessor
.
getJLightweightFrameAccessor
().
updateCursor
((
JLightweightFrame
)
getLwTarget
());
}
}
src/share/classes/sun/swing/JLightweightFrame.java
浏览文件 @
c2e785bd
...
...
@@ -33,8 +33,9 @@ import java.awt.Dimension;
import
java.awt.EventQueue
;
import
java.awt.Graphics
;
import
java.awt.Graphics2D
;
import
java.awt.MouseInfo
;
import
java.awt.Point
;
import
java.awt.Rectangle
;
import
java.awt.event.ComponentListener
;
import
java.awt.event.ContainerEvent
;
import
java.awt.event.ContainerListener
;
import
java.awt.image.BufferedImage
;
...
...
@@ -48,6 +49,7 @@ import javax.swing.JPanel;
import
javax.swing.JRootPane
;
import
javax.swing.LayoutFocusTraversalPolicy
;
import
javax.swing.RootPaneContainer
;
import
javax.swing.SwingUtilities
;
import
sun.awt.LightweightFrame
;
import
sun.security.action.GetPropertyAction
;
...
...
@@ -88,6 +90,15 @@ public final class JLightweightFrame extends LightweightFrame implements RootPan
private
PropertyChangeListener
layoutSizeListener
;
static
{
SwingAccessor
.
setJLightweightFrameAccessor
(
new
SwingAccessor
.
JLightweightFrameAccessor
()
{
@Override
public
void
updateCursor
(
JLightweightFrame
frame
)
{
frame
.
updateClientCursor
();
}
});
}
/**
* Constructs a new, initially invisible {@code JLightweightFrame}
* instance.
...
...
@@ -358,4 +369,21 @@ public final class JLightweightFrame extends LightweightFrame implements RootPan
public
Component
getGlassPane
()
{
return
getRootPane
().
getGlassPane
();
}
/*
* Notifies client toolkit that it should change a cursor.
*
* Called from the peer via SwingAccessor, because the
* Component.updateCursorImmediately method is final
* and could not be overridden.
*/
private
void
updateClientCursor
()
{
Point
p
=
MouseInfo
.
getPointerInfo
().
getLocation
();
SwingUtilities
.
convertPointFromScreen
(
p
,
this
);
Component
target
=
SwingUtilities
.
getDeepestComponentAt
(
this
,
p
.
x
,
p
.
y
);
if
(
target
!=
null
)
{
content
.
setCursor
(
target
.
getCursor
());
}
}
}
src/share/classes/sun/swing/LightweightContent.java
浏览文件 @
c2e785bd
...
...
@@ -26,6 +26,7 @@
package
sun.swing
;
import
javax.swing.JComponent
;
import
java.awt.Cursor
;
/**
* The interface by means of which the {@link JLightweightFrame} class
...
...
@@ -179,4 +180,11 @@ public interface LightweightContent {
* application that the content minimum size has changed.
*/
public
void
minimumSizeChanged
(
int
width
,
int
height
);
/**
* {@code JLightweightFrame} calls this method to notify the client
* application that in needs to set a cursor
* @param cursor a cursor to set
*/
default
public
void
setCursor
(
Cursor
cursor
)
{
}
}
src/share/classes/sun/swing/SwingAccessor.java
浏览文件 @
c2e785bd
...
...
@@ -71,6 +71,16 @@ public final class SwingAccessor {
Object
state
,
boolean
forDrop
);
}
/**
* An accessor for the JLightweightFrame class.
*/
public
interface
JLightweightFrameAccessor
{
/**
* Notifies the JLightweight frame that it needs to update a cursor
*/
void
updateCursor
(
JLightweightFrame
frame
);
}
/**
* The javax.swing.text.JTextComponent class accessor object.
*/
...
...
@@ -93,4 +103,23 @@ public final class SwingAccessor {
return
jtextComponentAccessor
;
}
/**
* The JLightweightFrame class accessor object
*/
private
static
JLightweightFrameAccessor
jLightweightFrameAccessor
;
/**
* Set an accessor object for the JLightweightFrame class.
*/
public
static
void
setJLightweightFrameAccessor
(
JLightweightFrameAccessor
accessor
)
{
jLightweightFrameAccessor
=
accessor
;
}
/**
* Retrieve the accessor object for the JLightweightFrame class
*/
public
static
JLightweightFrameAccessor
getJLightweightFrameAccessor
()
{
return
jLightweightFrameAccessor
;
}
}
src/solaris/classes/sun/awt/X11/XLightweightFramePeer.java
浏览文件 @
c2e785bd
...
...
@@ -28,6 +28,8 @@ package sun.awt.X11;
import
java.awt.Graphics
;
import
sun.awt.LightweightFrame
;
import
sun.swing.JLightweightFrame
;
import
sun.swing.SwingAccessor
;
public
class
XLightweightFramePeer
extends
XFramePeer
{
...
...
@@ -62,4 +64,9 @@ public class XLightweightFramePeer extends XFramePeer {
getLwTarget
().
ungrabFocus
();
}
}
@Override
public
void
updateCursorImmediately
()
{
SwingAccessor
.
getJLightweightFrameAccessor
().
updateCursor
((
JLightweightFrame
)
getLwTarget
());
}
}
src/windows/classes/sun/awt/windows/WComponentPeer.java
浏览文件 @
c2e785bd
...
...
@@ -656,7 +656,7 @@ public abstract class WComponentPeer extends WObjectPeer
_setFont
(
f
);
}
public
synchronized
native
void
_setFont
(
Font
f
);
public
final
void
updateCursorImmediately
()
{
public
void
updateCursorImmediately
()
{
WGlobalCursorManager
.
getCursorManager
().
updateCursorImmediately
();
}
...
...
src/windows/classes/sun/awt/windows/WLightweightFramePeer.java
浏览文件 @
c2e785bd
...
...
@@ -31,6 +31,8 @@ import java.awt.event.ComponentEvent;
import
java.awt.event.MouseEvent
;
import
sun.awt.LightweightFrame
;
import
sun.swing.JLightweightFrame
;
import
sun.swing.SwingAccessor
;
public
class
WLightweightFramePeer
extends
WFramePeer
{
...
...
@@ -83,4 +85,9 @@ public class WLightweightFramePeer extends WFramePeer {
public
void
ungrab
()
{
getLwTarget
().
ungrabFocus
();
}
@Override
public
void
updateCursorImmediately
()
{
SwingAccessor
.
getJLightweightFrameAccessor
().
updateCursor
((
JLightweightFrame
)
getLwTarget
());
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录