@Override public void dragExit(DragSourceEvent dse) { dse.getDragSourceContext().setCursor(DragSource.DefaultCopyNoDrop); }
new DragSourceMotionListener() { @Override public void dragMouseMoved(DragSourceDragEvent dsde) { Point pt = dsde.getLocation(); pt.translate(5, 5); // offset window.setLocation(pt);
DragSource source = DragSource.getDefaultDragSource(); DragSourceMotionListener dsml = new DragSourceMotionListener() { @Override public void dragMouseMoved(DragSourceDragEvent dsde) { debug(dsde); } }; source.addDragSourceMotionListener(dsml); // just some logging protected void debug(DragSourceEvent dsde) { DragSourceContext context = dsde.getDragSourceContext(); Component source = context.getComponent(); String text = source != null ? source.getName() : "none"; LOG.info(text + " x/y " + dsde.getX() + "/" + dsde.getY()); }
public final void dragExit(DragSourceEvent dse) { dse.getDragSourceContext().setCursor(DragSource.DefaultMoveNoDrop); }
isDragged = true; isOutsideTable = true; Component source = dsde.getDragSourceContext().getComponent(); Point toConvert = new Point(dsde.getX(), dsde.getY());
DragSource.getDefaultDragSource().addDragSourceMotionListener(new DragSourceMotionListener() { @Override public void dragMouseMoved(DragSourceDragEvent dsde) { Point pt = dsde.getLocation(); pt.translate(10, 10); // offset if (!window.isVisible()) {
public void dragExit(java.awt.dnd.DragSourceEvent evt) { evt.getDragSourceContext().setCursor(null); // This gets rid of flickering evt.getDragSourceContext().setCursor(uiMgr.getCursor(Widget.TYPES[type] + "NoDropCursor")); }
new DragSourceMotionListener() { @Override public void dragMouseMoved(DragSourceDragEvent dsde) { Point pt = dsde.getLocation(); pt.translate(5, 5); // offset window.setLocation(pt);
public void dragExit (DragSourceEvent dse) { dse.getDragSourceContext().setCursor( DragDropUtilities.chooseCursor( dse.getDragSourceContext ().getSourceActions (), false)); }
public void dragExit (DragSourceEvent dse) { dse.getDragSourceContext().setCursor( DragDropUtilities.chooseCursor( dse.getDragSourceContext ().getSourceActions (), false)); }
@Override public void dragExit(DragSourceEvent event) { DragSourceContext context = event.getDragSourceContext(); context.setCursor(java.awt.Cursor.getDefaultCursor()); }
public void dragExit(java.awt.dnd.DragSourceEvent evt) { evt.getDragSourceContext().setCursor(null); // This gets rid of flickering evt.getDragSourceContext().setCursor(uiMgr.getCursor(Widget.TYPES[dragwidgs[0].type()] + "NoDropCursor")); }
@Override public void dragExit(DragSourceEvent event) { DragSourceContext context = event.getDragSourceContext(); context.setCursor(java.awt.Cursor.getDefaultCursor()); }
private void describe(String type, DragSourceEvent e) { if (LOG.isLoggable(Level.FINE)) { StringBuilder msgBuilder = new StringBuilder(); msgBuilder.append("drag: "); msgBuilder.append(type); DragSourceContext ds = e.getDragSourceContext(); if (e instanceof DragSourceDragEvent) { DragSourceDragEvent ev = (DragSourceDragEvent)e; msgBuilder.append(": src="); msgBuilder.append(actionString(ds.getSourceActions())); msgBuilder.append(" usr="); msgBuilder.append(actionString(ev.getUserAction())); msgBuilder.append(" tgt="); msgBuilder.append(actionString(ev.getTargetActions())); msgBuilder.append(" act="); msgBuilder.append(actionString(ev.getDropAction())); msgBuilder.append(" mods="); msgBuilder.append(ev.getGestureModifiersEx()); } else { msgBuilder.append(": e="); msgBuilder.append(e); } String msg = msgBuilder.toString(); if (!msg.equals(lastAction)) { LOG.log(Level.FINE, msg); lastAction = msg; } } }
protected void updateCursor(DragSourceEvent ev) { if (!fixCursor) return; Cursor cursor = getCursorForAction(adjustDropAction(ev)); ev.getDragSourceContext().setCursor(cursor); }
/** * Hook to update the cursor on various {@link DragSourceEvent} updates. * @param ev event */ protected void updateCursor(DragSourceEvent ev) { if (!fixCursor) return; Cursor cursor = getCursorForAction(adjustDropAction(ev)); ev.getDragSourceContext().setCursor(cursor); }
@Override public void dragExit(DragSourceEvent e) { e.getDragSourceContext().setCursor(DragSource.DefaultMoveNoDrop); lineRect.setRect(0, 0, 0, 0); glassPane.setPoint(new Point(-1000, -1000)); glassPane.repaint(); }
public void dragExit(DragSourceEvent e) { e.getDragSourceContext().setCursor(DragSource.DefaultMoveNoDrop); m_lineRect.setRect(0, 0, 0, 0); m_isDrawRect = false; s_glassPane.setPoint(new Point(-1000, -1000)); s_glassPane.repaint(); }
@Override public void dragExit(DragSourceEvent e) { e.getDragSourceContext().setCursor(DragSource.DefaultMoveNoDrop); _dnDTabbedPaneData.getTargetLineRectBuffer().setRect(0, 0, 0, 0); _glassPane.setPoint(new Point(-1000, -1000)); _glassPane.repaint(); }
@Override public void dragExit(DragSourceEvent e) { e.getDragSourceContext().setCursor(DragSource.DefaultMoveNoDrop); _dnDTabbedPaneData.getTargetLineRectBuffer().setRect(0, 0, 0, 0); _glassPane.setPoint(new Point(-1000, -1000)); _glassPane.repaint(); }