Java 8 DragSourceDragEvent - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 DragSourceDragEvent class.

This code example shows how to use the following methods:getDropAction, getDragSourceContext
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getUserAction, getDragSourceContext
 
				public void dragOver(final DragSourceDragEvent dsde) {
				} 
 
				public void dropActionChanged(final DragSourceDragEvent dsde) {
					dsde.getDragSourceContext().setCursor(getCursorByAction(dsde.getUserAction()));
				} 
			}); 
		} 
		catch (final InvalidDnDOperationException ex) {
		} 
	} 
 
	private boolean isLinkDragEvent(final DragGestureEvent e) {
	    return (e.getTriggerEvent().getModifiersEx() & InputEvent.BUTTON3_DOWN_MASK) != 0;
    } 
 
	public Cursor getCursorByAction(final int dragAction) {
		switch (dragAction) {
			case DnDConstants.ACTION_COPY:
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getLocation
    { 
        // Saving initial mouse location 
        if ( reference == null || reference.get () != object )
        { 
            final Point los = object.getLocationOnScreen ();
            final Point eloc = event.getLocation ();
            location = new Point ( los.x - eloc.x, los.y - eloc.y ); 
            reference = new WeakReference<T> ( object );
        } 
 
        // Returning component snapshot 
        return SwingUtils.createComponentSnapshot ( object, getSnapshotTransparency () );
    } 
 
    /** 
     * Returns component snapshot transparency. 
     * By default snapshot is semi-transparent for usability purposes. 
     * 
     * @return component snapshot transparency 
     */ 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getDragSourceContext
This code example shows how to use the following methods:getLocation
 
    } 
 
    @Override 
    public void dragMouseMoved(DragSourceDragEvent dsde) {
        drawGlassPane(dsde.getLocation());
    } 
 
    // --- DragSourceListener methods ----------------------------------- 
 
    @Override 
    public void dragEnter(DragSourceDragEvent dsde) {
    } 
 
    @Override 
    public void dragOver(DragSourceDragEvent dsde) {
    } 
 
    @Override 
    public void dragExit(DragSourceEvent dsde) {
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
See Code Examples for Java 8 DragSourceDragEvent Methods: