Skip to main content



      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 05:10 Go to next message
Eclipse UserFriend
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 08:06 Go to previous messageGo to next message
Eclipse UserFriend
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 08:16 Go to previous messageGo to next message
Eclipse UserFriend
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 04:07 Go to previous message
Eclipse UserFriend
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: Mon Jul 07 08:42:01 EDT 2025

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

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

Back to the top