Book a Demo

Author Topic: REPLACING standard con labels with ShapeScripts  (Read 3874 times)

stao

  • EA User
  • **
  • Posts: 137
  • Karma: +0/-0
    • View Profile
REPLACING standard con labels with ShapeScripts
« on: June 30, 2010, 08:12:44 pm »
Hi everyone
i used the search function and found many threads with interesting content but actually didnt found a solution for my problem.

here is my code:

Code: [Select]
shape main {

                noshadow="true";
            h_align = "center";
            lineto(100,0);
            
}      

shape middletoplabel
      {
            h_align = "center";
            v_align = "center";
            print("<<destroy>>");
      }
shape middlebottomlabel
      {
            h_align = "center";
            v_align = "center";
            moveto(20,0);
            lineto(80,100);
            moveto(80,0);
            lineto(20,100);
            print("#name#");
      
      }

it works somehow but not in a way i want it.

in the label visibility it shows still the name of the connector (middletoplabel) and the stereotype (middlebottomlabel) .
and the default position of my new labels are NOT the same as the default positions of the normal unedited labels.




1.
it seems that if i edit labels i only edit the visual output of the label not the label itself

2.
If i edit labels the default position of the edited labels are not the same as before.

(After editing middlebottomlabel and middletoplabel have the SAME default position)


2 questions.

1. How to set the default position of the edited labels?
2. Not so important. How to REPLACE the label not only the visual output?

Stao
« Last Edit: June 30, 2010, 08:14:07 pm by stao »

stao

  • EA User
  • **
  • Posts: 137
  • Karma: +0/-0
    • View Profile
Re: REPLACING standard con labels with ShapeScript
« Reply #1 on: July 06, 2010, 07:27:15 am »
no one has an idea?
sry for double post..

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: REPLACING standard con labels with ShapeScript
« Reply #2 on: July 06, 2010, 09:03:20 am »
Quote
How to REPLACE the label not only the visual output?
Can't be done with shape scripts which only change the appearance of a connector. You will need to change the connector properties: double-click it.
The Sparx Team
[email protected]

stao

  • EA User
  • **
  • Posts: 137
  • Karma: +0/-0
    • View Profile
Re: REPLACING standard con labels with ShapeScript
« Reply #3 on: July 06, 2010, 06:11:18 pm »
ok
and what about the wrong default positions of the edited labels?
is there any possibility to set the default position in the shapescript?
or is this an EA bug?