Home » Modeling » GMF (Graphical Modeling Framework) » How to add subclassed nodes to model and diagram?
|
Re: How to add subclassed nodes to model and diagram? [message #209510 is a reply to message #209199] |
Sat, 25 October 2008 12:35 |
Jan van der Ven Messages: 18 Registered: July 2009 |
Junior Member |
|
|
Dear list,
What it all boils down to is that I do not know which nodes will be
present at runtime. I only know that they will behave like their parent
node (the block) below. Does GMF support this? If so, can someone point
me to an example? Or should I go back to GEF? I did the QuantumDB
ER-diagram in GEF (code here: http://sourceforge.net/projects/quantum/),
where I add attributes at runtime for each column name.
Please advice.
Kind regards,
Jan
Jan H. van der Ven wrote:
> Dear list,
>
>
>
> We are working on a GMF project in which we hope to do the following. We
> have a very simple ecore diagram, in which there is one node type
> (block) that can be placed on the canvas. Inside this node are 1 or more
> sockets. Connections can only be made by connecting socket objects.
>
> The number of different blocks are defined in an unknown number of
> configuration files. The configuration file defines the number of
> sockets and some other properties. For each such a configuration file,
> we want to have a named entry in the palette (the name is in the
> configuration file, too). The tool should read these files on startup,
> as their number will increase over time.
>
> And after experimenting for about a week now, I have not found a way to
> achieve this.
>
> Any help would be greatly appreciated.
>
>
> Kind regards,
>
>
>
> Jan
|
|
|
Re: How to add subclassed nodes to model and diagram? [message #209518 is a reply to message #209510] |
Sat, 25 October 2008 15:37 |
Jan van der Ven Messages: 18 Registered: July 2009 |
Junior Member |
|
|
Dear list,
I am still using GMF. I modified the fillPalette function. It now adds
several entries with the same element type to the palette.
Whatever tool I select the same BlockCreateCommand is called. I
understand that. What I want to do now is to find out which tool was
invoked that caused the request to create the CreateCommand, if that
makes sense... I found this "Within your action find appropriate diagram
editor part and adapt it to GraphicalViewer; then
viewer.getEditDomain().getActiveTool()."
But it's not an action, and I think we are in the model, and not in the
edit parts.
Please help.
Kind regards,
Jan
Jan H. van der Ven wrote:
> Dear list,
>
>
> What it all boils down to is that I do not know which nodes will be
> present at runtime. I only know that they will behave like their parent
> node (the block) below. Does GMF support this? If so, can someone point
> me to an example? Or should I go back to GEF? I did the QuantumDB
> ER-diagram in GEF (code here: http://sourceforge.net/projects/quantum/),
> where I add attributes at runtime for each column name.
>
> Please advice.
>
> Kind regards,
>
> Jan
>
>
>
> Jan H. van der Ven wrote:
>> Dear list,
>>
>>
>>
>> We are working on a GMF project in which we hope to do the following.
>> We have a very simple ecore diagram, in which there is one node type
>> (block) that can be placed on the canvas. Inside this node are 1 or
>> more sockets. Connections can only be made by connecting socket objects.
>>
>> The number of different blocks are defined in an unknown number of
>> configuration files. The configuration file defines the number of
>> sockets and some other properties. For each such a configuration file,
>> we want to have a named entry in the palette (the name is in the
>> configuration file, too). The tool should read these files on startup,
>> as their number will increase over time.
>>
>> And after experimenting for about a week now, I have not found a way
>> to achieve this.
>>
>> Any help would be greatly appreciated.
>>
>>
>> Kind regards,
>>
>>
>>
>> Jan
|
|
|
Re: How to add subclassed nodes to model and diagram? [message #209526 is a reply to message #209518] |
Sun, 26 October 2008 09:45 |
Jan van der Ven Messages: 18 Registered: July 2009 |
Junior Member |
|
|
Dear list,
I solved it by finding out about the palette in the
xxxSemanticEditPolicy and passed the tool name to a new constructor.
The tool name is
this.getHost().getViewer().getEditDomain().getPaletteViewer( ).getActiveTool().getLabel()
Then in doDefaultElementCreation I can match that name to the
configuration files and act accordingly.
Kind regards,
Jan
Jan H. van der Ven wrote:
> Dear list,
>
>
> I am still using GMF. I modified the fillPalette function. It now adds
> several entries with the same element type to the palette.
>
> Whatever tool I select the same BlockCreateCommand is called. I
> understand that. What I want to do now is to find out which tool was
> invoked that caused the request to create the CreateCommand, if that
> makes sense... I found this "Within your action find appropriate diagram
> editor part and adapt it to GraphicalViewer; then
> viewer.getEditDomain().getActiveTool()."
>
> But it's not an action, and I think we are in the model, and not in the
> edit parts.
>
> Please help.
>
>
> Kind regards,
>
>
> Jan
>
>
> Jan H. van der Ven wrote:
>> Dear list,
>>
>>
>> What it all boils down to is that I do not know which nodes will be
>> present at runtime. I only know that they will behave like their
>> parent node (the block) below. Does GMF support this? If so, can
>> someone point me to an example? Or should I go back to GEF? I did the
>> QuantumDB ER-diagram in GEF (code here:
>> http://sourceforge.net/projects/quantum/), where I add attributes at
>> runtime for each column name.
>>
>> Please advice.
>>
>> Kind regards,
>>
>> Jan
>>
>>
>>
>> Jan H. van der Ven wrote:
>>> Dear list,
>>>
>>>
>>>
>>> We are working on a GMF project in which we hope to do the following.
>>> We have a very simple ecore diagram, in which there is one node type
>>> (block) that can be placed on the canvas. Inside this node are 1 or
>>> more sockets. Connections can only be made by connecting socket objects.
>>>
>>> The number of different blocks are defined in an unknown number of
>>> configuration files. The configuration file defines the number of
>>> sockets and some other properties. For each such a configuration
>>> file, we want to have a named entry in the palette (the name is in
>>> the configuration file, too). The tool should read these files on
>>> startup, as their number will increase over time.
>>>
>>> And after experimenting for about a week now, I have not found a way
>>> to achieve this.
>>>
>>> Any help would be greatly appreciated.
>>>
>>>
>>> Kind regards,
>>>
>>>
>>>
>>> Jan
|
|
|
Goto Forum:
Current Time: Tue Sep 24 12:31:05 GMT 2024
Powered by FUDForum. Page generated in 0.06364 seconds
|