Java 类java.awt.dnd.DropTargetListener 实例源码

项目:incubator-netbeans    文件:PluginManagerUI.java   
private void postInitComponents () {
    Containers.initNotify ();
    updateTable = createTabForModel(new UpdateTableModel(units));
    availableTable = createTabForModel(new AvailableTableModel (units));
    final LocalDownloadSupport localDownloadSupport = new LocalDownloadSupport();
    final LocallyDownloadedTableModel localTM = new LocallyDownloadedTableModel(localDownloadSupport);
    localTable = createTabForModel(localTM);
    installedTable = createTabForModel(new InstalledTableModel(units));

    DropTargetListener l = new LocallDownloadDnD(localDownloadSupport, localTM, this);
    final DropTarget dt = new DropTarget(null, l);
    dt.setActive(true);
    this.setDropTarget(dt);


    final SettingsTab tab = new SettingsTab(this);
    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            tpTabs.add(tab, INDEX_OF_SETTINGS_TAB);
            tpTabs.setTitleAt(INDEX_OF_SETTINGS_TAB, tab.getDisplayName());
        }
    });
    setWaitingState(true);
}
项目:freemind_1.0.0_20140624_214725    文件:IndependantMapViewCreator.java   
protected MapView createMapView(Controller controller, MindMapMapModel model) {
    MapView mapView = new MapView(model, controller) {
        DragGestureListener getNodeDragListener() {
            return null;
        }

        DropTargetListener getNodeDropListener() {
            return null;
        }

        public void selectAsTheOnlyOneSelected(NodeView pNewSelected,
                boolean pRequestFocus) {
        }

    };
    return mapView;
}
项目:freemind    文件:IndependantMapViewCreator.java   
protected MapView createMapView(Controller controller, MindMapMapModel model) {
    MapView mapView = new MapView(model, controller) {
        DragGestureListener getNodeDragListener() {
            return null;
        }

        DropTargetListener getNodeDropListener() {
            return null;
        }

        public void selectAsTheOnlyOneSelected(NodeView pNewSelected,
                boolean pRequestFocus) {
        }

    };
    return mapView;
}
项目:caadapter    文件:CSVTreeChangeAdapter.java   
/**
 * Invoked when a component loses the keyboard focus.
 */
