Examples of DragSource


Examples of com.extjs.gxt.ui.client.dnd.DragSource

      html.setStyleAttribute("border", "1px solid red");
      html.setStyleAttribute("cursor", "default");
      html.setStyleName("text");
      container.add(html, new FlowData(3));

      DragSource source = new DragSource(html) {
        @Override
        protected void onDragStart(DNDEvent event) {
          // by default drag is allowed
          event.setData(html);
          event.getStatus().update(El.fly(html.getElement()).cloneNode(true));
        }
      };
      // group is optional
      source.setGroup("test");
    }
  }
View Full Code Here

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

Examples of java.awt.dnd.DragSource

    });

    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

Examples of java.awt.dnd.DragSource

      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

Examples of java.awt.dnd.DragSource

    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

Examples of java.awt.dnd.DragSource

    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

Examples of java.awt.dnd.DragSource

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

Examples of java.awt.dnd.DragSource

    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

Examples of java.awt.dnd.DragSource

   * 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

Examples of java.awt.dnd.DragSource

    /**
     * Constructs a new DefaultDnDCatcher.
     */
    public DefaultDnDCatcher() {
        this(new DragSource());
    }
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.