Book a Demo

Author Topic: Diagram Import/Export  (Read 6636 times)

nbau2s

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Diagram Import/Export
« on: March 02, 2009, 10:03:41 pm »
Hello,
I am writing a small tool to export and import Sparx EA diagrams to/from GraphML (or an extension to graphml, to be precise).
I want to use a different (better) layout tool to layout the diagrams.
Right now, it seems to work alright, the only problem I have, is to identify the exact location where a DiagramLink starts or ends (i.e. where it 'docks' to the class/diagramNode). This is not encoded in the diagramLink's path, as one might expect. Has anyone an idea where and how this information is stored?

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Diagram Import/Export
« Reply #1 on: March 02, 2009, 10:37:36 pm »
It's probably hidden in the DiagramLink.Geometry string (which looks like "SX=0;SY=0;EX=0;EY=0;EDGE=3;$LLB=;LLT=;LMT=;LMB=;LRT=CX=101:CY=14:OX=0:OY=0:HDN=0:BLD=0:ITA=0:UND=0:CLR=-1:ALN=0:DIR=0:ROT=0;LRB=;IRHS=;ILHS=;" or the like), but don't ask me what this all means.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Diagram Import/Export
« Reply #2 on: March 03, 2009, 09:27:31 am »
Quote
It's probably hidden in the DiagramLink.Geometry string (which looks like "SX=0;SY=0;EX=0;EY=0;EDGE=3;$LLB=;LLT=;LMT=;LMB=;LRT=CX=101:CY=14:OX=0:OY=0:HDN=0:BLD=0:ITA=0:UND=0:CLR=-1:ALN=0:DIR=0:ROT=0;LRB=;IRHS=;ILHS=;" or the like), but don't ask me what this all means.
Specifically, it will be held in SX,SY for the source and EX,EY for the target (S=start, E=end). I don't know what the values mean, possibly the offset of the centre of the shape (you aim your line at the centre of the shape and attach it at the position where it intersects the edge of the shape).
The Sparx Team
[email protected]

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Diagram Import/Export
« Reply #3 on: March 03, 2009, 06:45:10 pm »
Quote
I don't know what the values mean

Doesn't that call for more technical documentation? Or even better, interfaces within the API to wrap all these ugly strings; something like IDiagramLinkGeometry.SourcePosition a.s.o.

Just dreaming...

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Diagram Import/Export
« Reply #4 on: March 04, 2009, 12:54:30 am »
Quote
...
Doesn't that call for more technical documentation? Or even better, interfaces within the API to wrap all these ugly strings; something like IDiagramLinkGeometry.SourcePosition a.s.o.
...

I beg to differ. IMO it calls for both.
No, you can't have it!

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Diagram Import/Export
« Reply #5 on: March 04, 2009, 01:35:26 am »
Quote
I beg to differ. IMO it calls for both.

Couldn't agree more. But that's two dreams.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Diagram Import/Export
« Reply #6 on: March 04, 2009, 02:27:52 am »
Quote
Couldn't agree more. But that's two dreams.
I'll get started right away.

Zzzzzzzzzz...
No, you can't have it!

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Diagram Import/Export
« Reply #7 on: March 04, 2009, 04:11:22 am »
I meant to say daydreams...

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Diagram Import/Export
« Reply #8 on: March 04, 2009, 05:22:12 am »
And it is still daytime here.

I maintain that those folks who just cannot function without getting a good 8 hours of sleep at night are just not getting enough sleep in the office!
No, you can't have it!