/** * This message goes to DragSourceListener, * informing it that the dragging has ended. * @param event Details about the drop event. */ public void dragDropEnd (DragSourceDropEvent event) { if (event.getDropSuccess ()) { // System.out.println ("added new class"); } }
@Override public void dragDropEnd(DragSourceDropEvent event) { DragSourceContext context = event.getDragSourceContext(); context.setCursor(java.awt.Cursor.getDefaultCursor()); dragSource.endDrag(dragDescendantArgument, getDropAction(event.getDropAction())); } });
@Override public void dragDropEnd(DragSourceDropEvent e) { m_isDrawRect = false; m_lineRect.setRect(0, 0, 0, 0); // m_dragTabIndex = -1; if (hasGhost()) { s_glassPane.setVisible(false); s_glassPane.setImage(null); } // if drop failed, create new JFrame with JTabbedPane included with public access if(!e.getDropSuccess()){ // MenuLight class Extends JFrame and Included 1 component JTabbedPane called superPane MenuLight m = new MenuLight(); m.setLocation(e.getLocation()); m.setVisible(true); // after create Frame, transfer the tab to other jtabbedpane ((DnDCloseButtonTabbedPane) m.superPane).convertTab(getTabTransferData(e), getTargetTabIndex(e.getLocation())); } // if current JTabbedPane Tab is empty dispose it. if(getTabCount() < 1){ // unfortunly i didnt want to close my Original menu, so check the class of parent of DnD is create from MenuLight and dispose it if(parent.getClass().equals(MenuLight.class)){ ((javax.swing.JFrame) parent).dispose(); } } }
public void dragDropEnd(DragSourceDropEvent e) { if (e.getDropSuccess()) { int nAction = e.getDropAction(); if (nAction == DnDConstants.ACTION_MOVE) { // The dragged item (pathSource) has been inserted at the target // selected by the user. // Now it is time to delete it from its original location. System.out.println("REMOVING: " + pathSource.getLastPathComponent()); // . // .. ask your TreeModel to delete the node // . pathSource = null; } } else { repaint(); } }
public void dragDropEnd(DragSourceDropEvent evt) { if (evt.getDropSuccess()) { Component comp = evt.getDragSourceContext().getComponent(); Transferable t = evt.getDragSourceContext().getTransferable(); if (t instanceof ListTransferable) { try { //noinspection unchecked List<Comparable> o = (List<Comparable>) t.getTransferData(ListTransferable.FLAVOR); if (comp instanceof JList) { JList list = (JList) comp; VariableListModel model = (VariableListModel) list.getModel(); for (Comparable c : o) { model.removeFirst(c); } } else { JTextField pane = (JTextField) comp; pane.setText(null); } regressionModel.setTargetName(getResponseField().getText()); regressionModel.setRegressorName(getPredictors()); } catch (Exception ex) { ex.printStackTrace(); } } } }
public void dragDropEnd(DragSourceDropEvent dsde) { DragSourceContext dsc = dsde.getDragSourceContext(); JComponent c = (JComponent) dsc.getComponent(); SynaptixTransferHandler th = (SynaptixTransferHandler) c .getTransferHandler(); clearDropDDCs(); if (dsde.getDropSuccess()) { th.exportDone(c, dsc.getTransferable(), dsde.getDropAction()); } else { th.exportDone(c, dsc.getTransferable(), NONE); } c.setAutoscrolls(scrolls); }
/** Get the currently requested drop action. */ protected int getDropAction(DragSourceEvent ev) { if (ev instanceof DragSourceDragEvent) { DragSourceDragEvent e = (DragSourceDragEvent)ev; return e.getDropAction(); } if (ev instanceof DragSourceDropEvent) { return ((DragSourceDropEvent)ev).getDropAction(); } return NONE; }
/** * {@inheritDoc} */ @Override public void dragDropEnd( final DragSourceDropEvent aEvent ) { if ( !DragAndDropLock.releaseLock( this ) ) { return; } final GhostGlassPane glassPane = getGlassPane( aEvent.getDragSourceContext().getComponent() ); glassPane.setVisible( false ); }
@Override public void dragDropEnd(DragSourceDropEvent evt) { if (evt.getDropSuccess()) { Component comp = evt.getDragSourceContext().getComponent(); Transferable t = evt.getDragSourceContext().getTransferable(); if (t instanceof ListTransferable) { try { //noinspection unchecked List<Node> o = (List<Node>) t.getTransferData(new ListTransferable(new ArrayList()).getDataFlavor()); if (comp instanceof JList) { JList<Node> list = (JList<Node>) comp; VariableListModel model = (VariableListModel) list.getModel(); for (Node c : o) { model.removeFirst(c); } } else { JTextField pane = (JTextField) comp; pane.setText(null); } wrapper.setSelectedVariables(getSelected()); } catch (Exception exception) { exception.printStackTrace(System.err); } } } }
/** * as the operation completes */ @Override public void dragDropEnd(DragSourceDropEvent dsde) { DragSourceContext dsc = dsde.getDragSourceContext(); JComponent c = (JComponent) dsc.getComponent(); DefaultDrawingViewTransferHandler th = (DefaultDrawingViewTransferHandler) c.getTransferHandler(); if (dsde.getDropSuccess()) { th.exportDone(c, dsc.getTransferable(), dsde.getDropAction()); } else { th.exportDone(c, dsc.getTransferable(), NONE); } c.setAutoscrolls(scrolls); }
public void dragDropEnd(DragSourceDropEvent dsde) { if (dsde.getDropSuccess() && dsde.getDropAction()==DnDConstants.ACTION_MOVE && draggedNodeParent != null) { ((DefaultTreeModel)tree.getModel()).nodeStructureChanged(draggedNodeParent); tree.expandPath(new TreePath(draggedNodeParent.getPath())); tree.expandPath(new TreePath(draggedNode.getPath())); } } public final void dragEnter(DragSourceDragEvent dsde) {
/** Get the currently requested drop action. * @param ev event * @return effective drop action */ protected int getDropAction(DragSourceEvent ev) { if (ev instanceof DragSourceDragEvent) { DragSourceDragEvent e = (DragSourceDragEvent)ev; return e.getDropAction(); } if (ev instanceof DragSourceDropEvent) { return ((DragSourceDropEvent)ev).getDropAction(); } return NONE; }
public void dragDropEnd(DragSourceDropEvent e) { describe("end", e); setModifiers(UNKNOWN_MODIFIERS); transferable = UNKNOWN_TRANSFERABLE; if (ghost != null) { if (e.getDropSuccess()) { ghost.dispose(); } else { ghost.returnToOrigin(); } ghost = null; } DragSource src = e.getDragSourceContext().getDragSource(); src.removeDragSourceMotionListener(this); moved = false; }
/** * this message goes to DragSourceListener, informing it that the dragging * has ended * */ public void dragDropEnd (DragSourceDropEvent event) { if ( event.getDropSuccess()){ } }
@Override public void dragDropEnd(DragSourceDropEvent event) { DragSourceContext context = event.getDragSourceContext(); context.setCursor(java.awt.Cursor.getDefaultCursor()); dragSource.endDrag(dragDescendant, getDropAction(event.getDropAction())); } });
@Override public void dragDropEnd(DragSourceDropEvent e) { describe("end", e); setModifiers(UNKNOWN_MODIFIERS); transferable = UNKNOWN_TRANSFERABLE; if (ghost != null) { if (e.getDropSuccess()) { ghost.dispose(); } else { ghost.returnToOrigin(); } ghost = null; } DragSource src = e.getDragSourceContext().getDragSource(); src.removeDragSourceMotionListener(this); moved = false; }
public void dragDropEnd(DragSourceDropEvent dsde) { if (dsde.getDropSuccess()) { System.out.println("Succeeded"); } else { System.out.println("Failed"); } }
public void dragDropEnd(DragSourceDropEvent dsde) { if (dsde.getDropSuccess()) { Transferable t = dsde.getDragSourceContext().getTransferable(); try { List list = (List) t.getTransferData(ListTransferable.DATA_FLAVOR); DefaultListModel model = (DefaultListModel) getModel(); for (Object o : list) { model.removeElement(o); } KnowledgeGroup group = knowledge.getKnowledgeGroups().get(index); KnowledgeGroup g; if (this.from) { g = new KnowledgeGroup(group.getType(), getElementsInModel(model), group.getToVariables()); } else { g = new KnowledgeGroup(group.getType(), group.getFromVariables(), getElementsInModel(model)); } try { knowledge.setKnowledgeGroup(index, g); } catch (IllegalArgumentException ex) { JOptionPane.showMessageDialog(OtherGroupsEditor.this, ex.getMessage()); // rebuild so the old values are resorted. rebuild(); } } catch (Exception ex) { ex.printStackTrace(); } } }
public void dragDropEnd(DragSourceDropEvent dsde) { if (!dsde.getDropSuccess() && activeDragItem != null) { activeDragItem.dragAccepted(); } }
public void dragDropEnd(DragSourceDropEvent e) { m_isDrawRect = false; m_lineRect.setRect(0, 0, 0, 0); // m_dragTabIndex = -1; final int tagIndexWas = s_glassPane.tagIndexWas; final Component c = getComponentAt(s_glassPane.tagIndexWas); if (hasGhost()) { s_glassPane.setVisible(false); s_glassPane.setImage(null); } final Component was = s_glassPane.componentWas; final String oldTitle = getTitleAt(tagIndexWas); if (was instanceof JPanel) { convertPanelToJFrame(oldTitle, (JPanel) was, new CallableWithParameters<JPanel, Boolean>() { @Override public Boolean call(JPanel pnl, Object... moreparams) { removeTabAt(tagIndexWas); addTab(oldTitle, pnl); return true; } }); return; } if (!e.getDropSuccess()) { String dsc = Debuggable.toInfoStringF(e.getDragSourceContext()); System.out.println(dsc); } else { String dsc = Debuggable.toInfoStringF(e.getDragSourceContext()); System.out.println(dsc); } }