오케이, 알겠습니다. 내 실수는 내가 mxCell 제공하는 형상 정보를 생성, 그래서 대신 내가 가진 위 코드에서
mxCell cell = new mxCell(component);
의 드래그 기능과 같은 추가
mxCell cell = new mxCell(component, new mxGeometry(), "");
완전한 방법을 쓰는 것을이었다 이 :
public void addComponentTabListeners() {
final JTree componentTree = view.componentTree;
DragGestureListener dragGestureListener = new DragGestureListener() {
@Override
public void dragGestureRecognized(DragGestureEvent arg0) {
TreePath path = componentTree.getSelectionPath();
if ((path == null) || (path.getPathCount() <= 1)) {
return;
}
DefaultMutableTreeNode componentsNode = (DefaultMutableTreeNode) path.getLastPathComponent();
I_Component component = null;
try {
component = ComponentHandler_KonsensApplication.getInstance().createInstance(
componentsNode.toString(), "need unique Name here");
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
mxCell cell = new mxCell(component, new mxGeometry(), "");
cell.setVertex(true);
mxRectangle bounds = new mxRectangle();
bounds.setHeight(80);
bounds.setWidth(80);
mxGraphTransferable t = new mxGraphTransferable(new Object[] { cell }, bounds);
arg0.startDrag(null, mxSwingConstants.EMPTY_IMAGE, new Point(), t, null);
}
};
DragSource dragSource = new DragSource();
dragSource.createDefaultDragGestureRecognizer(componentTree, DnDConstants.ACTION_COPY,
dragGestureListener);
}