Skip to main content



      Home
Home » Eclipse Projects » Eclipse Sprotty » Stacking complex actions - add only for selected nodes
Stacking complex actions - add only for selected nodes [message #1808493] Tue, 25 June 2019 12:16 Go to next message
Eclipse UserFriend
How would the architecture support an action that requires knowledge of which nodes are selected - this information is stored in SModelElements, but the action dispatcher only deals with schemas.

The action I want to create is adding/deleting new nodes connected to nodes that are currently selected. One way I can think of implementing this is by adding nodes in the hidden svg every time a selection is made, and then updating once an add button is pressed, but this wouldn't work for deletion.

I noticed that accessing SModel from the outside is currently on the issue board of the repo but was wondering if anyone had an insight into how this could be done.
Re: Stacking complex actions - add only for selected nodes [message #1808519 is a reply to message #1808493] Wed, 26 June 2019 04:40 Go to previous message
Eclipse UserFriend
Sprotty has an internal model (SModel) and an external model (SModelSchema). The external model can be seen as a subset of the data held in the internal model. The internal model is held by the CommandStack, and the external model is held by the ModelSource (e.g. DiagramServer or LocalModelSource). Are you using a remote DiagramServer or the LocalModelSource?

I would implement that feature in the ModelSource. You can register it to listen to Select / SelectAll actions and then update the external model accordingly.

For an example, see the model source of the npm-dependency-graph application.
Previous Topic:Sprotty for Mining and Analysis Workflow Visualization
Next Topic:Installation and integration with eclipse sirius web
Goto Forum:
  


Current Time: Sat Jul 12 13:17:39 EDT 2025

Powered by FUDForum. Page generated in 0.06519 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top