Module tvbrowser
Package util.ui

Class ListDragAndDropHandler

  • All Implemented Interfaces:
    java.awt.dnd.DragGestureListener, java.awt.dnd.DropTargetListener, java.util.EventListener

    public class ListDragAndDropHandler
    extends java.lang.Object
    implements java.awt.dnd.DropTargetListener, java.awt.dnd.DragGestureListener
    A class for DnD in JLists and between two of them.
    Author:
    René Mach
    • Constructor Summary

      Constructors 
      Constructor Description
      ListDragAndDropHandler​(javax.swing.JList list1, javax.swing.JList list2, ListDropAction action)
      Cunstructor of this class.
      ListDragAndDropHandler​(javax.swing.JList list1, javax.swing.JList list2, ListDropAction action, boolean acceptStringFlavourList1, boolean acceptStringFlavourList2)
      Cunstructor of this class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dragEnter​(java.awt.dnd.DropTargetDragEvent e)  
      void dragExit​(java.awt.dnd.DropTargetEvent e)  
      void dragGestureRecognized​(java.awt.dnd.DragGestureEvent e)  
      void dragOver​(java.awt.dnd.DropTargetDragEvent e)  
      void drop​(java.awt.dnd.DropTargetDropEvent e)  
      void dropActionChanged​(java.awt.dnd.DropTargetDragEvent e)  
      void setPaintCueLine​(boolean list1, boolean list2)
      Enable printing of cueLines in the lists on DnD.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ListDragAndDropHandler

        public ListDragAndDropHandler​(javax.swing.JList list1,
                                      javax.swing.JList list2,
                                      ListDropAction action)
        Cunstructor of this class.
        Parameters:
        list1 - The first list.
        list2 - The second list (can be the same like the first).
        action - The Interface for the drop action.
      • ListDragAndDropHandler

        public ListDragAndDropHandler​(javax.swing.JList list1,
                                      javax.swing.JList list2,
                                      ListDropAction action,
                                      boolean acceptStringFlavourList1,
                                      boolean acceptStringFlavourList2)
        Cunstructor of this class.
        Parameters:
        list1 - The first list.
        list2 - The second list (can be the same like the first).
        action - The Interface for the drop action.
        acceptStringFlavourList1 - If Strings should be dropable for list 1.
        acceptStringFlavourList2 - If Strings should be dropable for list 2.
        Since:
        3.4.4
    • Method Detail

      • setPaintCueLine

        public void setPaintCueLine​(boolean list1,
                                    boolean list2)
        Enable printing of cueLines in the lists on DnD.
        Parameters:
        list1 - Set this false to disables cueLine for the first list.
        list2 - Set this false to disables cueLine for the second list.
      • dragGestureRecognized

        public void dragGestureRecognized​(java.awt.dnd.DragGestureEvent e)
        Specified by:
        dragGestureRecognized in interface java.awt.dnd.DragGestureListener
      • dragEnter

        public void dragEnter​(java.awt.dnd.DropTargetDragEvent e)
        Specified by:
        dragEnter in interface java.awt.dnd.DropTargetListener
      • dragOver

        public void dragOver​(java.awt.dnd.DropTargetDragEvent e)
        Specified by:
        dragOver in interface java.awt.dnd.DropTargetListener
      • dropActionChanged

        public void dropActionChanged​(java.awt.dnd.DropTargetDragEvent e)
        Specified by:
        dropActionChanged in interface java.awt.dnd.DropTargetListener
      • dragExit

        public void dragExit​(java.awt.dnd.DropTargetEvent e)
        Specified by:
        dragExit in interface java.awt.dnd.DropTargetListener
      • drop

        public void drop​(java.awt.dnd.DropTargetDropEvent e)
        Specified by:
        drop in interface java.awt.dnd.DropTargetListener