当前位置: 首页>>代码示例>>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;未经允许,请勿转载。