本文整理汇总了Java中java.awt.dnd.DropTarget.getDefaultActions方法的典型用法代码示例。如果您正苦于以下问题:Java DropTarget.getDefaultActions方法的具体用法?Java DropTarget.getDefaultActions怎么用?Java DropTarget.getDefaultActions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.dnd.DropTarget
的用法示例。
在下文中一共展示了DropTarget.getDefaultActions方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processEnterMessage
import java.awt.dnd.DropTarget; //导入方法依赖的package包/类
/**
* actual processing on EventQueue Thread
*/
protected void processEnterMessage(SunDropTargetEvent event) {
Component c = (Component)event.getSource();
DropTarget dt = c.getDropTarget();
Point hots = event.getPoint();
local = getJVMLocalSourceTransferable();
if (currentDTC != null) { // some wreckage from last time
currentDTC.removeNotify();
currentDTC = null;
}
if (c.isShowing() && dt != null && dt.isActive()) {
currentDT = dt;
currentDTC = currentDT.getDropTargetContext();
currentDTC.addNotify(this);
currentA = dt.getDefaultActions();
try {
((DropTargetListener)dt).dragEnter(new DropTargetDragEvent(currentDTC,
hots,
currentDA,
currentSA));
} catch (Exception e) {
e.printStackTrace();
currentDA = DnDConstants.ACTION_NONE;
}
} else {
currentDT = null;
currentDTC = null;
currentDA = DnDConstants.ACTION_NONE;
currentSA = DnDConstants.ACTION_NONE;
currentA = DnDConstants.ACTION_NONE;
}
}
示例2: processDropMessage
import java.awt.dnd.DropTarget; //导入方法依赖的package包/类
/**
*
*/
protected void processDropMessage(SunDropTargetEvent event) {
Component c = (Component)event.getSource();
Point hots = event.getPoint();
DropTarget dt = c.getDropTarget();
dropStatus = STATUS_WAIT; // drop pending ACK
dropComplete = false;
if (c.isShowing() && dt != null && dt.isActive()) {
DropTargetContext dtc = dt.getDropTargetContext();
currentDT = dt;
if (currentDTC != null) {
currentDTC.removeNotify();
}
currentDTC = dtc;
currentDTC.addNotify(this);
currentA = dt.getDefaultActions();
synchronized(_globalLock) {
if ((local = getJVMLocalSourceTransferable()) != null)
setCurrentJVMLocalSourceTransferable(null);
}
dropInProcess = true;
try {
((DropTargetListener)dt).drop(new DropTargetDropEvent(dtc,
hots,
currentDA,
currentSA,
local != null));
} finally {
if (dropStatus == STATUS_WAIT) {
rejectDrop();
} else if (dropComplete == false) {
dropComplete(false);
}
dropInProcess = false;
}
} else {
rejectDrop();
}
}
示例3: processEnterMessage
import java.awt.dnd.DropTarget; //导入方法依赖的package包/类
/**
* actual processing on EventQueue Thread
*/
protected void processEnterMessage(SunDropTargetEvent event) {
Component c = (Component)event.getSource();
DropTarget dt = c.getDropTarget();
Point hots = event.getPoint();
local = getJVMLocalSourceTransferable();
DropTargetContextAccessor acc =
AWTAccessor.getDropTargetContextAccessor();
if (currentDTC != null) { // some wreckage from last time
acc.reset(currentDTC);
currentDTC = null;
}
if (c.isShowing() && dt != null && dt.isActive()) {
currentDT = dt;
currentDTC = currentDT.getDropTargetContext();
acc.setDropTargetContextPeer(currentDTC, this);
currentA = dt.getDefaultActions();
try {
((DropTargetListener)dt).dragEnter(new DropTargetDragEvent(currentDTC,
hots,
currentDA,
currentSA));
} catch (Exception e) {
e.printStackTrace();
currentDA = DnDConstants.ACTION_NONE;
}
} else {
currentDT = null;
currentDTC = null;
currentDA = DnDConstants.ACTION_NONE;
currentSA = DnDConstants.ACTION_NONE;
currentA = DnDConstants.ACTION_NONE;
}
}
示例4: processDropMessage
import java.awt.dnd.DropTarget; //导入方法依赖的package包/类
/**
*
*/
protected void processDropMessage(SunDropTargetEvent event) {
Component c = (Component)event.getSource();
Point hots = event.getPoint();
DropTarget dt = c.getDropTarget();
dropStatus = STATUS_WAIT; // drop pending ACK
dropComplete = false;
if (c.isShowing() && dt != null && dt.isActive()) {
DropTargetContext dtc = dt.getDropTargetContext();
currentDT = dt;
DropTargetContextAccessor acc =
AWTAccessor.getDropTargetContextAccessor();
if (currentDTC != null) {
acc.reset(currentDTC);
}
currentDTC = dtc;
acc.setDropTargetContextPeer(currentDTC, this);
currentA = dt.getDefaultActions();
synchronized(_globalLock) {
if ((local = getJVMLocalSourceTransferable()) != null)
setCurrentJVMLocalSourceTransferable(null);
}
dropInProcess = true;
try {
((DropTargetListener)dt).drop(new DropTargetDropEvent(dtc,
hots,
currentDA,
currentSA,
local != null));
} finally {
if (dropStatus == STATUS_WAIT) {
rejectDrop();
} else if (dropComplete == false) {
dropComplete(false);
}
dropInProcess = false;
}
} else {
rejectDrop();
}
}