(JTree.DropLocation)support.getDropLocation(); JTree tree = (JTree)support.getComponent(); int dropRow = tree.getRowForPath(dl.getPath()); (JTree.DropLocation)support.getDropLocation(); int childIndex = dl.getChildIndex(); TreePath dest = dl.getPath();
JList.DropLocation dl = (JList.DropLocation) support.getDropLocation(); int childIndex = dl.getIndex(); JList.DropLocation dl = (JList.DropLocation) support.getDropLocation(); int childIndex = dl.getIndex();
JList.DropLocation dl = (JList.DropLocation)support.getDropLocation(); if (dl.getIndex() == -1) { return false; Object draggedImage = transferable.getTransferData(DATA_FLAVOUR); JList.DropLocation dl = (JList.DropLocation)support.getDropLocation(); DefaultListModel model = (DefaultListModel)previewList.getModel(); int dropIndex = dl.getIndex();
private static boolean isValidDrag(TransferSupport support, LayerContainer layerContainer) { JTree.DropLocation dropLocation = (JTree.DropLocation) support.getDropLocation(); TreePath treePath = dropLocation.getPath(); final Object[] path = treePath.getPath(); for (Object o : path) { final Layer layer = (Layer) o; if (layer == layerContainer.getDraggedLayer()) { return false; } } Layer targetLayer = (Layer) treePath.getLastPathComponent(); int targetIndex = dropLocation.getChildIndex(); if (targetIndex == -1) { // -1 indicates move into other layer return targetLayer.isCollectionLayer(); } return true; }
private static boolean isValidDrag(TransferSupport support, LayerContainer layerContainer) { JTree.DropLocation dropLocation = (JTree.DropLocation) support.getDropLocation(); TreePath treePath = dropLocation.getPath(); final Object[] path = treePath.getPath(); for (Object o : path) { final Layer layer = (Layer) o; if (layer == layerContainer.getDraggedLayer()) { return false; } } Layer targetLayer = (Layer) treePath.getLastPathComponent(); int targetIndex = dropLocation.getChildIndex(); if (targetIndex == -1) { // -1 indicates move into other layer return targetLayer.isCollectionLayer(); } return true; }
@Override public boolean canImport(TransferSupport support) { JTree.DropLocation dropLocation = (JTree.DropLocation) support.getDropLocation(); TreePath treePath = dropLocation.getPath(); Layer targetLayer = (Layer) treePath.getLastPathComponent(); int targetIndex = dropLocation.getChildIndex(); boolean moveAllowed = true; if (targetIndex == -1) { // -1 indicates move into other layer moveAllowed = targetLayer.isCollectionLayer(); } return support.isDataFlavorSupported(layerFlavor) && support.isDrop() && support.getComponent() == tree && moveAllowed; }
@Override public boolean canImport(TransferSupport support) { JTree.DropLocation dropLocation = (JTree.DropLocation) support.getDropLocation(); TreePath treePath = dropLocation.getPath(); Layer targetLayer = (Layer) treePath.getLastPathComponent(); int targetIndex = dropLocation.getChildIndex(); boolean moveAllowed = true; if (targetIndex == -1) { // -1 indicates move into other layer moveAllowed = targetLayer.isCollectionLayer(); } return support.isDataFlavorSupported(layerFlavor) && support.isDrop() && support.getComponent() == tree && moveAllowed; }
private void moveRows(int[] rows, TransferSupport support) { JTable table = getPositionsView(); int index = support.getDropLocation() instanceof JTable.DropLocation ? ((JTable.DropLocation) support.getDropLocation()).getRow() : MAX_VALUE; int rowCount = table.getModel().getRowCount(); if (index < 0 || index > rowCount) index = rowCount; if (rows[0] > index) { positionsModel.up(rows, rows[0] - index); JTableHelper.selectPositions(table, index, index + rows.length - 1); } else { positionsModel.down(revert(rows), index - rows[0] - rows.length + 1); JTableHelper.selectPositions(table, index - rows.length + 1, index); } }
@Override public boolean canImport(TransferHandler.TransferSupport info) { // we only import NodeViewers if (!info .isDataFlavorSupported(ZooInspectorNodeViewer.nodeViewerDataFlavor)) { return false; } JList.DropLocation dl = (JList.DropLocation) info .getDropLocation(); if (dl.getIndex() == -1) { return false; } return true; }
@Override public boolean importData(TransferSupport support) { return importData((JComponent) support.getComponent(), support.getTransferable(), new HashSet<Figure>(), support.getDropLocation() == null ? null : support.getDropLocation().getDropPoint()); }
@Override public boolean canImport(TransferSupport support) { if (support.isDataFlavorSupported(SearchFilterTransferable.SEARCHFILTER_FLAVOR) && support.getTransferable() != null) { JList.DropLocation dropLocation = (JList.DropLocation) support.getDropLocation(); return dropLocation.isInsert(); } return false; }
public boolean importData(TransferSupport support) { if (canImport(support)) { Transferable transferable = support.getTransferable(); Point point = support.getDropLocation().getDropPoint(); int resource = resourceAtPoint(point); Date date = dateAtPoint(point); timelineDrop.done(transferable, resource, date); } return false; } }
public boolean canImport(TransferHandler.TransferSupport support) { if (!support.isDataFlavorSupported(DataFlavor.stringFlavor)) { return false; } JList.DropLocation dl = (JList.DropLocation) support.getDropLocation(); if (dl.getIndex() == -1) { return false; } else { return true; } }
public boolean importData(TransferSupport support) { if (canImport(support)) { Transferable transferable = support.getTransferable(); Point point = support.getDropLocation().getDropPoint(); int resource = resourceAtPoint(point); DayDate dayDate = dayDateAtPoint(point); timelineDrop.done(transferable, resource, dayDate); } return false; } }
public boolean importData(TransferSupport support) { _dropPoint = support.getDropLocation().getDropPoint(); Component comp = support.getComponent(); if (comp instanceof DndColumn) { Point lp = ((DndColumn) comp).getLocationInColumnTextArea(); _dropPoint.translate(lp.x, lp.y); } return super.importData(support); }
public boolean importData(TransferSupport support) { if (canImport(support)) { Transferable transferable = support.getTransferable(); Point point = support.getDropLocation().getDropPoint(); int resource = resourceAtPoint(point); DayDate dayDate = dayDateAtPoint(point); timelineDrop.done(transferable, resource, dayDate); } return false; } }
public boolean canImport(final TransferHandler.TransferSupport support) { if (!support.isDataFlavorSupported(DataFlavor.stringFlavor)) { return false; } final JList.DropLocation dl = (JList.DropLocation) support.getDropLocation(); if (dl.getIndex() == -1) { return false; } else { return true; } }
JList.DropLocation dl = (JList.DropLocation)info.getDropLocation(); DefaultListModel listModel = (DefaultListModel)target.getModel(); int index = dl.getIndex();
JList.DropLocation dropLocation = (JList.DropLocation) support.getDropLocation(); int indexDropLocation = dropLocation.getIndex(); JList.DropLocation dl = (JList.DropLocation) support.getDropLocation(); int childIndex = dl.getIndex();
DropLocation tdl = support.getDropLocation(); Point pt = tdl.getDropPoint(); DnDTabbedPane target = (DnDTabbedPane) support.getComponent();