@Override public <T extends DragGestureRecognizer> T createDragGestureRecognizer(Class<T> abstractRecognizerClass, DragSource ds, Component c, int srcActions, DragGestureListener dgl) { final LightweightFrame f = SunToolkit.getLightweightFrame(c); if (f != null) { return f.createDragGestureRecognizer(abstractRecognizerClass, ds, c, srcActions, dgl); } if (MouseDragGestureRecognizer.class.equals(abstractRecognizerClass)) return (T)new WMouseDragGestureRecognizer(ds, c, srcActions, dgl); else return null; }
public <T extends DragGestureRecognizer> T createDragGestureRecognizer(Class<T> recognizerClass, DragSource ds, Component c, int srcActions, DragGestureListener dgl) { final LightweightFrame f = SunToolkit.getLightweightFrame(c); if (f != null) { return f.createDragGestureRecognizer(recognizerClass, ds, c, srcActions, dgl); } if (MouseDragGestureRecognizer.class.equals(recognizerClass)) return (T)new XMouseDragGestureRecognizer(ds, c, srcActions, dgl); else return null; }
@Override @SuppressWarnings("unchecked") public <T extends DragGestureRecognizer> T createDragGestureRecognizer(Class<T> recognizerClass, DragSource ds, Component c, int srcActions, DragGestureListener dgl) { final LightweightFrame f = SunToolkit.getLightweightFrame(c); if (f != null) { return f.createDragGestureRecognizer(recognizerClass, ds, c, srcActions, dgl); } if (MouseDragGestureRecognizer.class.equals(recognizerClass)) return (T)new XMouseDragGestureRecognizer(ds, c, srcActions, dgl); else return null; }
@Override @SuppressWarnings("unchecked") public <T extends DragGestureRecognizer> T createDragGestureRecognizer(Class<T> abstractRecognizerClass, DragSource ds, Component c, int srcActions, DragGestureListener dgl) { final LightweightFrame f = SunToolkit.getLightweightFrame(c); if (f != null) { return f.createDragGestureRecognizer(abstractRecognizerClass, ds, c, srcActions, dgl); } if (MouseDragGestureRecognizer.class.equals(abstractRecognizerClass)) return (T)new WMouseDragGestureRecognizer(ds, c, srcActions, dgl); else return null; }
public <T extends DragGestureRecognizer> T createDragGestureRecognizer(Class<T> recognizer, DragSource ds, Component comp, int actions, DragGestureListener l) { if (recognizer.getName().equals("java.awt.dnd.MouseDragGestureRecognizer") && ! GraphicsEnvironment.isHeadless()) { GtkMouseDragGestureRecognizer gestureRecognizer = new GtkMouseDragGestureRecognizer(ds, comp, actions, l); gestureRecognizer.registerListeners(); return recognizer.cast(gestureRecognizer); } else { return null; } }
protected MapView createMapView(Controller controller, MindMapMapModel model) { MapView mapView = new MapView(model, controller) { DragGestureListener getNodeDragListener() { return null; } DropTargetListener getNodeDropListener() { return null; } public void selectAsTheOnlyOneSelected(NodeView pNewSelected, boolean pRequestFocus) { } }; return mapView; }
public void addTo(Buildable parent) { panel.setDropTarget(AbstractDragHandler.makeDropTarget(panel, DnDConstants.ACTION_MOVE, null)); DragGestureListener dragGestureListener = new DragGestureListener() { public void dragGestureRecognized(DragGestureEvent dge) { startDrag(); AbstractDragHandler.getTheDragHandler().dragGestureRecognized(dge); } }; DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer(panel, DnDConstants.ACTION_MOVE, dragGestureListener); }
private void registerDndHandlers() { new DragSource().createDefaultDragGestureRecognizer(list, DnDConstants.ACTION_COPY, new DragGestureListener() { @Override public void dragGestureRecognized(DragGestureEvent dge) { Transferable t = new FileInfoTransferable(getSelectedFile()); dge.startDrag(DragSource.DefaultMoveDrop, t); } }); DnDUtils.registerDropHandler(this, dropHandlers, new HoverHandler() { @Override public void hovering(DropTargetDragEvent e) { FileInfo fi = getFileUnderMouseCursor(); if( fi == null ) { int i = getListIndexUnderPoint(e.getLocation()); if( i >= 0 ) { fi = model.get(i); } } if( fi != null && fi.isDirectory() ) { list.setSelectedValue(fi, true); } else { list.getSelectionModel().clearSelection(); } } }); }
/** * Create a drag gesture recognizer for the lightweight frame. */ default public <T extends DragGestureRecognizer> T createDragGestureRecognizer( Class<T> abstractRecognizerClass, DragSource ds, Component c, int srcActions, DragGestureListener dgl) { return null; }
public <T extends DragGestureRecognizer> T createDragGestureRecognizer( Class<T> abstractRecognizerClass, DragSource ds, Component c, int srcActions, DragGestureListener dgl) { return content == null ? null : content.createDragGestureRecognizer( abstractRecognizerClass, ds, c, srcActions, dgl); }
/** * */ protected void installDragGestureHandler() { DragGestureListener dragGestureListener = new DragGestureListener() { public void dragGestureRecognized(DragGestureEvent e) { if (graphComponent.isDragEnabled() && first != null) { final TransferHandler th = graphComponent.getTransferHandler(); if (th instanceof mxGraphTransferHandler) { final mxGraphTransferable t = (mxGraphTransferable) ((mxGraphTransferHandler) th) .createTransferable(graphComponent); if (t != null) { e.startDrag(null, mxSwingConstants.EMPTY_IMAGE, new Point(), t, new DragSourceAdapter() { /** * */ public void dragDropEnd(DragSourceDropEvent dsde) { ((mxGraphTransferHandler) th).exportDone(graphComponent, t, TransferHandler.NONE); first = null; } }); } } } } }; DragSource dragSource = new DragSource(); dragSource.createDefaultDragGestureRecognizer(graphComponent.getGraphControl(), (isCloneEnabled()) ? DnDConstants.ACTION_COPY_OR_MOVE : DnDConstants.ACTION_MOVE, dragGestureListener); }
@Override public <T extends DragGestureRecognizer> T createDragGestureRecognizer(Class<T> abstractRecognizerClass, DragSource ds, Component c, int srcActions, DragGestureListener dgl) { return null; }