Package java.awt.dnd

Examples of java.awt.dnd.DragSource


      throw new NullPointerException();
    }
    elementName = elementMetaData.getName();
    putClientProperty("hideActionText", Boolean.TRUE); // NON-NLS

    final DragSource dragSource = new DragSource();

    dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY, this);

    final InsertElementAction action = new AlwaysActiveInsertElementAction(elementMetaData);
    action.setReportDesignerContext(context);
    setAction(action);
View Full Code Here


        DragGestureListener dragGestureListener = new DragGestureListener() {
            public void dragGestureRecognized(DragGestureEvent event) {
                ComponentSelector.this.dragGestureRecognized(event);
            }
        };
        DragSource dragSource = DragSource.getDefaultDragSource();
        dragSource.createDefaultDragGestureRecognizer(this.tree, DnDConstants.ACTION_COPY_OR_MOVE, dragGestureListener);

        this.dragSourceListener = new DragSourceAdapter() {
            // Overwrite some methods when needed.
        };
View Full Code Here

 
  class DGR extends DragGestureRecognizer
  {
    public DGR()
    {
      super(new DragSource());
    }
View Full Code Here

public class FlavourMapTest implements Testlet
{
 
  public void test(TestHarness h)
  {
    DragSource ds = new DragSource();
    h.check((ds.getFlavorMap() instanceof SystemFlavorMap));
  }
View Full Code Here

  public void test(TestHarness h)
  {
    boolean caught = false;
    try
    {
      DragSource ds = new DragSource();
      h.check(!ds.equals(DragSource.getDefaultDragSource()));
    }
    catch (HeadlessException he)
    {
      caught = true;
    }
View Full Code Here

   * Checks the state of the class before and after a call to
   * resetRecognizer().
   */
  public void testSimple()
  {
    DragSource s = new DragSource();
    Component c = new Component(){};
    DragGestureListener l = new DragGestureListener()
    {

      public void dragGestureRecognized(DragGestureEvent e)
View Full Code Here

public class CreateDragGestureRecognizerTest implements Testlet
{
 
  public void test(TestHarness h)
  {
    DragSource ds = new DragSource();
   
    DragGestureRecognizer dgr =
      ds.createDefaultDragGestureRecognizer(
                      new Label("label"), DnDConstants.ACTION_COPY, null);
    h.check(dgr != null);
  }
View Full Code Here

        component.validate();
        component.repaint();
    }

    public static void registerDragGesture(Component c, DragGesture dragGesture) {
        DragSource dragSource = new DragSource();
        dragSource.createDefaultDragGestureRecognizer(c, DnDConstants.ACTION_MOVE, dragGesture);
        dragSource.addDragSourceMotionListener(dragGesture);
    }
View Full Code Here

    protected void registerDragGesture(Component c) {
        if (dragGesture == null)
            initDragGesture();

        DragSource dragSource = new DragSource();
        dragSource.createDefaultDragGestureRecognizer(c, DnDConstants.ACTION_MOVE, dragGesture);
        dragSource.addDragSourceMotionListener(dragGesture);
    }
View Full Code Here

        component.validate();
        component.repaint();
    }

    public static void registerDragGesture(Component c, DragGesture dragGesture) {
        DragSource dragSource = new DragSource();
        dragSource.createDefaultDragGestureRecognizer(c, DnDConstants.ACTION_MOVE, dragGesture);
        dragSource.addDragSourceMotionListener(dragGesture);
    }
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.