本文整理汇总了Java中java.awt.dnd.DropTargetEvent类的典型用法代码示例。如果您正苦于以下问题:Java DropTargetEvent类的具体用法?Java DropTargetEvent怎么用?Java DropTargetEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DropTargetEvent类属于java.awt.dnd包,在下文中一共展示了DropTargetEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dispatchEvent
import java.awt.dnd.DropTargetEvent; //导入依赖的package包/类
private int dispatchEvent(DropTargetEvent e, int state) {
synchronized (dropMonitor) {
try {
dragState = state;
currentEvent = e;
dropAction = DnDConstants.ACTION_NONE;
EventQueue.invokeLater(this);
while (dragState != DRAG_NONE) {
dropMonitor.wait();
}
return WinDragSource.getWinActions(dropAction);
} catch (InterruptedException ex) {
return WindowsDefs.DROPEFFECT_NONE;
}
}
}
示例2: dragExit
import java.awt.dnd.DropTargetEvent; //导入依赖的package包/类
@Override
public void dragExit(DropTargetEvent dte) {
if (mDragWasAcceptable) {
if (mModel.getDragColumn() != null) {
dragExitColumn(dte);
} else {
Row[] rows = mModel.getDragRows();
if (rows != null && rows.length > 0) {
dragExitRow(dte);
}
}
} else if (mAlternateDragDestination != null) {
mAlternateDragDestination.dragExit(dte);
}
}
示例3: dragExitColumn
import java.awt.dnd.DropTargetEvent; //导入依赖的package包/类
/**
* Called when a column drag leaves the outline.
*
* @param dte The drop target event.
*/
protected void dragExitColumn(DropTargetEvent dte) {
List<Column> columns = mModel.getColumns();
if (columns.equals(mSavedColumns)) {
repaintColumn(mModel.getDragColumn());
} else {
columns.clear();
columns.addAll(mSavedColumns);
repaint();
if (mHeaderPanel != null) {
mHeaderPanel.repaint();
}
}
mSavedColumns = null;
mModel.setDragColumn(null);
}
示例4: dragExit
import java.awt.dnd.DropTargetEvent; //导入依赖的package包/类
public void dragExit(DropTargetEvent dte)
{
try
{
ComponentTree componentTree = DesignerToolWindowManager.getInstance(myEditor).getComponentTree();
if(componentTree != null)
{
componentTree.setDropTargetComponent(null);
}
myUseDragDelta = false;
if(myDraggedComponentList != null)
{
cancelDrag();
setDraggingState(myDraggedComponentList, false);
myEditor.getActiveDecorationLayer().removeFeedback();
myDraggedComponentList = null;
myEditor.setDesignTimeInsets(2);
}
myDraggedComponentsCopy = null;
}
catch(Exception e)
{
LOG.error(e);
}
}
示例5: dragExit
import java.awt.dnd.DropTargetEvent; //导入依赖的package包/类
@Override
public void dragExit(DropTargetEvent dte) {
//if(shouldRedispatchDnDToHandle()) {
if(dragProxying) {
formDesigner.getHandleLayer().getNewComponentDropListener().dragExit(dte);
}
dragProxying = false;
}
示例6: dragExit
import java.awt.dnd.DropTargetEvent; //导入依赖的package包/类
@Override
public void dragExit(DropTargetEvent dte) {
if (isDragging) {
orig.dragExit(dte);
}
isDragging = false;
}
示例7: dragExit
import java.awt.dnd.DropTargetEvent; //导入依赖的package包/类
public void dragExit( DropTargetEvent dte ) {
removeDropLine();
if (DropGlassPane.isOriginalPaneStored()) {
DropGlassPane.putBackOriginal();
}
removeTimer();
}
示例8: dragExit
import java.awt.dnd.DropTargetEvent; //导入依赖的package包/类
/** User exits the dragging */
public void dragExit(DropTargetEvent dte) {
if (lastIndex >= 0) {
cellRenderer.draggingExit();
comp.repaint(comp.getCellBounds(lastIndex, lastIndex));
}
}
示例9: dragExit
import java.awt.dnd.DropTargetEvent; //导入依赖的package包/类
@Override
public void dragExit(final DropTargetEvent e) {
super.dragExit(e);
view.getModel().setImportDragged(false);
view.getModel().fireMiscChanged();
if (dropTragetListenerList != null) {
Object[] listeners = dropTragetListenerList.getListenerList();
for (int i = listeners.length - 2; i >= 0; i -= 2) {
if (listeners[i] == DropTargetListener.class) {
((DropTargetListener) listeners[i + 1]).dragExit(e);
}
}
}
}
示例10: dragExit
import java.awt.dnd.DropTargetEvent; //导入依赖的package包/类
/**
*
* @param e
*/
public void dragExit(DropTargetEvent e)
{
mxGraphTransferHandler handler = getGraphTransferHandler(e);
if (handler != null)
{
handler.setLocation(null);
}
dragCells = null;
setVisible(false);
marker.reset();
reset();
}
示例11: createEvent
import java.awt.dnd.DropTargetEvent; //导入依赖的package包/类
/**
*
*/
protected MouseEvent createEvent(DropTargetEvent e)
{
JComponent component = getDropTarget(e);
Point location = null;
int action = 0;
if (e instanceof DropTargetDropEvent)
{
location = ((DropTargetDropEvent) e).getLocation();
action = ((DropTargetDropEvent) e).getDropAction();
}
else if (e instanceof DropTargetDragEvent)
{
location = ((DropTargetDragEvent) e).getLocation();
action = ((DropTargetDragEvent) e).getDropAction();
}
if (location != null)
{
location = convertPoint(location);
Rectangle r = graphComponent.getViewport().getViewRect();
location.translate(r.x, r.y);
}
// LATER: Fetch state of modifier keys from event or via global
// key listener using Toolkit.getDefaultToolkit().addAWTEventListener(
// new AWTEventListener() {...}, AWTEvent.KEY_EVENT_MASK). Problem
// is the event does not contain the modifier keys and the global
// handler is not called during drag and drop.
int mod = (action == TransferHandler.COPY) ? InputEvent.CTRL_MASK : 0;
return new MouseEvent(component, 0, System.currentTimeMillis(), mod,
location.x, location.y, 1, false, MouseEvent.BUTTON1);
}
示例12: getGraphTransferHandler
import java.awt.dnd.DropTargetEvent; //导入依赖的package包/类
/**
* Helper method to return the component for a drop target event.
*/
protected static final mxGraphTransferHandler getGraphTransferHandler(
DropTargetEvent e)
{
JComponent component = getDropTarget(e);
TransferHandler transferHandler = component.getTransferHandler();
if (transferHandler instanceof mxGraphTransferHandler)
{
return (mxGraphTransferHandler) transferHandler;
}
return null;
}
示例13: dragExit
import java.awt.dnd.DropTargetEvent; //导入依赖的package包/类
/**
*
* @param e
*/
public void dragExit(DropTargetEvent e) {
mxGraphTransferHandler handler = getGraphTransferHandler(e);
if (handler != null) {
handler.setLocation(null);
}
dragCells = null;
setVisible(false);
marker.reset();
reset();
}
示例14: createEvent
import java.awt.dnd.DropTargetEvent; //导入依赖的package包/类
/**
*
*/
protected MouseEvent createEvent(DropTargetEvent e) {
JComponent component = getDropTarget(e);
Point location = null;
int action = 0;
if (e instanceof DropTargetDropEvent) {
location = ((DropTargetDropEvent) e).getLocation();
action = ((DropTargetDropEvent) e).getDropAction();
} else if (e instanceof DropTargetDragEvent) {
location = ((DropTargetDragEvent) e).getLocation();
action = ((DropTargetDragEvent) e).getDropAction();
}
if (location != null) {
location = convertPoint(location);
Rectangle r = graphComponent.getViewport().getViewRect();
location.translate(r.x, r.y);
}
// LATER: Fetch state of modifier keys from event or via global
// key listener using Toolkit.getDefaultToolkit().addAWTEventListener(
// new AWTEventListener() {...}, AWTEvent.KEY_EVENT_MASK). Problem
// is the event does not contain the modifier keys and the global
// handler is not called during drag and drop.
int mod = (action == TransferHandler.COPY) ? InputEvent.CTRL_MASK : 0;
return new MouseEvent(component, 0, System.currentTimeMillis(), mod, location.x, location.y, 1,
false, MouseEvent.BUTTON1);
}
示例15: getGraphTransferHandler
import java.awt.dnd.DropTargetEvent; //导入依赖的package包/类
/**
* Helper method to return the component for a drop target event.
*/
protected static final mxGraphTransferHandler getGraphTransferHandler(DropTargetEvent e) {
JComponent component = getDropTarget(e);
TransferHandler transferHandler = component.getTransferHandler();
if (transferHandler instanceof mxGraphTransferHandler) {
return (mxGraphTransferHandler) transferHandler;
}
return null;
}