當前位置: 首頁>>代碼示例>>Java>>正文


Java DropTargetListener類代碼示例

本文整理匯總了Java中java.awt.dnd.DropTargetListener的典型用法代碼示例。如果您正苦於以下問題:Java DropTargetListener類的具體用法?Java DropTargetListener怎麽用?Java DropTargetListener使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DropTargetListener類屬於java.awt.dnd包,在下文中一共展示了DropTargetListener類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: postInitComponents

import java.awt.dnd.DropTargetListener; //導入依賴的package包/類
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);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:26,代碼來源:PluginManagerUI.java

示例2: createMapView

import java.awt.dnd.DropTargetListener; //導入依賴的package包/類
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;
}
 
開發者ID:iwabuchiken,項目名稱:freemind_1.0.0_20140624_214725,代碼行數:18,代碼來源:IndependantMapViewCreator.java

示例3: focusLost

import java.awt.dnd.DropTargetListener; //導入依賴的package包/類
/**
 * 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);
}
 
開發者ID:NCIP,項目名稱:caadapter,代碼行數:23,代碼來源:CSVTreeChangeAdapter.java

示例4: ProcessRendererDropTarget

import java.awt.dnd.DropTargetListener; //導入依賴的package包/類
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) {
	}
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:9,代碼來源:ProcessRendererDropTarget.java

示例5: dragEnter

import java.awt.dnd.DropTargetListener; //導入依賴的package包/類
@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);
			}
		}
	}
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:13,代碼來源:ProcessRendererDropTarget.java

示例6: dragOver

import java.awt.dnd.DropTargetListener; //導入依賴的package包/類
@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);
			}
		}
	}
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:13,代碼來源:ProcessRendererDropTarget.java

示例7: dragExit

import java.awt.dnd.DropTargetListener; //導入依賴的package包/類
@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);
			}
		}
	}
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:15,代碼來源:ProcessRendererDropTarget.java

示例8: drop

import java.awt.dnd.DropTargetListener; //導入依賴的package包/類
@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);
			}
		}
	}
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:15,代碼來源:ProcessRendererDropTarget.java

示例9: dropActionChanged

import java.awt.dnd.DropTargetListener; //導入依賴的package包/類
@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);
			}
		}
	}
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:13,代碼來源:ProcessRendererDropTarget.java

示例10: getDropTargetListener

import java.awt.dnd.DropTargetListener; //導入依賴的package包/類
/**
 * 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
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:12,代碼來源:AbstractPatchedTransferHandler.java

示例11: makeDropTarget

import java.awt.dnd.DropTargetListener; //導入依賴的package包/類
/**
 * 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());
}
 
開發者ID:ajmath,項目名稱:VASSAL-src,代碼行數:14,代碼來源:PieceMover.java

示例12: drop

import java.awt.dnd.DropTargetListener; //導入依賴的package包/類
/**
 * 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);
}
 
開發者ID:ajmath,項目名稱:VASSAL-src,代碼行數:12,代碼來源:PieceMover.java

示例13: processEnterMessage

import java.awt.dnd.DropTargetListener; //導入依賴的package包/類
/**
 * 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;
    }

}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:43,代碼來源:SunDropTargetContextPeer.java

示例14: addDropTargetListener

import java.awt.dnd.DropTargetListener; //導入依賴的package包/類
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();
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:10,代碼來源:XEmbedCanvasPeer.java

示例15: addDropTargetListener

import java.awt.dnd.DropTargetListener; //導入依賴的package包/類
@Override
public void addDropTargetListener(final DropTargetListener dtl) throws TooManyListenersException {
	if (dropTragetListenerList == null) {
		dropTragetListenerList = new EventListenerList();
	}
	dropTragetListenerList.add(DropTargetListener.class, dtl);
}
 
開發者ID:rapidminer,項目名稱:rapidminer-studio,代碼行數:8,代碼來源:ProcessRendererDropTarget.java


注:本文中的java.awt.dnd.DropTargetListener類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。