Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Display ports that are not contained by object
Display ports that are not contained by object [message #1000228] Mon, 14 January 2013 10:10 Go to next message
Matthias N is currently offline Matthias NFriend
Messages: 66
Registered: June 2012
Member
Hi,

I have a meta-model which looks the following:

+------+      type +-----------+
| Type |<----------| Prototype |
+------+           +-----------+
   <>
    |
    |
+-------+
+ Port  +
+-------+


The type contains a set of Ports. A Prototype references a type.

Type:
In GMF Type is top-node-reference and Port is a child reference.

Prototype:
In GMF Prototye is a top-node-reference.

What I want to do now is the following. I create a type (TypeA) with some ports. Then I create a prototype and select the type (TypeA) in the properties. Now all the ports which are on TypeA shall be displayed on the Prototype as well.

Is this possible with GMF ?!
Re: Display ports that are not contained by object [message #1000296 is a reply to message #1000228] Mon, 14 January 2013 13:06 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

in your edit part of prototype you could overwrite handleNotification and change the figure to look like what you intend to. This could give you a starting point: http://wiki.eclipse.org/GMF/Tips#Making_figures_sensitive_to_attributes_of_semantic_elements. Once you decide to modify generated code I would recommend you to place this code in a custom template which can save you a lot of work. Alternatively you could use the extension points of the GMF Runtime.

Ralph
Re: Display ports that are not contained by object [message #1000300 is a reply to message #1000228] Mon, 14 January 2013 13:16 Go to previous messageGo to next message
Matthias N is currently offline Matthias NFriend
Messages: 66
Registered: June 2012
Member
Hi Ralph,
thanks for you answer. I was trying sth. similar today:

PrototypeEditPart
protected void handleNotificationEvent(Notification notification) {
PortEditPart port = new PortEditPart(getDiagramView());
addChildVisual(port);
addFixedChild(port);


However, now the port is not attached to the border, instead he is inside the port figure and too big.

Any ideas?
Re: Display ports that are not contained by object [message #1000689 is a reply to message #1000300] Tue, 15 January 2013 09:07 Go to previous message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

you could try to reuse the generated code that is already used for the other figure. Did you try to copy this code over?

Ralph
Previous Topic:Assign File to a GMF node
Next Topic:Apply changes in editor
Goto Forum:
  


Current Time: Sat Apr 20 01:47:09 GMT 2024

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

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

Back to the top