Author Topic: Diagram Automation  (Read 13429 times)

lopata

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Diagram Automation
« on: March 30, 2004, 01:16:13 am »
Hi again!
Is it possibly possible :-) to layout a diagram through the automation interface?
Also, I would like to somehow control the "Parameter Detail".

Any plans to add these features in the following releases?

Thanks guys!

Hynek Cihlar, www.alsoft.cz
Hynek Cihlar
A
 L Soft
www.alsoft.cz
www.flexlanguage.com

Stephen

  • EA User
  • **
  • Posts: 54
  • Karma: +0/-0
    • View Profile
Re: Diagram Automation
« Reply #1 on: March 30, 2004, 01:32:57 am »
AFAIK you have to come up with your own layout algorithm. (I assume you want your diagrams to look "pretty")

I'm struggling with the same issue - more at the level of deciding if I want to bother. I've done a bit of this before for another app.

Probably best to come up with a basic relaxation process that iterates over all artifacts. Simple rules that control how much space should be around each item.
Then add rules to control which sort of object want to rise to the top of the diagram &etc. Can modify the space rules to help with the layering.

If you want to share the output with all here I'll make a bit of non-work time available to work the thing through.
Perhaps we could come up with an add-in for "straightening up" diagrams....

lopata

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Diagram Automation
« Reply #2 on: March 30, 2004, 01:39:53 am »
Do you realy think we should reinvent the wheel? The code for laying out diagrams is already in EA, it's only matter of exposing it.
Hynek Cihlar
A
 L Soft
www.alsoft.cz
www.flexlanguage.com

lopata

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Diagram Automation
« Reply #3 on: March 30, 2004, 01:41:08 am »
But I agree with you that it wouldn't be difficult to implement.
« Last Edit: March 30, 2004, 01:41:33 am by lopata »
Hynek Cihlar
A
 L Soft
www.alsoft.cz
www.flexlanguage.com

Stephen

  • EA User
  • **
  • Posts: 54
  • Karma: +0/-0
    • View Profile
Re: Diagram Automation
« Reply #4 on: March 30, 2004, 01:43:54 am »
Ahh! - You're ahead of me there. I thought the automation interface provided calls to create diagrams and add object to them, but it was left as "a problem for the user" to decide where the object should be placed.

What's the interface for layout

Bruno.Cossi

  • EA User
  • **
  • Posts: 803
  • Karma: +0/-0
    • View Profile
Re: Diagram Automation
« Reply #5 on: March 30, 2004, 05:08:36 am »
It is already exposed, there is a method LayoutDiagram on a ProjectInterface. It has two parameters, DIagramGUID and LayoutStyle. I am having problems finding an explanation of the LayoutStyle though.

Bruno

Stephen

  • EA User
  • **
  • Posts: 54
  • Karma: +0/-0
    • View Profile
Re: Diagram Automation
« Reply #6 on: March 30, 2004, 05:20:01 am »
Right - Haven't looked at Project, thought it was just for xmi handling.

Hmmm, quite a bit to catch up on...

Thanks Bruno! :)

Bruno.Cossi

  • EA User
  • **
  • Posts: 803
  • Karma: +0/-0
    • View Profile
Re: Diagram Automation
« Reply #7 on: March 30, 2004, 05:26:31 am »
No problem! :-)
I would have logically thought this would be on the Diagram level...

If you figure out the values for LayoutStyle, please share! :-)

Bruno

Stephen

  • EA User
  • **
  • Posts: 54
  • Karma: +0/-0
    • View Profile
Re: Diagram Automation
« Reply #8 on: March 30, 2004, 08:19:47 am »
There are lots of options from the GUI aren't there.

Can't find any obvious data tables to store the values in, nor anything in the registry, yet they can be stored for each diagram... must be in the database.

I wonder if they're encoded into a single database field...

Even so I've yet to find a layout that "adds value" for me as a user. Only benefit appears to be that the diagram objects won't overlap.

Have you tried any values?

Stephen

Bruno.Cossi

  • EA User
  • **
  • Posts: 803
  • Karma: +0/-0
    • View Profile
Re: Diagram Automation
« Reply #9 on: March 30, 2004, 08:27:24 am »
Yes, I have, more or les randomly - none seemed to make any difference :-(

Bruno

Stephen

  • EA User
  • **
  • Posts: 54
  • Karma: +0/-0
    • View Profile
Re: Diagram Automation
« Reply #10 on: March 30, 2004, 08:52:26 am »
Looks like you're right.

Just tried all values 0 - 128 and all powers of 2.

All diagrams laid out according to settings I set by hand in the GUI.

Me thinks the feature doesn't work...! ;)

Bruno.Cossi

  • EA User
  • **
  • Posts: 803
  • Karma: +0/-0
    • View Profile
Re: Diagram Automation
« Reply #11 on: March 30, 2004, 08:54:54 am »
Or there is a secret.... like the LayoutStyle has to be multiplied by PI or something like that :-)

Stephen

  • EA User
  • **
  • Posts: 54
  • Karma: +0/-0
    • View Profile
Re: Diagram Automation
« Reply #12 on: March 30, 2004, 09:08:51 am »
Just tried all bits set as well - powers of two minus one.
Still no effect.

I'm trying this on a class diagram with three classes on it.
When I change the Direction setting in the diagram layout options for this diagram it significantly affects the layout. I was hoping to see the same change when I hit on a useful value.

Ok - one last test while I write this message.
Changed the layout settings in the GUI.
Didn't say apply to whole project.
Re-running the all bit set test.....

And the result is...

All diagrams same in revised layout.

Damn - just thought of another test.
Change the direction in the GUI, but don't manually apply the layout....

Ok - running that with all powers of two and the all bits set tests.....
All output as per the settings I made by hand in the GUI
And the diagram has changed in the Model...

But I don't think LayoutStyle has much of an impact.
Should we raise a bug?? Or do you think this will be noticed anyway...

Bruno.Cossi

  • EA User
  • **
  • Posts: 803
  • Karma: +0/-0
    • View Profile
Re: Diagram Automation
« Reply #13 on: March 30, 2004, 09:15:01 am »
Let's raise a bug, this is actually quite important to me.
You sure are a thorough tester!

Bruno

Stephen

  • EA User
  • **
  • Posts: 54
  • Karma: +0/-0
    • View Profile
Re: Diagram Automation
« Reply #14 on: March 31, 2004, 12:37:25 am »
Not a very good tester, but as I said in another thread, bit too much of hacker (1980's game programming background).

I wasn't testing, I was reverse engineering!

(I've raised the bug)