Community
Participate
Working Groups
I ran into problems trying to implement a sample of drop action handler. It looks like drop action handlers must implement SapphireDiagramDropActionHandler, which has a newModelElement( Object ) -> IModelElement method. There are two problems with this: 1. The action handler's execute method isn't called. 2. The newModelElement method assumes that one drop corresponds to one element/node. In my case I am trying to drop a file that has a list of cities. One drop should produce N elements/nodes. I believe a better approach would be to pass requisite information (what is being dropped and location of the drop) into the handler's execute method via a subclass of SapphireRenderingContext. The action handler should take on the responsibility for creating elements, node parts and positioning them on canvas. The problem is similar to the Add action and resolution of these should probably be done concurrently.
The drop action handler has been reworked. There is only one drop action handler per diagram page. It should use DiagramRendingContext passed into run() method to get the object to be dropped and mouse location.
Looks good. Closing.