/** 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); }
window.setAlwaysOnTop(true); window.setBackground(new Color(0,true)); DragSource.getDefaultDragSource().addDragSourceMotionListener( new DragSourceMotionListener() { @Override public void dragMouseMoved(DragSourceDragEvent dsde) {
/** * 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 an Instance of the Droppable Frame. */ protected DroppableFrame() { DragSource dragSource = DragSource.getDefaultDragSource(); 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); }
/** 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 FileDragLabel() { DragSource dragSource = DragSource.getDefaultDragSource(); dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY, this); }
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); }
/** 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; }
public WidgetCreateButton(byte inType) { super(uiMgr.getIcon(Widget.TYPES[inType])); type = inType; // Setup the drag source new OracleMouseDragGestureRecognizer(java.awt.dnd.DragSource.getDefaultDragSource(), this, true ? java.awt.dnd.DnDConstants.ACTION_MOVE : java.awt.dnd.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; }
/** 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; }
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); } }
private void makeDraggable(Cursor cursor) { dragSource = DragSource.getDefaultDragSource(); dgListener = new DGListener(cursor); dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY, dgListener); dsListener = new DSListener(); }
public void setEnableDragAndDrop() { dragSource = DragSource.getDefaultDragSource(); dragSource.createDefaultDragGestureRecognizer(this, getDelegateConstants(), this); dt = new DropTarget(this, this); }
public OWLObjectList(OWLEditorKit owlEditorKit) { setCellRenderer(new OWLCellRendererSimple(owlEditorKit)); DragSource ds = DragSource.getDefaultDragSource(); ds.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY, new OWLObjectListDragGestureListener(owlEditorKit, this)); }
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)); }
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)); }