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


Java DropTargetEvent類代碼示例

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


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

示例1: dispatchEvent

import java.awt.dnd.DropTargetEvent; //導入依賴的package包/類
private int dispatchEvent(DropTargetEvent e, int state) {
    synchronized (dropMonitor) {
        try {
            dragState = state;
            currentEvent = e;
            dropAction = DnDConstants.ACTION_NONE;
            EventQueue.invokeLater(this);
            while (dragState != DRAG_NONE) {
                dropMonitor.wait();
            }
            return WinDragSource.getWinActions(dropAction);
        } catch (InterruptedException ex) {
            return WindowsDefs.DROPEFFECT_NONE;
        }
    }
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:17,代碼來源:WinDropTarget.java

示例2: dragExit

import java.awt.dnd.DropTargetEvent; //導入依賴的package包/類
@Override
public void dragExit(DropTargetEvent dte) {
	if (mDragWasAcceptable) {
		if (mModel.getDragColumn() != null) {
			dragExitColumn(dte);
		} else {
			Row[] rows = mModel.getDragRows();

			if (rows != null && rows.length > 0) {
				dragExitRow(dte);
			}
		}
	} else if (mAlternateDragDestination != null) {
		mAlternateDragDestination.dragExit(dte);
	}
}
 
開發者ID:Ayutac,項目名稱:toolkit,代碼行數:17,代碼來源:Outline.java

示例3: dragExitColumn

import java.awt.dnd.DropTargetEvent; //導入依賴的package包/類
/**
 * Called when a column drag leaves the outline.
 *
 * @param dte The drop target event.
 */
protected void dragExitColumn(DropTargetEvent dte) {
	List<Column> columns = mModel.getColumns();

	if (columns.equals(mSavedColumns)) {
		repaintColumn(mModel.getDragColumn());
	} else {
		columns.clear();
		columns.addAll(mSavedColumns);
		repaint();
		if (mHeaderPanel != null) {
			mHeaderPanel.repaint();
		}
	}
	mSavedColumns = null;
	mModel.setDragColumn(null);
}
 
開發者ID:Ayutac,項目名稱:toolkit,代碼行數:22,代碼來源:Outline.java

示例4: dragExit

import java.awt.dnd.DropTargetEvent; //導入依賴的package包/類
public void dragExit(DropTargetEvent dte)
{
	try
	{
		ComponentTree componentTree = DesignerToolWindowManager.getInstance(myEditor).getComponentTree();
		if(componentTree != null)
		{
			componentTree.setDropTargetComponent(null);
		}
		myUseDragDelta = false;
		if(myDraggedComponentList != null)
		{
			cancelDrag();
			setDraggingState(myDraggedComponentList, false);
			myEditor.getActiveDecorationLayer().removeFeedback();
			myDraggedComponentList = null;
			myEditor.setDesignTimeInsets(2);
		}
		myDraggedComponentsCopy = null;
	}
	catch(Exception e)
	{
		LOG.error(e);
	}
}
 
開發者ID:consulo,項目名稱:consulo-ui-designer,代碼行數:26,代碼來源:DesignDropTargetListener.java

示例5: dragExit

import java.awt.dnd.DropTargetEvent; //導入依賴的package包/類
@Override
public void dragExit(DropTargetEvent dte) {
    //if(shouldRedispatchDnDToHandle()) {
    if(dragProxying) {
        formDesigner.getHandleLayer().getNewComponentDropListener().dragExit(dte);
    }
    dragProxying = false;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:9,代碼來源:MenuEditLayer.java

示例6: dragExit

import java.awt.dnd.DropTargetEvent; //導入依賴的package包/類
@Override
public void dragExit(DropTargetEvent dte) {
    if (isDragging) {
        orig.dragExit(dte);
    }
    isDragging = false;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:QuietEditorPane.java

示例7: dragExit

import java.awt.dnd.DropTargetEvent; //導入依賴的package包/類
public void dragExit( DropTargetEvent dte ) {
    removeDropLine();
    if (DropGlassPane.isOriginalPaneStored()) {
        DropGlassPane.putBackOriginal();
    }
    removeTimer();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:DnDSupport.java

示例8: dragExit

import java.awt.dnd.DropTargetEvent; //導入依賴的package包/類
/** User exits the dragging */
public void dragExit(DropTargetEvent dte) {
    if (lastIndex >= 0) {
        cellRenderer.draggingExit();
        comp.repaint(comp.getCellBounds(lastIndex, lastIndex));
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:IndexedCustomizer.java

示例9: dragExit

import java.awt.dnd.DropTargetEvent; //導入依賴的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

示例10: dragExit

import java.awt.dnd.DropTargetEvent; //導入依賴的package包/類
/**
 * 
 * @param e
 */
public void dragExit(DropTargetEvent e)
{
	mxGraphTransferHandler handler = getGraphTransferHandler(e);

	if (handler != null)
	{
		handler.setLocation(null);
	}

	dragCells = null;
	setVisible(false);
	marker.reset();
	reset();
}
 
開發者ID:GDSRS,項目名稱:TrabalhoFinalEDA2,代碼行數:19,代碼來源:mxGraphHandler.java

示例11: createEvent

import java.awt.dnd.DropTargetEvent; //導入依賴的package包/類
/**
 * 
 */
protected MouseEvent createEvent(DropTargetEvent e)
{
	JComponent component = getDropTarget(e);
	Point location = null;
	int action = 0;

	if (e instanceof DropTargetDropEvent)
	{
		location = ((DropTargetDropEvent) e).getLocation();
		action = ((DropTargetDropEvent) e).getDropAction();
	}
	else if (e instanceof DropTargetDragEvent)
	{
		location = ((DropTargetDragEvent) e).getLocation();
		action = ((DropTargetDragEvent) e).getDropAction();
	}

	if (location != null)
	{
		location = convertPoint(location);
		Rectangle r = graphComponent.getViewport().getViewRect();
		location.translate(r.x, r.y);
	}

	// LATER: Fetch state of modifier keys from event or via global
	// key listener using Toolkit.getDefaultToolkit().addAWTEventListener(
	// new AWTEventListener() {...}, AWTEvent.KEY_EVENT_MASK). Problem
	// is the event does not contain the modifier keys and the global
	// handler is not called during drag and drop.
	int mod = (action == TransferHandler.COPY) ? InputEvent.CTRL_MASK : 0;

	return new MouseEvent(component, 0, System.currentTimeMillis(), mod,
			location.x, location.y, 1, false, MouseEvent.BUTTON1);
}
 
開發者ID:GDSRS,項目名稱:TrabalhoFinalEDA2,代碼行數:38,代碼來源:mxGraphHandler.java

示例12: getGraphTransferHandler

import java.awt.dnd.DropTargetEvent; //導入依賴的package包/類
/**
 * Helper method to return the component for a drop target event.
 */
protected static final mxGraphTransferHandler getGraphTransferHandler(
		DropTargetEvent e)
{
	JComponent component = getDropTarget(e);
	TransferHandler transferHandler = component.getTransferHandler();

	if (transferHandler instanceof mxGraphTransferHandler)
	{
		return (mxGraphTransferHandler) transferHandler;
	}

	return null;
}
 
開發者ID:GDSRS,項目名稱:TrabalhoFinalEDA2,代碼行數:17,代碼來源:mxGraphHandler.java

示例13: dragExit

import java.awt.dnd.DropTargetEvent; //導入依賴的package包/類
/**
 * 
 * @param e
 */
public void dragExit(DropTargetEvent e) {
  mxGraphTransferHandler handler = getGraphTransferHandler(e);

  if (handler != null) {
    handler.setLocation(null);
  }

  dragCells = null;
  setVisible(false);
  marker.reset();
  reset();
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:17,代碼來源:mxGraphHandler.java

示例14: createEvent

import java.awt.dnd.DropTargetEvent; //導入依賴的package包/類
/**
 * 
 */
protected MouseEvent createEvent(DropTargetEvent e) {
  JComponent component = getDropTarget(e);
  Point location = null;
  int action = 0;

  if (e instanceof DropTargetDropEvent) {
    location = ((DropTargetDropEvent) e).getLocation();
    action = ((DropTargetDropEvent) e).getDropAction();
  } else if (e instanceof DropTargetDragEvent) {
    location = ((DropTargetDragEvent) e).getLocation();
    action = ((DropTargetDragEvent) e).getDropAction();
  }

  if (location != null) {
    location = convertPoint(location);
    Rectangle r = graphComponent.getViewport().getViewRect();
    location.translate(r.x, r.y);
  }

  // LATER: Fetch state of modifier keys from event or via global
  // key listener using Toolkit.getDefaultToolkit().addAWTEventListener(
  // new AWTEventListener() {...}, AWTEvent.KEY_EVENT_MASK). Problem
  // is the event does not contain the modifier keys and the global
  // handler is not called during drag and drop.
  int mod = (action == TransferHandler.COPY) ? InputEvent.CTRL_MASK : 0;

  return new MouseEvent(component, 0, System.currentTimeMillis(), mod, location.x, location.y, 1,
      false, MouseEvent.BUTTON1);
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:33,代碼來源:mxGraphHandler.java

示例15: getGraphTransferHandler

import java.awt.dnd.DropTargetEvent; //導入依賴的package包/類
/**
 * Helper method to return the component for a drop target event.
 */
protected static final mxGraphTransferHandler getGraphTransferHandler(DropTargetEvent e) {
  JComponent component = getDropTarget(e);
  TransferHandler transferHandler = component.getTransferHandler();

  if (transferHandler instanceof mxGraphTransferHandler) {
    return (mxGraphTransferHandler) transferHandler;
  }

  return null;
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:14,代碼來源:mxGraphHandler.java


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