public class DragSourceEvent extends EventObject
DragSourceDragEvent
和
DragSourceDropEvent
基类。
DragSourceEvent
s时产生拖进来,移动,或出口下降的站点,在下降时的动作变化,当拖动结束。的位置所产生的DragSourceEvent
指定屏幕坐标,鼠标光标的位置在这个事件发生。
在多屏幕环境下虚拟设备,光标位置在空引发剂GraphicsConfiguration
坐标系统指定的空引发剂GraphicsConfiguration
的Component
上为当前拖动操作拖动手势被公认的GraphicsConfiguration
。如果光标所在的位置是在引发剂GraphicsConfiguration
的界限,报道的坐标卡装在那GraphicsConfiguration
界限。
在一个虚拟设备的多屏幕环境中,在相应的虚拟坐标系统中指定位置。如果光标位置在虚拟设备的边界之外,则所报告的坐标被夹在虚拟设备的范围内。
source
Constructor and Description |
---|
DragSourceEvent(DragSourceContext dsc)
构建一个
DragSourceEvent 指定
DragSourceContext 。
|
DragSourceEvent(DragSourceContext dsc, int x, int y)
构建一个
DragSourceEvent 指定
DragSourceContext ,和光标的位置坐标。
|
Modifier and Type | Method and Description |
---|---|
DragSourceContext |
getDragSourceContext()
这个方法返回
DragSourceContext 起源事件。
|
Point |
getLocation()
此方法返回一个
Point 表示目前这一事件发生在屏幕坐标的光标位置,或
null 如果光标所在的位置是不是这个事件的指定。
|
int |
getX()
此方法返回此事件发生时的屏幕坐标中的光标位置的水平坐标,或为零,如果此事件未指定光标位置。
|
int |
getY()
此方法返回此事件发生时的屏幕坐标中的光标位置的垂直坐标,或为零,如果此事件未指定光标位置。
|
getSource, toString
public DragSourceEvent(DragSourceContext dsc)
DragSourceEvent
指定
DragSourceContext
。这
DragSourceEvent
坐标都没有指定,那么
getLocation
将返回
null
此事件。
dsc
-
DragSourceContext
null
dsc
IllegalArgumentException
。
getLocation()
public DragSourceEvent(DragSourceContext dsc, int x, int y)
DragSourceEvent
指定
DragSourceContext
,和光标的位置坐标。
dsc
-
DragSourceContext
x
-光标位置的横坐标
y
-光标位置的垂直坐标
null
dsc
IllegalArgumentException
。
public DragSourceContext getDragSourceContext()
DragSourceContext
起源事件。
DragSourceContext
起源事件
public Point getLocation()
Point
表示目前这一事件发生在屏幕坐标的光标位置,或
null
如果光标所在的位置是不是这个事件的指定。
Point
指示光标位置或
null
如果没有指定光标位置
public int getX()
public int getY()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.