public void focusLost(FocusEvent e)
{
    DropCompatibleComponent dropTransferHandler = parentPanel.getDropTransferHandler();
    if(dropTransferHandler!=null)
    {
        if(dropTransferHandler.isInDragDropMode())
        {
            DropTargetListener dropListener = dropTransferHandler.getDropTargetAdapter();
            dropListener.dragExit(null);
        }
    }

    Component sourceComp = e.getComponent();
    Component targetComp = e.getOppositeComponent();
    String sourceStr = sourceComp==null? "null" : sourceComp.getClass().getName();
    String targetStr = targetComp==null? "null" : targetComp.getClass().getName();
    Log.logInfo(this, "Source Comp: '" + sourceStr);
    Log.logInfo(this, "Target Comp: '" + targetStr);
}
项目:rapidminer    文件:ProcessRendererDropTarget.java   
public ProcessRendererDropTarget(final ProcessRendererView view, final DropTargetListener dropTargetListener) {
    super(view, TransferHandler.COPY_OR_MOVE | TransferHandler.LINK, null);
    this.view = view;
    try {
        super.addDropTargetListener(dropTargetListener);
    } catch (TooManyListenersException tmle) {
    }
}
项目:rapidminer    文件:ProcessRendererDropTarget.java   
@Override
public void dragEnter(final DropTargetDragEvent e) {
    super.dragEnter(e);
    if (dropTragetListenerList != null) {
        Object[] listeners = dropTragetListenerList.getListenerList();
        for (int i = listeners.length - 2; i >= 0; i -= 2) {
            if (listeners[i] == DropTargetListener.class) {
                ((DropTargetListener) listeners[i + 1]).dragEnter(e);
            }
        }
    }
}
项目:rapidminer    文件:ProcessRendererDropTarget.java   
@Override
public void dragOver(final DropTargetDragEvent e) {
    super.dragOver(e);
    if (dropTragetListenerList != null) {
        Object[] listeners = dropTragetListenerList.getListenerList();
        for (int i = listeners.length - 2; i >= 0; i -= 2) {
            if (listeners[i] == DropTargetListener.class) {
                ((DropTargetListener) listeners[i + 1]).dragOver(e);
            }
        }
    }
}
项目:rapidminer    文件:ProcessRendererDropTarget.java   
@Override
public void dragExit(final DropTargetEvent e) {
    super.dragExit(e);
    view.getModel().setImportDragged(false);
    view.getModel().fireMiscChanged();
    if (dropTragetListenerList != null) {
        Object[] listeners = dropTragetListenerList.getListenerList();
        for (int i = listeners.length - 2; i >= 0; i -= 2) {
            if (listeners[i] == DropTargetListener.class) {
                ((DropTargetListener) listeners[i + 1]).dragExit(e);
            }
        }
    }
}
项目:rapidminer    文件:ProcessRendererDropTarget.java   
@Override
public void drop(final DropTargetDropEvent e) {
    super.drop(e);
    view.getModel().setImportDragged(false);
    view.getModel().fireMiscChanged();
    if (dropTragetListenerList != null) {
        Object[] listeners = dropTragetListenerList.getListenerList();
        for (int i = listeners.length - 2; i >= 0; i -= 2) {
            if (listeners[i] == DropTargetListener.class) {
                ((DropTargetListener) listeners[i + 1]).drop(e);
            }
        }
    }
}
项目:rapidminer    文件:ProcessRendererDropTarget.java   
@Override
public void dropActionChanged(final DropTargetDragEvent e) {
    super.dropActionChanged(e);
    if (dropTragetListenerList != null) {
        Object[] listeners = dropTragetListenerList.getListenerList();
        for (int i = listeners.length - 2; i >= 0; i -= 2) {
            if (listeners[i] == DropTargetListener.class) {
                ((DropTargetListener) listeners[i + 1]).dropActionChanged(e);
            }
        }
    }
}
项目:rapidminer    文件:AbstractPatchedTransferHandler.java   
/**
 * Dirty hack to get the drop target listener defined in {@link TransferHandler} by method
 * invokation.
 */
public static DropTargetListener getDropTargetListener() throws NoSuchMethodException, SecurityException,
        IllegalAccessException, IllegalArgumentException, InvocationTargetException {
    Method m;
    m = TransferHandler.class.getDeclaredMethod("getDropTargetListener");
    m.setAccessible(true); // if security settings allow this
    return (DropTargetListener) m.invoke(null); // use null if the method is static
}
项目:VASSAL-src    文件:PieceMover.java   
/**
 * Creates a new DropTarget and hooks us into the beginning of a
 * DropTargetListener chain. DropTarget events are not multicast;
 * there can be only one "true" listener.
 */
static public DropTarget makeDropTarget(Component theComponent, int dndContants, DropTargetListener dropTargetListener) {
  if (dropTargetListener != null) {
    DragHandler.getTheDragHandler()
               .dropTargetListeners.put(theComponent, dropTargetListener);
  }
  return new DropTarget(theComponent, dndContants,
                        DragHandler.getTheDragHandler());
}
项目:VASSAL-src    文件:PieceMover.java   
/**
 * Last event of the drop operation. We adjust the drop point for
 * off-center drag, remove the cursor, and pass the event along
 * listener chain.
 */
public void drop(DropTargetDropEvent e) {
   // EVENT uses UNSCALED, DROP-TARGET coordinate system
   e.getLocation().translate(currentPieceOffsetX, currentPieceOffsetY);
   final DropTargetListener forward = getListener(e);
   if (forward != null) forward.drop(e);
}
项目:OpenJSharp    文件:SunDropTargetContextPeer.java   
/**
 * actual processing on EventQueue Thread
 */

