< prev index next >

src/java.desktop/unix/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java

Print this page




  38 /**
  39  * XDragSourceProtocol implementation for Motif DnD protocol.
  40  *
  41  * @since 1.5
  42  */
  43 class MotifDnDDragSourceProtocol extends XDragSourceProtocol
  44     implements XEventDispatcher {
  45 
  46     private static final Unsafe unsafe = XlibWrapper.unsafe;
  47 
  48     private long targetEnterServerTime = XConstants.CurrentTime;
  49 
  50     protected MotifDnDDragSourceProtocol(XDragSourceProtocolListener listener) {
  51         super(listener);
  52         XToolkit.addEventDispatcher(XWindow.getXAWTRootWindow().getWindow(), this);
  53     }
  54 
  55     /**
  56      * Creates an instance associated with the specified listener.
  57      *
  58      * @throws NullPointerException if listener is <code>null</code>.
  59      */
  60     static XDragSourceProtocol createInstance(XDragSourceProtocolListener listener) {
  61         return new MotifDnDDragSourceProtocol(listener);
  62     }
  63 
  64     public String getProtocolName() {
  65         return XDragAndDropProtocols.MotifDnD;
  66     }
  67 
  68     protected void initializeDragImpl(int actions, Transferable contents,
  69                                       Map<Long, DataFlavor> formatMap, long[] formats)
  70       throws InvalidDnDOperationException,
  71         IllegalArgumentException, XException {
  72 
  73         long window = XDragSourceProtocol.getDragSourceWindow();
  74 
  75         /* Write the Motif DnD initiator info on the root XWindow. */
  76         try {
  77             int index = MotifDnDConstants.getIndexForTargetList(formats);
  78 




  38 /**
  39  * XDragSourceProtocol implementation for Motif DnD protocol.
  40  *
  41  * @since 1.5
  42  */
  43 class MotifDnDDragSourceProtocol extends XDragSourceProtocol
  44     implements XEventDispatcher {
  45 
  46     private static final Unsafe unsafe = XlibWrapper.unsafe;
  47 
  48     private long targetEnterServerTime = XConstants.CurrentTime;
  49 
  50     protected MotifDnDDragSourceProtocol(XDragSourceProtocolListener listener) {
  51         super(listener);
  52         XToolkit.addEventDispatcher(XWindow.getXAWTRootWindow().getWindow(), this);
  53     }
  54 
  55     /**
  56      * Creates an instance associated with the specified listener.
  57      *
  58      * @throws NullPointerException if listener is {@code null}.
  59      */
  60     static XDragSourceProtocol createInstance(XDragSourceProtocolListener listener) {
  61         return new MotifDnDDragSourceProtocol(listener);
  62     }
  63 
  64     public String getProtocolName() {
  65         return XDragAndDropProtocols.MotifDnD;
  66     }
  67 
  68     protected void initializeDragImpl(int actions, Transferable contents,
  69                                       Map<Long, DataFlavor> formatMap, long[] formats)
  70       throws InvalidDnDOperationException,
  71         IllegalArgumentException, XException {
  72 
  73         long window = XDragSourceProtocol.getDragSourceWindow();
  74 
  75         /* Write the Motif DnD initiator info on the root XWindow. */
  76         try {
  77             int index = MotifDnDConstants.getIndexForTargetList(formats);
  78 


< prev index next >