/** * Creates a droppable text pane. */ public DroppableTextPane() { new DropTarget(this, this); dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY_OR_MOVE, this); }
/** * Creates a droppable rame. */ public DroppableFrame() { new DropTarget(this, this); dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY_OR_MOVE, this); }
/** Creates drag source with asociated list where drag * will take place. * Also creates the default gesture and asociates this with * given component */ IndexedDragSource(JList comp) { this.comp = comp; // initialize gesture DragSource ds = DragSource.getDefaultDragSource(); ds.createDefaultDragGestureRecognizer(comp, DnDConstants.ACTION_MOVE, this); }
/** * Constructor allowing the list model to be specified * * @param model an instance of DnDListModel * @throws IllegalArgumentException if model is null */ public DnDList(DnDListModel<T> model) { super(model); if (model == null) { throw new IllegalArgumentException("model must not be null"); } // this.setModel(model); src = new DragSource(); src.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_MOVE, this); tgt = new DropTarget(this, this); movingItems = false; overIndex = -1; }
public MutableListDragListener(final JList list) { this.list = list; ds.createDefaultDragGestureRecognizer(list, DnDConstants.ACTION_MOVE, this); }
/** * Creates an Instance of the Droppable Frame. */ protected DroppableFrame() { DragSource dragSource = DragSource.getDefaultDragSource(); dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY_OR_MOVE, this); }
/** * Enables drag operations on the specified component. This class will be notified wheneven drag operations * are performed on the component. * * @param c the component for which to add 'drag' support */ public void enableDrag(Component c) { DragSource dragSource = DragSource.getDefaultDragSource(); dragSource.createDefaultDragGestureRecognizer(c, DnDConstants.ACTION_COPY|DnDConstants.ACTION_MOVE|DnDConstants.ACTION_LINK, this); }
/** Creates drag source with asociated list where drag * will take place. * Also creates the default gesture and asociates this with * given component */ IndexedDragSource (JList comp) { this.comp = comp; // initialize gesture DragSource ds = DragSource.getDefaultDragSource(); ds.createDefaultDragGestureRecognizer( comp, DnDConstants.ACTION_MOVE, this); }
/** Creates drag source with asociated list where drag * will take place. * Also creates the default gesture and asociates this with * given component */ IndexedDragSource (JList comp) { this.comp = comp; // initialize gesture DragSource ds = DragSource.getDefaultDragSource(); ds.createDefaultDragGestureRecognizer( comp, DnDConstants.ACTION_MOVE, this); }
public DnDJTree() { super(new DefaultMutableTreeNode("Project")); dropTarget=new DropTarget(this,this); dragSource=new DragSource(); dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_MOVE,this); }
/** Safe getter for default gesture<br> * (creates the gesture when called for the first time) */ DragGestureRecognizer getDefaultGestureRecognizer() { if (defaultGesture == null) { DragSource ds = DragSource.getDefaultDragSource(); defaultGesture = ds.createDefaultDragGestureRecognizer(comp, getAllowedDragActions(), this); } return defaultGesture; }
void addDragListener(final DragGestureListener dgl) { if (dgl == null) { return; } final DragSource dragSource = DragSource.getDefaultDragSource(); dragSource.createDefaultDragGestureRecognizer(getMainView(), DnDConstants.ACTION_COPY | DnDConstants.ACTION_MOVE | DnDConstants.ACTION_LINK, dgl); }
public DragHandler(JComponent view, final AbstractPanelController<?, V> controller, final V parent, JComponent handle) { this.view = view; this.controller = controller; this.parent = parent; transferable = createTransferable(); if (handle != null) { DragSource source = DragSource.getDefaultDragSource(); source.createDefaultDragGestureRecognizer(handle, DnDConstants.ACTION_COPY_OR_MOVE, this); } }
protected void registerDragGesture(Component c) { if (dragGesture == null) initDragGesture(); DragSource dragSource = new DragSource(); dragSource.createDefaultDragGestureRecognizer(c, DnDConstants.ACTION_MOVE, dragGesture); dragSource.addDragSourceMotionListener(dragGesture); }
private void makeDraggable(Cursor cursor) { dragSource = DragSource.getDefaultDragSource(); dgListener = new DGListener(cursor); dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY, dgListener); dsListener = new DSListener(); }
/** Creates a new instance of SplashDnDSupport */ DragManager(JComponent component) { this.component = component; dSource = new DragSource(); dRecognizer = dSource.createDefaultDragGestureRecognizer(this.component,DnDConstants.ACTION_MOVE,this); dTarget = new DropTarget(this.component,DnDConstants.ACTION_MOVE,this); component.addMouseMotionListener(this); oCursor = component.getCursor(); }
private void initDragAndDrop() { dragSource = new DragSource(); dropTarget = new DropTarget(this, new DropListener()); dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY_OR_MOVE, listener); }
public OWLObjectList(OWLEditorKit owlEditorKit) { setCellRenderer(new OWLCellRendererSimple(owlEditorKit)); DragSource ds = DragSource.getDefaultDragSource(); ds.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY, new OWLObjectListDragGestureListener(owlEditorKit, this)); }
public void registerDragListeners() { if (dragSource != null) { dragSource.removeDragSourceListener(this); dragSource.removeDragSourceMotionListener(this); } dragSource = DragSource.getDefaultDragSource(); dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY, this); dragSource.addDragSourceMotionListener(this); }
public OWLObjectList(OWLEditorKit owlEditorKit) { OWLCellRendererSimple renderer = new OWLCellRendererSimple(owlEditorKit); renderer.setDisplayQuotes(false); setCellRenderer(renderer); DragSource ds = DragSource.getDefaultDragSource(); ds.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY, new OWLObjectListDragGestureListener(owlEditorKit, this)); }