protected void processEnterMessage(SunDropTargetEvent event) {
    Component  c    = (Component)event.getSource();
    DropTarget dt   = c.getDropTarget();
    Point      hots = event.getPoint();

    local = getJVMLocalSourceTransferable();

    if (currentDTC != null) { // some wreckage from last time
        currentDTC.removeNotify();
        currentDTC = null;
    }

    if (c.isShowing() && dt != null && dt.isActive()) {
        currentDT  = dt;
        currentDTC = currentDT.getDropTargetContext();

        currentDTC.addNotify(this);

        currentA   = dt.getDefaultActions();

        try {
            ((DropTargetListener)dt).dragEnter(new DropTargetDragEvent(currentDTC,
                                                                       hots,
                                                                       currentDA,
                                                                       currentSA));
        } catch (Exception e) {
            e.printStackTrace();
            currentDA = DnDConstants.ACTION_NONE;
        }
    } else {
        currentDT  = null;
        currentDTC = null;
        currentDA   = DnDConstants.ACTION_NONE;
        currentSA   = DnDConstants.ACTION_NONE;
        currentA   = DnDConstants.ACTION_NONE;
    }

}
项目:OpenJSharp    文件:XEmbedCanvasPeer.java   
public void addDropTargetListener(DropTargetListener dtl)
  throws TooManyListenersException {
    // Drop target listeners registered with this target will never be
    // notified, since all drag notifications are routed to the XEmbed
    // client. To avoid confusion we prohibit listeners registration
    // by throwing TooManyListenersException as if there is a listener
    // registered with this target already.
    throw new TooManyListenersException();
}
项目:jdk8u-jdk    文件:SunDropTargetContextPeer.java   
/**
 * actual processing on EventQueue Thread
 */

protected void processEnterMessage(SunDropTargetEvent event) {
    Component  c    = (Component)event.getSource();
    DropTarget dt   = c.getDropTarget();
    Point      hots = event.getPoint();

    local = getJVMLocalSourceTransferable();

    if (currentDTC != null) { // some wreckage from last time
        currentDTC.removeNotify();
        currentDTC = null;
    }

    if (c.isShowing() && dt != null && dt.isActive()) {
        currentDT  = dt;
        currentDTC = currentDT.getDropTargetContext();

        currentDTC.addNotify(this);

        currentA   = dt.getDefaultActions();

        try {
            ((DropTargetListener)dt).dragEnter(new DropTargetDragEvent(currentDTC,
                                                                       hots,
                                                                       currentDA,
                                                                       currentSA));
        } catch (Exception e) {
            e.printStackTrace();
            currentDA = DnDConstants.ACTION_NONE;
        }
    } else {
        currentDT  = null;
        currentDTC = null;
        currentDA   = DnDConstants.ACTION_NONE;
        currentSA   = DnDConstants.ACTION_NONE;
        currentA   = DnDConstants.ACTION_NONE;
    }

}
项目:jdk8u-jdk    文件:XEmbedCanvasPeer.java   
public void addDropTargetListener(DropTargetListener dtl)
  throws TooManyListenersException {
    // Drop target listeners registered with this target will never be
    // notified, since all drag notifications are routed to the XEmbed
    // client. To avoid confusion we prohibit listeners registration
    // by throwing TooManyListenersException as if there is a listener
    // registered with this target already.
    throw new TooManyListenersException();
}
项目:openjdk-jdk10    文件:XEmbedCanvasPeer.java   
public void addDropTargetListener(DropTargetListener dtl)
  throws TooManyListenersException {
    // Drop target listeners registered with this target will never be
    // notified, since all drag notifications are routed to the XEmbed
    // client. To avoid confusion we prohibit listeners registration
    // by throwing TooManyListenersException as if there is a listener
    // registered with this target already.
    throw new TooManyListenersException();
}
项目:openjdk9    文件:XEmbedCanvasPeer.java   
public void addDropTargetListener(DropTargetListener dtl)
  throws TooManyListenersException {
    // Drop target listeners registered with this target will never be
    // notified, since all drag notifications are routed to the XEmbed
    // client. To avoid confusion we prohibit listeners registration
    // by throwing TooManyListenersException as if there is a listener
    // registered with this target already.
    throw new TooManyListenersException();
}
项目:jdk8u_jdk    文件:SunDropTargetContextPeer.java   
/**
 * actual processing on EventQueue Thread
 */

