Examples of DropTargetContext


Examples of java.awt.dnd.DropTargetContext

         *            The DropTargetDragEvent
         * @return Associated TreeNode or null
         */
        private TreeNode getNode(DropTargetDragEvent dtde) {
            Point p = dtde.getLocation();
            DropTargetContext dtc = dtde.getDropTargetContext();
            JTree tree = (JTree) dtc.getComponent();
            TreePath path = tree.getPathForLocation(p.x, p.y);
            if (path == null || path.getLastPathComponent() == null) {
                return null;
            }
            return (TreeNode) path.getLastPathComponent();
View Full Code Here

Examples of java.awt.dnd.DropTargetContext

     */

    private void processExitMessage(SunDropTargetEvent event) {
        Component         c   = (Component)event.getSource();
        DropTarget        dt  = c.getDropTarget();
        DropTargetContext dtc = null;

        if (dt == null) {
            currentDT = null;
            currentT  = null;

View Full Code Here

Examples of java.awt.dnd.DropTargetContext

                                      boolean operationChanged) {
        Component         c    = (Component)event.getSource();
        Point             hots = event.getPoint();
        int               id   = event.getID();
        DropTarget        dt   = c.getDropTarget();
        DropTargetContext dtc  = null;

        if (c.isShowing() && (dt != null) && dt.isActive()) {
            if (currentDT != dt) {
                if (currentDTC != null) {
                    currentDTC.removeNotify();
View Full Code Here

Examples of java.awt.dnd.DropTargetContext

        dropStatus   = STATUS_WAIT; // drop pending ACK
        dropComplete = false;

        if (c.isShowing() && dt != null && dt.isActive()) {
            DropTargetContext dtc = dt.getDropTargetContext();

            currentDT = dt;

            if (currentDTC != null) {
                currentDTC.removeNotify();
View Full Code Here

Examples of java.awt.dnd.DropTargetContext

  private class FileDropper extends DropTargetAdapter {
   
    @Override
        public void drop(DropTargetDropEvent e) {
      try {
        DropTargetContext context = e.getDropTargetContext();
        e.acceptDrop( DnDConstants.ACTION_COPY_OR_MOVE );
        Transferable t = e.getTransferable();
        Object data = t.getTransferData( DataFlavor.javaFileListFlavor );
        if( data instanceof java.util.List ) {
          for( Iterator<?> it = ((java.util.List<?>)data).iterator(); it.hasNext(); ) {
            Object o = it.next();
            if( o instanceof File ) {
                fireFileDropped( (File)o );
            }
          }
        }
        context.dropComplete(true);
      }
      catch (InvalidDnDOperationException e1) {
        e1.printStackTrace();
      }
      catch (UnsupportedFlavorException e1) {
View Full Code Here

Examples of java.awt.dnd.DropTargetContext

    private String lastAction;
    private void describe(String type, DropTargetEvent e) {
        if (false) {
            String msg = "drop: " + type;
            if (e instanceof DropTargetDragEvent) {
                DropTargetContext dtc = e.getDropTargetContext();
                DropTarget dt = dtc.getDropTarget();
                DropTargetDragEvent ev = (DropTargetDragEvent)e;
                msg += ": src=" + DragHandler.actionString(ev.getSourceActions())
                    + " tgt=" + DragHandler.actionString(dt.getDefaultActions())
                    + " act=" + DragHandler.actionString(ev.getDropAction());
            }
            else if (e instanceof DropTargetDropEvent) {
                DropTargetContext dtc = e.getDropTargetContext();
                DropTarget dt = dtc.getDropTarget();
                DropTargetDropEvent ev = (DropTargetDropEvent)e;
                msg += ": src=" + DragHandler.actionString(ev.getSourceActions())
                + " tgt=" + DragHandler.actionString(dt.getDefaultActions())
                + " act=" + DragHandler.actionString(ev.getDropAction());
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.