本文整理汇总了Java中java.awt.dnd.DropTargetListener.dropActionChanged方法的典型用法代码示例。如果您正苦于以下问题:Java DropTargetListener.dropActionChanged方法的具体用法?Java DropTargetListener.dropActionChanged怎么用?Java DropTargetListener.dropActionChanged使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.dnd.DropTargetListener
的用法示例。
在下文中一共展示了DropTargetListener.dropActionChanged方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dropActionChanged
import java.awt.dnd.DropTargetListener; //导入方法依赖的package包/类
/** ineffectual. Passes event along listener chain */
public void dropActionChanged(DropTargetDragEvent e) {
final DropTargetListener forward = getListener(e);
if (forward != null) forward.dropActionChanged(e);
}
示例2: processMotionMessage
import java.awt.dnd.DropTargetListener; //导入方法依赖的package包/类
/**
*
*/
protected void processMotionMessage(SunDropTargetEvent event,
boolean operationChanged) {
Component c = (Component)event.getSource();
Point hots = event.getPoint();
int id = event.getID();
DropTarget dt = c.getDropTarget();
DropTargetContext dtc = null;
if (c.isShowing() && (dt != null) && dt.isActive()) {
if (currentDT != dt) {
if (currentDTC != null) {
currentDTC.removeNotify();
}
currentDT = dt;
currentDTC = null;
}
dtc = currentDT.getDropTargetContext();
if (dtc != currentDTC) {
if (currentDTC != null) {
currentDTC.removeNotify();
}
currentDTC = dtc;
currentDTC.addNotify(this);
}
currentA = currentDT.getDefaultActions();
try {
DropTargetDragEvent dtde = new DropTargetDragEvent(dtc,
hots,
currentDA,
currentSA);
DropTargetListener dtl = (DropTargetListener)dt;
if (operationChanged) {
dtl.dropActionChanged(dtde);
} else {
dtl.dragOver(dtde);
}
if (dragRejected) {
currentDA = DnDConstants.ACTION_NONE;
}
} catch (Exception e) {
e.printStackTrace();
currentDA = DnDConstants.ACTION_NONE;
}
} else {
currentDA = DnDConstants.ACTION_NONE;
}
}
示例3: processMotionMessage
import java.awt.dnd.DropTargetListener; //导入方法依赖的package包/类
/**
*
*/
protected void processMotionMessage(SunDropTargetEvent event,
boolean operationChanged) {
Component c = (Component)event.getSource();
Point hots = event.getPoint();
int id = event.getID();
DropTarget dt = c.getDropTarget();
DropTargetContext dtc = null;
DropTargetContextAccessor acc =
AWTAccessor.getDropTargetContextAccessor();
if (c.isShowing() && (dt != null) && dt.isActive()) {
if (currentDT != dt) {
if (currentDTC != null) {
acc.reset(currentDTC);
}
currentDT = dt;
currentDTC = null;
}
dtc = currentDT.getDropTargetContext();
if (dtc != currentDTC) {
if (currentDTC != null) {
acc.reset(currentDTC);
}
currentDTC = dtc;
acc.setDropTargetContextPeer(currentDTC, this);
}
currentA = currentDT.getDefaultActions();
try {
DropTargetDragEvent dtde = new DropTargetDragEvent(dtc,
hots,
currentDA,
currentSA);
DropTargetListener dtl = (DropTargetListener)dt;
if (operationChanged) {
dtl.dropActionChanged(dtde);
} else {
dtl.dragOver(dtde);
}
if (dragRejected) {
currentDA = DnDConstants.ACTION_NONE;
}
} catch (Exception e) {
e.printStackTrace();
currentDA = DnDConstants.ACTION_NONE;
}
} else {
currentDA = DnDConstants.ACTION_NONE;
}
}