protected void processEnterMessage(SunDropTargetEvent event) {
    Component  c    = (Component)event.getSource();
    DropTarget dt   = c.getDropTarget();
    Point      hots = event.getPoint();

    local = getJVMLocalSourceTransferable();

    if (currentDTC != null) { // some wreckage from last time
        currentDTC.removeNotify();
        currentDTC = null;
    }

    if (c.isShowing() && dt != null && dt.isActive()) {
        currentDT  = dt;
        currentDTC = currentDT.getDropTargetContext();

        currentDTC.addNotify(this);

        currentA   = dt.getDefaultActions();

        try {
            ((DropTargetListener)dt).dragEnter(new DropTargetDragEvent(currentDTC,
                                                                       hots,
                                                                       currentDA,
                                                                       currentSA));
        } catch (Exception e) {
            e.printStackTrace();
            currentDA = DnDConstants.ACTION_NONE;
        }
    } else {
        currentDT  = null;
        currentDTC = null;
        currentDA   = DnDConstants.ACTION_NONE;
        currentSA   = DnDConstants.ACTION_NONE;
        currentA   = DnDConstants.ACTION_NONE;
    }

}
项目:jdk8u_jdk    文件:XEmbedCanvasPeer.java   
public void addDropTargetListener(DropTargetListener dtl)
  throws TooManyListenersException {
    // Drop target listeners registered with this target will never be
    // notified, since all drag notifications are routed to the XEmbed
    // client. To avoid confusion we prohibit listeners registration
    // by throwing TooManyListenersException as if there is a listener
    // registered with this target already.
    throw new TooManyListenersException();
}
项目:lookaside_java-1.8.0-openjdk    文件:SunDropTargetContextPeer.java   
/**
 * actual processing on EventQueue Thread
 */

