Book a Demo

Author Topic: Java API: Workaround for missing ConstLayoutStyles  (Read 3689 times)

kosh.iii

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Java API: Workaround for missing ConstLayoutStyles
« on: April 30, 2009, 10:00:03 pm »
In the eaapi.jar there is no enum for the diagram auto-layout styles. The SDK documentation doesn't tell us the value of each setting either, so I looked it up in the VBA EA Object Model 2.10. Here it is:

Code: [Select]
lsCrossReduceAggressive=33554432
lsCycleRemoveDFS=1073741824
lsCycleRemoveGreedy=-2147483648
lsInitializeDFSIn=201326592
lsInitializeNaive=134217728
lsInitializeDFSOut=67108864
lsLayeringLongestPathSink=805306368
lsLayeringLongestPathSource=536870912
lsLayeringOptimalLinkLength=268435456
lsLayoutDirectionDown=131072
lsLayoutDirectionLeft=262144
lsLayoutDirectionRight=524288
lsLayoutDirectionUp=65536

kosh.iii

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: Java API: Workaround for missing ConstLayoutSt
« Reply #1 on: May 05, 2009, 02:45:39 am »
To combine different layout options you can use the bitwise or operator, such as

Code: [Select]
int longestPathSourceAndDirectionDown = 536870912 | 131072;
I suppose there is no sanity check, so better don't try combining options from the same group, such as lsLayoutDirectionDown | lsLayoutDirectionUp.
« Last Edit: May 05, 2009, 02:45:53 am by kosh.iii »