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; } } }
@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); } }
/** * 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); }
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); } }
@Override public void dragExit(DropTargetEvent dte) { //if(shouldRedispatchDnDToHandle()) { if(dragProxying) { formDesigner.getHandleLayer().getNewComponentDropListener().dragExit(dte); } dragProxying = false; }
@Override public void dragExit(DropTargetEvent dte) { if (isDragging) { orig.dragExit(dte); } isDragging = false; }
public void dragExit( DropTargetEvent dte ) { removeDropLine(); if (DropGlassPane.isOriginalPaneStored()) { DropGlassPane.putBackOriginal(); } removeTimer(); }
/** User exits the dragging */ public void dragExit(DropTargetEvent dte) { if (lastIndex >= 0) { cellRenderer.draggingExit(); comp.repaint(comp.getCellBounds(lastIndex, lastIndex)); } }
@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); } } } }
/** * * @param e */ public void dragExit(DropTargetEvent e) { mxGraphTransferHandler handler = getGraphTransferHandler(e); if (handler != null) { handler.setLocation(null); } dragCells = null; setVisible(false); marker.reset(); reset(); }
/** * */ 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); }
/** * 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; }
/** * 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; }
@Override public void dragExit(final DropTargetEvent dte) { if (!inside) { FAILED = true; Thread.dumpStack(); } inside = false; MOUSE_EXIT_TD = true; }
public void dragExit(DropTargetEvent dte) { if(draggingDefaults) { return; } updateContents(getContents(new Point(-1000,-1000))); if(draggingComponent!=null) { JComponent theComponent = getComponent(draggingComponent); Rectangle r = (Rectangle)theComponent.getClientProperty(AnimatedLayout.DESTINATION); if(r!=null) { theComponent.setBounds( r ); } if(hideActiveComponents) theComponent.setVisible(true); } }
@Override public void dragExit(DropTargetEvent dte) { oldInnerDropTarget = null; innerDropTargetComponent = null; //dragTarget = null; - need to stay old value - to save autoscrolling fuctionality }
/** * Called from native method WinDropTarget::DragLeave() */ public void dragLeave() { DropTargetEvent e = new DropTargetEvent(context); dispatchEvent(e, DRAG_LEAVE); dataObject = null; transferable = null; }
private Point getLocation(DropTargetEvent dte) { if (dte instanceof DropTargetDragEvent) { return ((DropTargetDragEvent) dte).getLocation(); } else if (dte instanceof DropTargetDropEvent) { return ((DropTargetDropEvent) dte).getLocation(); } return null; }
/** * Called when a row drag leaves the outline. * * @param dte The drop target event. */ protected void dragExitRow(DropTargetEvent dte) { repaint(getDragRowInsertionMarkerBounds(mDragParentRow, mDragChildInsertIndex)); removeDragHighlight(this); mDragParentRow = null; mDragChildInsertIndex = -1; mModel.setDragRows(null); }
@Override public void dragExit(DropTargetEvent event) { TreePanel panel = getPanel(); if (panel.getColumns().equals(mOriginal)) { panel.repaintColumn(mColumn); } else { panel.restoreColumns(mOriginal); } }
@Override public void dragExit(DropTargetEvent event) { if (mDragState != null) { mDragState.dragExit(event); } else if (mAlternateDragDestination != null) { mAlternateDragDestination.dragExit(event); } clearDragState(); }