protected void processEnterMessage(SunDropTargetEvent event) {
    Component  c    = (Component)event.getSource();
    DropTarget dt   = c.getDropTarget();
    Point      hots = event.getPoint();

    local = getJVMLocalSourceTransferable();

    if (currentDTC != null) { // some wreckage from last time
        currentDTC.removeNotify();
        currentDTC = null;
    }

    if (c.isShowing() && dt != null && dt.isActive()) {
        currentDT  = dt;
        currentDTC = currentDT.getDropTargetContext();

        currentDTC.addNotify(this);

        currentA   = dt.getDefaultActions();

        try {
            ((DropTargetListener)dt).dragEnter(new DropTargetDragEvent(currentDTC,
                                                                       hots,
                                                                       currentDA,
                                                                       currentSA));
        } catch (Exception e) {
            e.printStackTrace();
            currentDA = DnDConstants.ACTION_NONE;
        }
    } else {
        currentDT  = null;
        currentDTC = null;
        currentDA   = DnDConstants.ACTION_NONE;
        currentSA   = DnDConstants.ACTION_NONE;
        currentA   = DnDConstants.ACTION_NONE;
    }

}
项目:lookaside_java-1.8.0-openjdk    文件:XEmbedCanvasPeer.java   
public void addDropTargetListener(DropTargetListener dtl)
  throws TooManyListenersException {
    // Drop target listeners registered with this target will never be
    // notified, since all drag notifications are routed to the XEmbed
    // client. To avoid confusion we prohibit listeners registration
    // by throwing TooManyListenersException as if there is a listener
    // registered with this target already.
    throw new TooManyListenersException();
}
项目:rapidminer-studio    文件:ProcessRendererDropTarget.java   
public ProcessRendererDropTarget(final ProcessRendererView view, final DropTargetListener dropTargetListener) {
    super(view, TransferHandler.COPY_OR_MOVE | TransferHandler.LINK, null);
    this.view = view;
    try {
        super.addDropTargetListener(dropTargetListener);
    } catch (TooManyListenersException tmle) {
    }
}
项目:rapidminer-studio    文件:ProcessRendererDropTarget.java   
@Override
public void addDropTargetListener(final DropTargetListener dtl) throws TooManyListenersException {
    if (dropTragetListenerList == null) {
        dropTragetListenerList = new EventListenerList();
    }
    dropTragetListenerList.add(DropTargetListener.class, dtl);
}
项目:rapidminer-studio    文件:ProcessRendererDropTarget.java   
@Override
public void dragEnter(final DropTargetDragEvent e) {
    super.dragEnter(e);
    if (dropTragetListenerList != null) {
        Object[] listeners = dropTragetListenerList.getListenerList();
        for (int i = listeners.length - 2; i >= 0; i -= 2) {
            if (listeners[i] == DropTargetListener.class) {
                ((DropTargetListener) listeners[i + 1]).dragEnter(e);
            }
        }
    }
}
项目:rapidminer-studio    文件:ProcessRendererDropTarget.java   
@Override
public void dragOver(final DropTargetDragEvent e) {
    super.dragOver(e);
    if (dropTragetListenerList != null) {
        Object[] listeners = dropTragetListenerList.getListenerList();
        for (int i = listeners.length - 2; i >= 0; i -= 2) {
            if (listeners[i] == DropTargetListener.class) {
                ((DropTargetListener) listeners[i + 1]).dragOver(e);
            }
        }
    }
}
项目:rapidminer-studio    文件:ProcessRendererDropTarget.java   
@Override
public void dragExit(final DropTargetEvent e) {
    super.dragExit(e);
    view.getModel().setImportDragged(false);
    view.getModel().fireMiscChanged();
    if (dropTragetListenerList != null) {
        Object[] listeners = dropTragetListenerList.getListenerList();
        for (int i = listeners.length - 2; i >= 0; i -= 2) {
            if (listeners[i] == DropTargetListener.class) {
                ((DropTargetListener) listeners[i + 1]).dragExit(e);
            }
        }
    }
}
项目:rapidminer-studio    文件:ProcessRendererDropTarget.java   
@Override
public void drop(final DropTargetDropEvent e) {
    super.drop(e);
    view.getModel().setImportDragged(false);
    view.getModel().fireMiscChanged();
    if (dropTragetListenerList != null) {
        Object[] listeners = dropTragetListenerList.getListenerList();
        for (int i = listeners.length - 2; i >= 0; i -= 2) {
            if (listeners[i] == DropTargetListener.class) {
                ((DropTargetListener) listeners[i + 1]).drop(e);
            }
        }
    }
}
项目:rapidminer-studio    文件:ProcessRendererDropTarget.java   
@Override
public void dropActionChanged(final DropTargetDragEvent e) {
    super.dropActionChanged(e);
    if (dropTragetListenerList != null) {
        Object[] listeners = dropTragetListenerList.getListenerList();
        for (int i = listeners.length - 2; i >= 0; i -= 2) {
            if (listeners[i] == DropTargetListener.class) {
                ((DropTargetListener) listeners[i + 1]).dropActionChanged(e);
            }
        }
    }
}
项目:rapidminer-studio    文件:AbstractPatchedTransferHandler.java   
/**
 * Dirty hack to get the drop target listener defined in {@link TransferHandler} by method
 * invokation.
 */
