Author Topic: Diagram Layout function from Java  (Read 4960 times)

Clemo

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Diagram Layout function from Java
« on: July 08, 2014, 12:25:29 am »
Hi,

Is there anyway of calling the diagram layout menu function from the Java API?

Thanks

Clemo

OpenIT Solutions

  • EA User
  • **
  • Posts: 555
  • Karma: +9/-1
    • View Profile
Re: Diagram Layout function from Java
« Reply #1 on: July 08, 2014, 01:33:24 am »
No. Only a subset of the automation interface has been implemented in the Java API; from memory its also missing the DocumentGenerator classes....

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: Diagram Layout function from Java
« Reply #2 on: July 08, 2014, 09:48:16 am »
The "Automatic" diagram layout type can be performed via automation by calling LayoutDiagramEx on the Project class.  See:
http://www.sparxsystems.com/enterprise_architect_user_guide/10/automation_and_scripting/project_2.html
 
This function is equivalent to the "Diagram | Layout Diagram" menu command in the EA user interface.  See:
http://www.sparxsystems.com/enterprise_architect_user_guide/10/modeling_basics/layoutadiagram.html
 
Code: [Select]
repository.GetProjectInterface().LayoutDiagramEx(diagram.GetDiagramGUID(), 0, 4, 20, 20, false);
Unfortunately it is not possible to call any of the diagram layout algorithms provided by the "Layout Tools" window in EA via automation at this time (E.g. Circle/Ellipse, Box, Per Page, Digraph, Spring).

Clemo

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Re: Diagram Layout function from Java
« Reply #3 on: July 08, 2014, 04:31:42 pm »
Fantastic that is exactly what I wanted.

Thanks

Paul :)

mcoletti

  • EA User
  • **
  • Posts: 45
  • Karma: +0/-0
    • View Profile
Re: Diagram Layout function from Java
« Reply #4 on: August 08, 2014, 12:57:45 am »
I was meaning InsertText in VB. It works adding a chr(13) in the string. ::)

OpenIT Solutions

  • EA User
  • **
  • Posts: 555
  • Karma: +9/-1
    • View Profile
Re: Diagram Layout function from Java
« Reply #5 on: August 19, 2014, 11:30:01 pm »
@Aron B :

Re comments on previous post "Unfortunately it is not possible to call any of the diagram layout algorithms provided by the "Layout Tools" window in EA via automation at this time (E.g. Circle/Ellipse, Box, Per Page, Digraph, Spring). "

Don't suppose this has changed with latest release ? I'd love to be able to apply "Circle" layout automatically ??

Regards,

Jon.

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: Diagram Layout function from Java
« Reply #6 on: August 20, 2014, 09:41:27 am »
No changes as far as I am aware.