java.awt.dnd.peer.DropTargetContextPeer Java Examples

The following examples show how to use java.awt.dnd.peer.DropTargetContextPeer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DropTargetContext.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * get the Transferable (proxy) operand of this operation
 *
 * @throws InvalidDnDOperationException if a drag is not outstanding/extant
 *
 * @return the {@code Transferable}
 */

protected Transferable getTransferable() throws InvalidDnDOperationException {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    if (peer == null) {
        throw new InvalidDnDOperationException();
    } else {
        if (transferable == null) {
            Transferable t = peer.getTransferable();
            boolean isLocal = peer.isTransferableJVMLocal();
            synchronized (this) {
                if (transferable == null) {
                    transferable = createTransferableProxy(t, isLocal);
                }
            }
        }

        return transferable;
    }
}
 
Example #2
Source File: DropTargetContext.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * get the Transferable (proxy) operand of this operation
 *
 * @throws InvalidDnDOperationException if a drag is not outstanding/extant
 *
 * @return the {@code Transferable}
 */

protected Transferable getTransferable() throws InvalidDnDOperationException {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    if (peer == null) {
        throw new InvalidDnDOperationException();
    } else {
        if (transferable == null) {
            Transferable t = peer.getTransferable();
            boolean isLocal = peer.isTransferableJVMLocal();
            synchronized (this) {
                if (transferable == null) {
                    transferable = createTransferableProxy(t, isLocal);
                }
            }
        }

        return transferable;
    }
}
 
Example #3
Source File: DropTargetContext.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * get the Transferable (proxy) operand of this operation
 * <P>
 * @throws InvalidDnDOperationException if a drag is not outstanding/extant
 * <P>
 * @return the <code>Transferable</code>
 */

protected Transferable getTransferable() throws InvalidDnDOperationException {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    if (peer == null) {
        throw new InvalidDnDOperationException();
    } else {
        if (transferable == null) {
            Transferable t = peer.getTransferable();
            boolean isLocal = peer.isTransferableJVMLocal();
            synchronized (this) {
                if (transferable == null) {
                    transferable = createTransferableProxy(t, isLocal);
                }
            }
        }

        return transferable;
    }
}
 
Example #4
Source File: DropTargetContext.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * get the Transferable (proxy) operand of this operation
 * <P>
 * @throws InvalidDnDOperationException if a drag is not outstanding/extant
 * <P>
 * @return the <code>Transferable</code>
 */

protected Transferable getTransferable() throws InvalidDnDOperationException {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    if (peer == null) {
        throw new InvalidDnDOperationException();
    } else {
        if (transferable == null) {
            Transferable t = peer.getTransferable();
            boolean isLocal = peer.isTransferableJVMLocal();
            synchronized (this) {
                if (transferable == null) {
                    transferable = createTransferableProxy(t, isLocal);
                }
            }
        }

        return transferable;
    }
}
 
Example #5
Source File: DropTargetContext.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * get the Transferable (proxy) operand of this operation
 * <P>
 * @throws InvalidDnDOperationException if a drag is not outstanding/extant
 * <P>
 * @return the <code>Transferable</code>
 */

protected Transferable getTransferable() throws InvalidDnDOperationException {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    if (peer == null) {
        throw new InvalidDnDOperationException();
    } else {
        if (transferable == null) {
            Transferable t = peer.getTransferable();
            boolean isLocal = peer.isTransferableJVMLocal();
            synchronized (this) {
                if (transferable == null) {
                    transferable = createTransferableProxy(t, isLocal);
                }
            }
        }

        return transferable;
    }
}
 
Example #6
Source File: DropTargetContext.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * get the Transferable (proxy) operand of this operation
 * <P>
 * @throws InvalidDnDOperationException if a drag is not outstanding/extant
 * <P>
 * @return the <code>Transferable</code>
 */

protected Transferable getTransferable() throws InvalidDnDOperationException {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    if (peer == null) {
        throw new InvalidDnDOperationException();
    } else {
        if (transferable == null) {
            Transferable t = peer.getTransferable();
            boolean isLocal = peer.isTransferableJVMLocal();
            synchronized (this) {
                if (transferable == null) {
                    transferable = createTransferableProxy(t, isLocal);
                }
            }
        }

        return transferable;
    }
}
 
