10 package com.generalrobotix.ui.view.graph;
12 import org.eclipse.swt.widgets.Composite;
14 import java.awt.event.*;
15 import java.awt.datatransfer.*;
16 import java.awt.dnd.*;
26 implements DropTargetListener
29 DropTarget dropTarget_;
30 ActionListener actionListener_;
32 boolean dropSucceeded_;
51 super(parent, leftMargin, rightMargin, topMargin, bottomMargin);
61 droppedObject_ =
null;
62 dropSucceeded_ =
true;
75 dropTarget_.setActive(active);
88 dropSucceeded_ =
flag;
94 actionListener_ = AWTEventMulticaster.add(actionListener_, listener);
97 actionListener_ = AWTEventMulticaster.remove(actionListener_, listener);
107 public void drop(DropTargetDropEvent evt) {
112 & DnDConstants.ACTION_COPY_OR_MOVE
115 evt.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
117 Transferable tr = evt.getTransferable();
120 if(actionListener_ !=
null) {
121 actionListener_.actionPerformed(
124 ActionEvent.ACTION_PERFORMED,
129 evt.dropComplete(dropSucceeded_);
131 System.err.println(
"サポートしないフレーバ");
132 evt.dropComplete(
false);
134 }
catch (Exception ex) {
135 ex.printStackTrace();
136 System.err.println(
"ドロップ失敗");
137 evt.dropComplete(
false);
141 evt.dropComplete(
false);
153 && (evt.getSourceActions() & DnDConstants.ACTION_COPY_OR_MOVE) != 0
155 evt.acceptDrag(DnDConstants.ACTION_COPY_OR_MOVE);
void drop(DropTargetDropEvent evt)
void dragOver(DropTargetDragEvent evt)
void dragExit(DropTargetEvent evt)
#define null
our own NULL pointer
DroppableXYGraph(Composite parent, int leftMargin, int rightMargin, int topMargin, int bottomMargin)
void dragEnter(DropTargetDragEvent evt)
void removeActionListener(ActionListener listener)
void addActionListener(ActionListener listener)
void dropActionChanged(DropTargetDragEvent evt)
static final DataFlavor dataFlavor
void setDropActive(boolean active)
png_infop png_uint_32 flag
void setDropSucceeded(boolean flag)
Object getDroppedObject()