Book a Demo

Author Topic: Replacing the default label for a connector  (Read 3476 times)

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Replacing the default label for a connector
« on: September 25, 2014, 08:50:20 am »
Ok, so this seems like it should be the easiest thing around, but I just can't get it to work.

I have a shape script to one of my connector stereotypes trying to override the standard label, but it does......NOTHING!

My script looks like this:

shape main {
MoveTo(0,0);
LineTo(100,0);
}

shape Target
{
MoveTo(16,6);
LineTo(0,0);
LineTo(16,-6);
}

shape TopLeftLabel
{
Print("Depends On");
}


All I want is the old label gone burgers and the new one to appear.

Help!

Jays  :)

« Last Edit: September 25, 2014, 08:52:05 am by jaysper »

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Replacing the default label for a connector
« Reply #1 on: September 25, 2014, 09:44:51 am »
Call the shape either TargetTopLabel or SourceTopLabel
The Sparx Team
[email protected]

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Replacing the default label for a connector
« Reply #2 on: September 25, 2014, 10:37:33 am »
Hey KP, thanks for that.

Unfotunately, it didn't get rid of the stereotype name.
Also, the label appears right near the arrow rather than the middle of the line, which makes things kinda crowded when a single element is the target of a lot of connectors.

Cheers

Jays  :)

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Replacing the default label for a connector
« Reply #3 on: September 25, 2014, 10:56:36 am »
Ah OK, if you don't know which label it is you need to override, a good tip is to right-click the connector and choose Visibility|Set Label Visibility. That will show you the current values of all the labels. The stereotype goes in the middle bottom label.
The Sparx Team
[email protected]

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Replacing the default label for a connector
« Reply #4 on: September 26, 2014, 04:35:58 am »
Fantastic! That did the trick just perfectly and using the label visibility to see where labels are placed is a great tip.

Thanks heaps  :)