Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » [SOLVED] Connection with label not appearing
[SOLVED] Connection with label not appearing [message #650376] Mon, 24 January 2011 16:48 Go to next message
akoeck is currently offline akoeckFriend
Messages: 62
Registered: December 2010
Member
I've a connection with a label with static content. But this connection is not appearing. Every other connection is there, but only those with the label are not showing.

In the gmgraph i've the following:

Canvas
- Figure Gallery
- - Figure Descriptor Connection
- - - PolylineConnection Con
- - - - Label ConLabel
- - - ChildAccess getConLabel
- Connection Con
- Diagram Label ConLabel

In the mapping:

Link Mapping
- Label Mapping

I'm not sure if I could use every of those different Label Mappings (Label, Feature Label, Design Label, Expression Label).

In the code it looks like this:

public ConnectionFigure extends PolylineConnectionEx 
{
  private WrappingLabel conLabel;

  public UpdateConnectionFigure(){
     createContents();
  }

  private void createContents(){
     ConnectionEndpointLocator el = new ConnectionEndpointLocator(this, true);
     el.setVDistance(15);
     conLabel = new WrappingLabel();
     conLabel.setText("FOO");
     this.add(conLabel, el);
  }

  public WrappingLabel getConLabel(){
     return conLabel;
  }

}


I hope you can help me.



I'm also wondering if it's possible to tell the connection that it should use this Tree or Rectengular layout by default.

[Updated on: Tue, 25 January 2011 13:55]

Report message to a moderator

Re: Connection with label not appearing [message #650480 is a reply to message #650376] Tue, 25 January 2011 08:35 Go to previous messageGo to next message
Romain Bioteau is currently offline Romain BioteauFriend
Messages: 65
Registered: August 2009
Location: Grenoble
Member
HI,
Did you had the ConnectionEndpointLocator yourself or is it generated ?

I Think you should remove it and use the GMFGen to set the location of your Connection label :

Go in the Gen Diagram Tree :
- Gen Link YourConnection
- Gen Link Label YourLabel
- Parent Assigned Viewmap
- Add a Label Offset children


HTH
Romain


R&D Engineer at BonitaSoft
Re: Connection with label not appearing [message #650540 is a reply to message #650480] Tue, 25 January 2011 13:34 Go to previous message
akoeck is currently offline akoeckFriend
Messages: 62
Registered: December 2010
Member
Romain Bioteau wrote on Tue, 25 January 2011 03:35
HI,
Did you had the ConnectionEndpointLocator yourself or is it generated ?

I Think you should remove it and use the GMFGen to set the location of your Connection label :

Go in the Gen Diagram Tree :
- Gen Link YourConnection
- Gen Link Label YourLabel
- Parent Assigned Viewmap
- Add a Label Offset children


HTH
Romain

Thanks for the help, but this does not work.
The connection is still not showing.
I've checked the *.model and *.model_diagramm file.
There i can see the connections, but somehow the type for the connection in the model file is missing. I've to say that I'm using constraints do use different figures for my model and choose the correct figure via an enum. The connections without label are showing and have also written their type in the *.model file.

I just found out, that when i delete the label in the gmfgraph and the mapping the connection is still not appearing. Only the model is written into to model file, but in the diagram file i can't see this connection, only the others.


------------------------

I found the solution. It's a bit embarrising but i have just forgotten to regenerate the modelcode after adding more elements to the enum. Embarrassed

[Updated on: Tue, 25 January 2011 13:54]

Report message to a moderator

Previous Topic: java.lang.IllegalArgumentException : Transposer
Next Topic:The Diagram is cut in Eclipse 3.5.0 using Ubuntu
Goto Forum:
  


Current Time: Sat Sep 21 01:50:38 GMT 2024

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

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

Back to the top