Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » programmatically adding an edge at node creation time?
programmatically adding an edge at node creation time? [message #163177] Wed, 28 November 2007 17:03 Go to next message
Eclipse UserFriend
Originally posted by: cohen.irascible.com

Hi,

There seem to be a number threads on this topic, and some of the suggestions I've found so far are:

1. Follow the logic example, modifying the xxxEditHelper class and adding a ConfigurexxxCommand. More specifically, I modified CreateConfigureLogicElementCommand.CreateWire. The result was that a CreateRelationshipRequest object was created, but when the composite create-command is instantiated in getEditCommand, it is empty, so getEditCommand returns null, and nothing happens. In case this was an issue with edges, I tried adding a node by modifying CreateConfigureLogicElementCommand.createElement, but a similar empty command got created. What am I missing?

2. On the Q&A page there's a note about programmatically adding a note to created elements.

3. Adding FeatureValueSpecs that point to java code (since the edge creation should only take place under certain circumstances).

4. In GMF tips: Creating New Elements And Corresponding Views

Is there a best approach, preferably with some sample code?

Thanks.

- j
Re: programmatically adding an edge at node creation time? [message #163496 is a reply to message #163177] Fri, 30 November 2007 10:01 Go to previous message
Eclipse UserFriend
Originally posted by: cohen.irascible.com

Hi,

I found a sort of answer to this, which was that there was a generated BaseEditHelper class (extends AbstractEditHelper) from which my xxxEditHelper class inherited, and which returned null for various operations, such as getCreateCommand() and getCreateRelationshipCommand(). I "fixed" those routines to return something, but only in the case where they were being invoked (indirectly) from my xxxBaseHelper. If not, then weird things happened during the normal drag-and-drop from palette.

The problem now is that though the edges appear in the model, they do not appear in the diagram unless I drag something else into the diagram, which forces an update. If I add a node instead of an edge at this point, it does appear in the diagram.

However, it feels like I'm attacking this problem at the wrong level, and shoring it up with hacks, so I would still appreciate advice about either the current impasse, or the original problem.

Thanks much.

- j



> Hi,
>
> There seem to be a number threads on this topic, and some of the
> suggestions I've found so far are:
>
> 1. Follow the logic example, modifying the xxxEditHelper class and
> adding a ConfigurexxxCommand. More specifically, I modified
> CreateConfigureLogicElementCommand.CreateWire. The result was that a
> CreateRelationshipRequest object was created, but when the composite
> create-command is instantiated in getEditCommand, it is empty, so
> getEditCommand returns null, and nothing happens. In case this was an
> issue with edges, I tried adding a node by modifying
> CreateConfigureLogicElementCommand.createElement, but a similar empty
> command got created. What am I missing?
>
> 2. On the Q&A page there's a note about programmatically adding a note
> to created elements.
>
> 3. Adding FeatureValueSpecs that point to java code (since the edge
> creation should only take place under certain circumstances).
> 4. In GMF tips: Creating New Elements And Corresponding Views
>
> Is there a best approach, preferably with some sample code?
>
> Thanks.
>
> - j
>
>
Previous Topic:Deleting Notational View on Deleting Semantic Model
Next Topic:Europas new command+handler (keyboard delete)
Goto Forum:
  


Current Time: Wed May 21 15:55:25 EDT 2025

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

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

Back to the top