Example #7
Source File: DropTargetContext.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * get the Transferable (proxy) operand of this operation
 * <P>
 * @throws InvalidDnDOperationException if a drag is not outstanding/extant
 * <P>
 * @return the <code>Transferable</code>
 */

protected Transferable getTransferable() throws InvalidDnDOperationException {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    if (peer == null) {
        throw new InvalidDnDOperationException();
    } else {
        if (transferable == null) {
            Transferable t = peer.getTransferable();
            boolean isLocal = peer.isTransferableJVMLocal();
            synchronized (this) {
                if (transferable == null) {
                    transferable = createTransferableProxy(t, isLocal);
                }
            }
        }

        return transferable;
    }
}
 
Example #8
Source File: DropTargetContext.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * accept the Drag.
 * <P>
 * @param dragOperation the supported action(s)
 */

protected void acceptDrag(int dragOperation) {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    if (peer != null) {
        peer.acceptDrag(dragOperation);
    }
}
 
Example #9
Source File: DropTargetContext.java    From Java8CN with Apache License 2.0 5 votes vote down vote up
/**
 * reject the Drag.
 */

protected void rejectDrag() {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    if (peer != null) {
        peer.rejectDrag();
    }
}
 
Example #10
Source File: DropTargetContext.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * This method returns an {@code int} representing the
 * current actions this {@code DropTarget} will accept.
 *
 * @return the current actions acceptable to this {@code DropTarget}
 */

protected int getTargetActions() {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    return ((peer != null)
                    ? peer.getTargetActions()
                    : dropTarget.getDefaultActions()
    );
}
 
Example #11
Source File: DropTargetContext.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * This method sets the current actions acceptable to
 * this {@code DropTarget}.
 *
 * @param actions an {@code int} representing the supported action(s)
 */

protected void setTargetActions(int actions) {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    if (peer != null) {
        synchronized (peer) {
            peer.setTargetActions(actions);
            getDropTarget().doSetDefaultActions(actions);
        }
    } else {
        getDropTarget().doSetDefaultActions(actions);
    }
}
 
Example #12
Source File: DropTargetContext.java    From Java8CN with Apache License 2.0 5 votes vote down vote up
/**
 * accept the Drag.
 * <P>
 * @param dragOperation the supported action(s)
 */

protected void acceptDrag(int dragOperation) {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    if (peer != null) {
        peer.acceptDrag(dragOperation);
    }
}
 
Example #13
Source File: DropTargetContext.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * called to signal that the drop is unacceptable.
 * must be called during DropTargetListener.drop method invocation.
 */

protected void rejectDrop() {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    if (peer != null) {
        peer.rejectDrop();
    }
}
 
Example #14
Source File: DropTargetContext.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * called to signal that the drop is acceptable
 * using the specified operation.
 * must be called during DropTargetListener.drop method invocation.
 * <P>
 * @param dropOperation the supported action(s)
 */

protected void acceptDrop(int dropOperation) {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    if (peer != null) {
        peer.acceptDrop(dropOperation);
    }
}
 
Example #15
Source File: DropTargetContext.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This method sets the current actions acceptable to
 * this <code>DropTarget</code>.
 * <P>
 * @param actions an <code>int</code> representing the supported action(s)
 */

protected void setTargetActions(int actions) {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    if (peer != null) {
        synchronized (peer) {
            peer.setTargetActions(actions);
            getDropTarget().doSetDefaultActions(actions);
        }
    } else {
        getDropTarget().doSetDefaultActions(actions);
    }
}
 
Example #16
Source File: DropTargetContext.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * called to signal that the drop is unacceptable.
 * must be called during DropTargetListener.drop method invocation.
 */

protected void rejectDrop() {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    if (peer != null) {
        peer.rejectDrop();
    }
}
 
Example #17
Source File: DropTargetContext.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * reject the Drag.
 */

protected void rejectDrag() {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    if (peer != null) {
        peer.rejectDrag();
    }
}
 
Example #18
Source File: DropTargetContext.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * accept the Drag.
 * <P>
 * @param dragOperation the supported action(s)
 */

protected void acceptDrag(int dragOperation) {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    if (peer != null) {
        peer.acceptDrag(dragOperation);
    }
}
 
