本文整理匯總了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;
}
}
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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;
}
示例6: dragExit
import java.awt.dnd.DropTargetEvent; //導入依賴的package包/類
@Override
public void dragExit(DropTargetEvent dte) {
if (isDragging) {
orig.dragExit(dte);
}
isDragging = false;
}
示例7: dragExit
import java.awt.dnd.DropTargetEvent; //導入依賴的package包/類
public void dragExit( DropTargetEvent dte ) {
removeDropLine();
if (DropGlassPane.isOriginalPaneStored()) {
DropGlassPane.putBackOriginal();
}
removeTimer();
}
示例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));
}
}
示例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);
}
}
}
}
示例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();
}
示例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);
}
示例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;
}
示例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();
}
示例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);
}
示例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;
}