public static DropTargetListener getDropTargetListener() throws NoSuchMethodException, SecurityException,
        IllegalAccessException, IllegalArgumentException, InvocationTargetException {
    Method m;
    m = TransferHandler.class.getDeclaredMethod("getDropTargetListener");
    m.setAccessible(true); // if security settings allow this
    return (DropTargetListener) m.invoke(null); // use null if the method is static
}
项目:infobip-open-jdk-8    文件:SunDropTargetContextPeer.java   
/**
 * actual processing on EventQueue Thread
 */

protected void processEnterMessage(SunDropTargetEvent event) {
    Component  c    = (Component)event.getSource();
    DropTarget dt   = c.getDropTarget();
    Point      hots = event.getPoint();

    local = getJVMLocalSourceTransferable();

    if (currentDTC != null) { // some wreckage from last time
        currentDTC.removeNotify();
        currentDTC = null;
    }

    if (c.isShowing() && dt != null && dt.isActive()) {
        currentDT  = dt;
        currentDTC = currentDT.getDropTargetContext();

        currentDTC.addNotify(this);

        currentA   = dt.getDefaultActions();

        try {
            ((DropTargetListener)dt).dragEnter(new DropTargetDragEvent(currentDTC,
                                                                       hots,
                                                                       currentDA,
                                                                       currentSA));
        } catch (Exception e) {
            e.printStackTrace();
            currentDA = DnDConstants.ACTION_NONE;
        }
    } else {
        currentDT  = null;
        currentDTC = null;
        currentDA   = DnDConstants.ACTION_NONE;
        currentSA   = DnDConstants.ACTION_NONE;
        currentA   = DnDConstants.ACTION_NONE;
    }

}
项目:infobip-open-jdk-8    文件:XEmbedCanvasPeer.java   
public void addDropTargetListener(DropTargetListener dtl)
  throws TooManyListenersException {
    // Drop target listeners registered with this target will never be
    // notified, since all drag notifications are routed to the XEmbed
    // client. To avoid confusion we prohibit listeners registration
    // by throwing TooManyListenersException as if there is a listener
    // registered with this target already.
    throw new TooManyListenersException();
}
项目:jdk8u-dev-jdk    文件:SunDropTargetContextPeer.java   
/**
 * actual processing on EventQueue Thread
 */

protected void processEnterMessage(SunDropTargetEvent event) {
    Component  c    = (Component)event.getSource();
    DropTarget dt   = c.getDropTarget();
    Point      hots = event.getPoint();

    local = getJVMLocalSourceTransferable();

    if (currentDTC != null) { // some wreckage from last time
        currentDTC.removeNotify();
        currentDTC = null;
    }

    if (c.isShowing() && dt != null && dt.isActive()) {
        currentDT  = dt;
        currentDTC = currentDT.getDropTargetContext();

        currentDTC.addNotify(this);

        currentA   = dt.getDefaultActions();

        try {
            ((DropTargetListener)dt).dragEnter(new DropTargetDragEvent(currentDTC,
                                                                       hots,
                                                                       currentDA,
                                                                       currentSA));
        } catch (Exception e) {
            e.printStackTrace();
            currentDA = DnDConstants.ACTION_NONE;
        }
    } else {
        currentDT  = null;
        currentDTC = null;
        currentDA   = DnDConstants.ACTION_NONE;
        currentSA   = DnDConstants.ACTION_NONE;
        currentA   = DnDConstants.ACTION_NONE;
    }

}
项目:jdk8u-dev-jdk    文件:XEmbedCanvasPeer.java   
public void addDropTargetListener(DropTargetListener dtl)
  throws TooManyListenersException {
    // Drop target listeners registered with this target will never be
    // notified, since all drag notifications are routed to the XEmbed
    // client. To avoid confusion we prohibit listeners registration
    // by throwing TooManyListenersException as if there is a listener
    // registered with this target already.
    throw new TooManyListenersException();
}
项目:vassal    文件:PieceMover.java   
/**
 * Creates a new DropTarget and hooks us into the beginning of a
 * DropTargetListener chain. DropTarget events are not multicast;
 * there can be only one "true" listener.
 */
