file Create a custom link

5 years 7 months ago - 5 years 7 months ago #2969 by ebr
Hi Nico,

Maybe the issue does not come from this part of your code.

When you register your command you provide a Metaclass, e.g. Link.class, am I right? This metaclass will also play a role on the behaviour of your command...

For example a Connector can only be created between two bindableInstances so all ILinkCommand registered with this Connector.class metaclass will not be able to connect two classes even if I override the acceptFirstElement and acceptSecondElement methods.

Hoping it is clear and helpful.

Regards,

EBR

Please Log in or Create an account to join the conversation.

5 years 7 months ago #2970 by Nico42
Thx for your answer ebr.

For the Link.class, i wansn't clear sorry. I'm using the metaclass Association.

To make it clearer, the same code was working on modelio 2.2, so maybe there are a few things that have changed that i didn't identify ?

I'm quite lost for now, as you mentioned, I tried different kind of metaclass (Link, Association, NaryAssociation, etc..) but with the same result. I don't need to specifically use Association.class, just to link two elements with the less possible constraints.

Hoping there is enough elemnts to solve the problem,

thanx.

Please Log in or Create an account to join the conversation.

5 years 7 months ago - 5 years 7 months ago #2971 by ebr

just to link two elements with the less possible constraints

=> Dependency metaclasse definitely.

Please Log in or Create an account to join the conversation.

5 years 7 months ago #2972 by Nico42
It was the solution!

But there is another little thing, i tried to play with the properties but without success for removing this:


I bet it's another single line to put somewhere, but well, i don't know where :(
Attachments:

Please Log in or Create an account to join the conversation.

5 years 7 months ago #2973 by ebr
I am not sure to understand your issue.
You applied a unnamed stereotype to your link and now you stille want to have it but you do not want to see the <<>>, am I right?
Have you tried to play with the Stereotypes display mode field in the symbol view?
Attachments:

Please Log in or Create an account to join the conversation.

5 years 7 months ago - 5 years 7 months ago #2975 by Nico42
That's it ! I guess i have been too focused by fixing it by code, by using the dependency object that i forgot about those options.

edit: so i found in the source code the keyword to set the diagram default properties:
[IDiagramHandle instance].setProperty("DEPENDENCY_SHOWSTEREOTYPES", "NONE");

Thank you for your patience, really.

Please Log in or Create an account to join the conversation.

Moderators: tmachmaab
Time to create page: 0.319 seconds
^ Back to Top