I create an action of right click on the panel and display contextmenu.
And after click on the contextmenu, I add the element to the model.
After add first element, it was fine. It is still can be dragged.
But somehow, after add the 2nd element. All of the elements cannot be dragged anymore.
This my code when adding to the model of the diagram.
Code: Select all
Element newElement = new Element(
new TestElement(Integer.toString(this.x)+","+Integer.toString(this.y)),
Integer.toString(this.x)+"px",
Integer.toString(this.y)+"px") ;
newElement.setDraggable(true);
model.addElement(newElement);
Thank you in advance.