Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 16:16 Go to next message
Supransh Murty is currently offline Supransh MurtyFriend
Messages: 1
Registered: June 2019
Junior Member
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 08:40 Go to previous message
Miro Spönemann is currently offline Miro SpönemannFriend
Messages: 74
Registered: March 2015
Location: Kiel, Germany

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: Wed May 31 16:02:55 GMT 2023

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

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

Back to the top