Package java.awt.dnd

Examples of java.awt.dnd.DragSource


    protected void registerDragListener(Component c) {
        if (dragListener == null)
            initDragListener();

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


    public static DragGestureRecognizer registerDragListener(Component c, DragListener dragListener) {
        if (dragEntryMap.containsKey(c))
            return dragEntryMap.get(c).dragGestureRecognizer;

        DragSource dragSource = new DragSource();
        DragGestureRecognizer recognizer = dragSource.createDefaultDragGestureRecognizer(c, DnDConstants.ACTION_MOVE, dragListener);
        dragSource.addDragSourceMotionListener(dragListener);

        dragEntryMap.put(c, new DragEntry(recognizer, dragListener));

        return recognizer;
    }
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

        addTreeSelectionListener(listener);
        TreeSelectionModel selModel = this.getSelectionModel();
        selModel.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);

        // drag drop initialization
        ds = new DragSource();
        dt = new DropTarget();

        ds.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY, this);
        try
        {
View Full Code Here

    DropTarget dt;

    StringSelection transferable;   
    public TestCaseTree(JTreeTable destinationComponent) {
        super();
        ds = new DragSource();
        dt = new DropTarget();       
        mTestCaseTree = this;
        this.treeTable = destinationComponent;
       
        ds.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY, this);
View Full Code Here

    String scale = state.getFirstPropertyValue(SCALE);
    if (scale == null)
      state.setProperty(SCALE, scale = "1.0");
    jgraph.setScale(Double.parseDouble(scale));

    DragSource dragSource = DragSource.getDefaultDragSource();
    dragSource.createDefaultDragGestureRecognizer(this.jgraph,
        DnDConstants.ACTION_MOVE, new DragGestureListener() {

          DefaultGraphCell moveCell = null;
          ModelGraph moveGraph = null;
View Full Code Here

          }
        }
      }
    };

    DragSource dragSource = new DragSource();
    dragSource.createDefaultDragGestureRecognizer(
        graphComponent.getGraphControl(),
        DnDConstants.ACTION_COPY_OR_MOVE, dragGestureListener);
  }
View Full Code Here

class RoleResolutionContextTextField extends JTextField implements DragGestureListener,
                                DragSourceListener
{
  public RoleResolutionContextTextField() {
    DragSource dragSource = DragSource.getDefaultDragSource();

    dragSource.createDefaultDragGestureRecognizer(
          this, // component where drag originates
          DnDConstants.ACTION_COPY_OR_MOVE, // actions
          this); // drag gesture recognizer
         
    setEditable(false);
View Full Code Here

              ProcessDesigner.this.insertActivity(activityCls);
              ProcessDesigner.this.setDocumentChanged(true);
            }         
          });
         
          DragSource dragSource = DragSource.getDefaultDragSource();
          dragSource.createDefaultDragGestureRecognizer(
            btn, // component where drag originates
            DnDConstants.ACTION_COPY_OR_MOVE, // actions
            new DragGestureListener(){
              /**
               * start of D&D framework implementation
View Full Code Here

 
  public TransformerArgument(){
    setBackground(Color.BLACK);
    //setPreferredSize(new Dimension(50,10));
   
    DragSource dragSource = DragSource.getDefaultDragSource();
       
    DragGestureRecognizer dgr =
      dragSource.createDefaultDragGestureRecognizer(
            this,                                 //DragSource
            DnDConstants.ACTION_LINK,       //specifies valid actions
            this                                  //DragGestureListener
          );
      
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.