本文整理匯總了Java中java.awt.dnd.DropTargetListener.dragOver方法的典型用法代碼示例。如果您正苦於以下問題:Java DropTargetListener.dragOver方法的具體用法?Java DropTargetListener.dragOver怎麽用?Java DropTargetListener.dragOver使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.awt.dnd.DropTargetListener
的用法示例。
在下文中一共展示了DropTargetListener.dragOver方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: dragOver
import java.awt.dnd.DropTargetListener; //導入方法依賴的package包/類
/** ineffectual. Passes event along listener chain */
public void dragOver(DropTargetDragEvent e) {
final DropTargetListener forward = getListener(e);
if (forward != null) forward.dragOver(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;
}
}