Book a Demo

Author Topic: Page border and connector stereotype  (Read 4326 times)

Lars J.

  • EA User
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Page border and connector stereotype
« on: April 10, 2012, 09:34:47 pm »
Hi all,

in my add-in I am creating some diagrams dynamically. I would like to hide the page border and the connector stereotype on these diagrams but didn't find a way to achieve this. I had a look at the properties of the Diagram class and the pdata key-value pairs.

thanks in advance.

Lars

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Page border and connector stereotype
« Reply #1 on: April 11, 2012, 10:41:23 am »
The page border setting is held in the database in t_diagram.ShowBorder, which I'm afraid is not exposed to Automation. To hide connector stereotype labels, EA.Diagram.StyleEx (not pdata) needs the key-value pair "HideConnStereotype=1;"
The Sparx Team
[email protected]

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Page border and connector stereotype
« Reply #2 on: April 11, 2012, 06:46:22 pm »
There's always the unsupported way to call
Code: [Select]
Repository.Execute ("UPDATE t_diagram SET ShowBorder = <whatever> WHERE Diagram_ID = <id>")Keep in mind that this is a) an unsupported function and b) it might not directly effect the GUI but only after a restart of EA. But probably worth a try.

q.

Lars J.

  • EA User
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Re: Page border and connector stereotype
« Reply #3 on: April 11, 2012, 09:47:27 pm »
Quote
To hide connector stereotype labels, EA.Diagram.StyleEx (not pdata) needs the key-value pair "HideConnStereotype=1;"
This works fine. I've also tried to apply this to the diagrams in my diagram profile where I specified the value of the _styleex attribute.
Unfortunately there it doesn't work. Is there a reason for this?

thanks

Lars

Lars J.

  • EA User
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Re: Page border and connector stereotype
« Reply #4 on: April 11, 2012, 10:18:22 pm »
Quote
There's always the unsupported way to call
Code: [Select]
Repository.Execute ("UPDATE t_diagram SET ShowBorder = <whatever> WHERE Diagram_ID = <id>")Keep in mind that this is a) an unsupported function and b) it might not directly effect the GUI but only after a restart of EA. But probably worth a try.

q.

great, works!

the interesting thing is that this call has to be placed behind the EA.Diagram.Update() call. Otherwise this doesn't work. This means that the Update() call writes the values of the diagram object in the database, right?

L.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Page border and connector stereotype
« Reply #5 on: April 12, 2012, 01:30:06 am »
Guess so. The Update tells EA to write the object to the DB. Then the UPDATE will replace the border column. Remember: be careful with the Execute function. With the next release of EA it might no longer work as expected. Not very likely, but possible.

q.