static public DropTarget makeDropTarget(Component theComponent, int dndContants, DropTargetListener dropTargetListener) {
  if (dropTargetListener != null) {
    DragHandler.getTheDragHandler()
               .dropTargetListeners.put(theComponent, dropTargetListener);
  }
  return new DropTarget(theComponent, dndContants,
                        DragHandler.getTheDragHandler());
}
项目:vassal    文件:PieceMover.java   
/**
 * Last event of the drop operation. We adjust the drop point for
 * off-center drag, remove the cursor, and pass the event along
 * listener chain.
 */
public void drop(DropTargetDropEvent e) {
   // EVENT uses UNSCALED, DROP-TARGET coordinate system
   e.getLocation().translate(currentPieceOffsetX, currentPieceOffsetY);
   final DropTargetListener forward = getListener(e);
   if (forward != null) forward.drop(e);
}
项目:jdk7-jdk    文件:SunDropTargetContextPeer.java   
/**
 * actual processing on EventQueue Thread
 */

protected void processEnterMessage(SunDropTargetEvent event) {
    Component  c    = (Component)event.getSource();
    DropTarget dt   = c.getDropTarget();
    Point      hots = event.getPoint();

    local = getJVMLocalSourceTransferable();

    if (currentDTC != null) { // some wreckage from last time
        currentDTC.removeNotify();
        currentDTC = null;
    }

    if (c.isShowing() && dt != null && dt.isActive()) {
        currentDT  = dt;
        currentDTC = currentDT.getDropTargetContext();

        currentDTC.addNotify(this);

        currentA   = dt.getDefaultActions();

        try {
            ((DropTargetListener)dt).dragEnter(new DropTargetDragEvent(currentDTC,
                                                                       hots,
                                                                       currentDA,
                                                                       currentSA));
        } catch (Exception e) {
            e.printStackTrace();
            currentDA = DnDConstants.ACTION_NONE;
        }
    } else {
        currentDT  = null;
        currentDTC = null;
        currentDA   = DnDConstants.ACTION_NONE;
        currentSA   = DnDConstants.ACTION_NONE;
        currentA   = DnDConstants.ACTION_NONE;
    }

}
项目:jdk7-jdk    文件:XEmbedCanvasPeer.java   
public void addDropTargetListener(DropTargetListener dtl)
  throws TooManyListenersException {
    // Drop target listeners registered with this target will never be
    // notified, since all drag notifications are routed to the XEmbed
    // client. To avoid confusion we prohibit listeners registration
    // by throwing TooManyListenersException as if there is a listener
    // registered with this target already.
    throw new TooManyListenersException();
}
项目:openjdk-source-code-learn    文件:SunDropTargetContextPeer.java   
/**
 * actual processing on EventQueue Thread
 */

protected void processEnterMessage(SunDropTargetEvent event) {
    Component  c    = (Component)event.getSource();
    DropTarget dt   = c.getDropTarget();
    Point      hots = event.getPoint();

    local = getJVMLocalSourceTransferable();

    if (currentDTC != null) { // some wreckage from last time
        currentDTC.removeNotify();
        currentDTC = null;
    }

    if (c.isShowing() && dt != null && dt.isActive()) {
        currentDT  = dt;
        currentDTC = currentDT.getDropTargetContext();

        currentDTC.addNotify(this);

        currentA   = dt.getDefaultActions();

        try {
            ((DropTargetListener)dt).dragEnter(new DropTargetDragEvent(currentDTC,
                                                                       hots,
                                                                       currentDA,
                                                                       currentSA));
        } catch (Exception e) {
            e.printStackTrace();
            currentDA = DnDConstants.ACTION_NONE;
        }
    } else {
        currentDT  = null;
        currentDTC = null;
        currentDA   = DnDConstants.ACTION_NONE;
        currentSA   = DnDConstants.ACTION_NONE;
        currentA   = DnDConstants.ACTION_NONE;
    }

}