Book a Demo

Author Topic: shapescript problem with multisegment connectors  (Read 4608 times)

Mariusz Popiolek

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
shapescript problem with multisegment connectors
« on: January 22, 2011, 01:59:00 am »
Hello

I have made following shapescript for connector:

shape main {
      setlinestyle("solid");
      setpencolor(255, 0, 0);
      moveto(0,0);
      lineto(100,0);
}

It works fine, until I add segment to the connector (Bend line at cursor - Ctrl + Q). New segment is drawed in red, but line style is not solid. I want all line segments to look the same. Is it possible?

Thanks in advance for any help.
Mariusz Popiolek

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: shapescript problem with multi-segment connect
« Reply #1 on: January 24, 2011, 11:19:46 am »
Hi Mariusz,

It's most probably a bug.  I've seen other problems with multi-segment connectors.  If you change the pen width on your shape script (say to 3) you'll see that when you add the way-point (Bend line at cursor [CTRL+Q]) you'll see the rest of the line rendered as pen width 1.

BTW, what is the type of your line?  I think EA resets the rendering to he default rendering of the type.  So, for example, if you are trying to render a dependency as a solid line, after the way-point it reverts to the dashed line of the dependency (at pen width 1).

Please report your bug using the links below and (if you'd be so kind) confirm my observed behaviour and add that to your bug report.

HTH,
Paolo
« Last Edit: January 24, 2011, 11:22:35 am by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: shapescript problem with multisegment connecto
« Reply #2 on: January 24, 2011, 11:24:55 am »
This has been fixed for EA 9.0 (release date unknown).
The Sparx Team
[email protected]

Mariusz Popiolek

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: shapescript problem with multisegment connecto
« Reply #3 on: January 25, 2011, 12:52:51 am »
Hello

To Paolo:
I have dependency connector. I haven't changed pen width but my error is a bit more complicated  (my shapescript depends on connector ends stereotypes):

shape main {
      if (HasProperty(
                  "source.element.stereotype",
                  "somestereotypename"))
      {
            setpencolor(255, 0, 0);
      }
      if (HasProperty(
                  "target.element.stereotype",
                  "somestereotypename"))
      {
            setpencolor(255, 0, 0);
      }
      moveto(0,0);
      lineto(100,0);
}

For example, with above shapescript, additional segments are drawed in red, no matter which stereotype source and target elements have. Only the first segment is drawed correctly (in black).


Do you think that I should still report this bug?

To KP:
Thanks for the information. I cannot wait for the release :)

Best regards,
Mariusz Popiolek

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: shapescript problem with multisegment connecto
« Reply #4 on: January 25, 2011, 08:47:32 am »
Quote
shape main {
      if (HasProperty(
                  "source.element.stereotype",
                  "somestereotypename"))
      {
            setpencolor(255, 0, 0);
      }
      if (HasProperty(
                  "target.element.stereotype",
                  "somestereotypename"))
      {
            setpencolor(255, 0, 0);
      }
      moveto(0,0);
      lineto(100,0);
}
This shape script also manages to confuse EA 9.0, so yes please send in a bug report...
The Sparx Team
[email protected]