Example #19
Source File: DropTargetContext.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * called to signal that the drop is unacceptable.
 * must be called during DropTargetListener.drop method invocation.
 */

protected void rejectDrop() {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    if (peer != null) {
        peer.rejectDrop();
    }
}
 
Example #20
Source File: DropTargetContext.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * reject the Drag.
 */

protected void rejectDrag() {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    if (peer != null) {
        peer.rejectDrag();
    }
}
 
Example #21
Source File: DropTargetContext.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * accept the Drag.
 * <P>
 * @param dragOperation the supported action(s)
 */

protected void acceptDrag(int dragOperation) {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    if (peer != null) {
        peer.acceptDrag(dragOperation);
    }
}
 
Example #22
Source File: DropTargetContext.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * This method returns an <code>int</code> representing the
 * current actions this <code>DropTarget</code> will accept.
 * <P>
 * @return the current actions acceptable to this <code>DropTarget</code>
 */

protected int getTargetActions() {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    return ((peer != null)
                    ? peer.getTargetActions()
                    : dropTarget.getDefaultActions()
    );
}
 
Example #23
Source File: DropTargetContext.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * called to signal that the drop is acceptable
 * using the specified operation.
 * must be called during DropTargetListener.drop method invocation.
 * <P>
 * @param dropOperation the supported action(s)
 */

protected void acceptDrop(int dropOperation) {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    if (peer != null) {
        peer.acceptDrop(dropOperation);
    }
}
 
Example #24
Source File: DropTargetContext.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This method sets the current actions acceptable to
 * this <code>DropTarget</code>.
 * <P>
 * @param actions an <code>int</code> representing the supported action(s)
 */

protected void setTargetActions(int actions) {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    if (peer != null) {
        synchronized (peer) {
            peer.setTargetActions(actions);
            getDropTarget().doSetDefaultActions(actions);
        }
    } else {
        getDropTarget().doSetDefaultActions(actions);
    }
}
 
Example #25
Source File: DropTargetContext.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This method returns an <code>int</code> representing the
 * current actions this <code>DropTarget</code> will accept.
 * <P>
 * @return the current actions acceptable to this <code>DropTarget</code>
 */

protected int getTargetActions() {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    return ((peer != null)
                    ? peer.getTargetActions()
                    : dropTarget.getDefaultActions()
    );
}
 
Example #26
Source File: DropTargetContext.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * accept the Drag.
 * <P>
 * @param dragOperation the supported action(s)
 */

protected void acceptDrag(int dragOperation) {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    if (peer != null) {
        peer.acceptDrag(dragOperation);
    }
}
 
Example #27
Source File: DropTargetContext.java    From jdk-1.7-annotated with Apache License 2.0 5 votes vote down vote up
/**
 * called to signal that the drop is acceptable
 * using the specified operation.
 * must be called during DropTargetListener.drop method invocation.
 * <P>
 * @param dropOperation the supported action(s)
 */

protected void acceptDrop(int dropOperation) {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    if (peer != null) {
        peer.acceptDrop(dropOperation);
    }
}
 
Example #28
Source File: DropTargetContext.java    From Java8CN with Apache License 2.0 5 votes vote down vote up
/**
 * This method returns an <code>int</code> representing the
 * current actions this <code>DropTarget</code> will accept.
 * <P>
 * @return the current actions acceptable to this <code>DropTarget</code>
 */

protected int getTargetActions() {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    return ((peer != null)
                    ? peer.getTargetActions()
                    : dropTarget.getDefaultActions()
    );
}
 
Example #29
Source File: DropTargetContext.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This method returns an <code>int</code> representing the
 * current actions this <code>DropTarget</code> will accept.
 * <P>
 * @return the current actions acceptable to this <code>DropTarget</code>
 */

protected int getTargetActions() {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    return ((peer != null)
                    ? peer.getTargetActions()
                    : dropTarget.getDefaultActions()
    );
}
 
Example #30
Source File: DropTargetContext.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * called to signal that the drop is acceptable
 * using the specified operation.
 * must be called during DropTargetListener.drop method invocation.
 * <P>
 * @param dropOperation the supported action(s)
 */

protected void acceptDrop(int dropOperation) {
    DropTargetContextPeer peer = getDropTargetContextPeer();
    if (peer != null) {
        peer.acceptDrop(dropOperation);
    }
}