Package java.awt.dnd

Examples of java.awt.dnd.DragSource


      public void mouseExited(MouseEvent evt) {
        handleMouseExited(evt);
      }
    });

    (new DragSource()).createDefaultDragGestureRecognizer(this,
        DnDConstants.ACTION_MOVE, this);
  }
View Full Code Here


    });

    getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);

    new OverlayListener(this);
    (new DragSource()).createDefaultDragGestureRecognizer(this,
        DnDConstants.ACTION_MOVE, this);

    new DropTarget(this, this);
  }
View Full Code Here

      button.addMouseListener(this);
      addMouseAdapterForHandCursorToComponent(button);
      button.setContentAreaFilled(false);

      // Set up the available ActionButtons for dragging
      DragSource d = new DragSource();
      d.createDefaultDragGestureRecognizer(button, DnDConstants.ACTION_MOVE, this);

      button.setEnabled(false);
      mButtonPanel.add(button);
    }
    mButtonPanel.updateUI();
View Full Code Here

    int x = this.getComponentCount();

    /* Prepare all ToolBar buttons for Drag'n'Drop */
    for (int i = 0; i < x; i++) {
      (new DragSource()).createDefaultDragGestureRecognizer(this
          .getComponent(i), DnDConstants.ACTION_MOVE, s);
      if (this.getComponent(i) instanceof AbstractButton) {
        AbstractButton b = (AbstractButton) this.getComponent(i);
        b.setDisabledIcon(b.getIcon());
        b.setBorder(BorderFactory.createEmptyBorder(b.getInsets().top,b.getInsets().left,b.getInsets().bottom,b.getInsets().right));
View Full Code Here

    protected TreeTransferHandler(JTree tree, JTreeDragController controller,
        int action, boolean drawIcon) {
      this.tree = tree;
      this.controller = controller;
      drawImage = drawIcon;
      dragSource = new DragSource();
      dragSource.createDefaultDragGestureRecognizer(tree, action, this);
    }
View Full Code Here

      if(!(mlisteners[i] instanceof ToolTipManager)) {
        mSource.removeMouseMotionListener(mlisteners[i]);
      }
    }
   
    (new DragSource()).createDefaultDragGestureRecognizer(mSource,
        DnDConstants.ACTION_MOVE, mListener);
   
    mSource.addMouseListener(this);
  }
View Full Code Here

    InputMap inputMap = getInputMap();
    KeyStroke keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0);
    inputMap.put(keyStroke, "none");

    new OverlayListener(this);
    (new DragSource()).createDefaultDragGestureRecognizer(this,
        DnDConstants.ACTION_MOVE, this);

    new DropTarget(this, this);
  }
View Full Code Here

   * event or an event in the form "drop[mimeType1,mimeType2]"
   */
  public void addListener(String event, String name, GUIEventListener listener) throws GUIException {
    if (event.equals("drag")) {
      DragHandler handler = new DragHandler(this, listener, name);
      DragSource dragSource = DragSource.getDefaultDragSource();
      dragSource.createDefaultDragGestureRecognizer(getRealWidget(), DnDConstants.ACTION_COPY_OR_MOVE, handler);
    } else if (event.startsWith("drop[") && event.endsWith("]")) {
      try {
        StringTokenizer tokenizer = new StringTokenizer(event.substring(5, event.length() - 1), ", ");
        DataFlavor flavors[] = new DataFlavor[tokenizer.countTokens()];

View Full Code Here

    /**
     * Constructs a new DefaultDnDCatcher.
     */
    public DefaultDnDCatcher() {
        this(new DragSource());
    }
View Full Code Here

            }
        };
        if (!app.isOnlyViewer)
            treetable.addMouseListener(ml);

        DragSource dragSource = DragSource.getDefaultDragSource();
        dragSource.createDefaultDragGestureRecognizer(treetable,
                DnDConstants.ACTION_COPY_OR_MOVE, this);
        dragSource.addDragSourceListener(this);
        DropTarget dropTarget = new DropTarget(treetable,
                new GanttTreeDropListener());
        dropTarget.setDefaultActions(DnDConstants.ACTION_COPY_OR_MOVE);

        getTreeTable().setToolTipText("aze");
View Full Code Here

TOP

Related Classes of java.awt.dnd.DragSource

Copyright © 2018 www.massapicom. 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.