Class AirdLayout
java.lang.Object
be.kuleuven.cs.distrinet.sparta.io.diagram.AirdLayout
Extracts the geometry of a Sirius diagram from its
.aird representations file by
reading it as plain XML - deliberately with no dependency on Sirius, GMF-runtime,
draw2d or SWT, so it runs headlessly (RCP and standalone alike).
The mapping followed is the standard GMF/Sirius one:
notation:Node[@element] --uid--> diagram:DNode/DNodeContainer/DNodeList
└─ <target href="model#FRAGMENT"/>
notation:Node/layoutConstraint (notation:Bounds x,y,width,height)
The result maps each semantic element's resource fragment (its xmi:id, matching
Resource.getURIFragment(org.eclipse.emf.ecore.EObject)) to its absolute bounds on
the diagram. GMF stores child coordinates relative to the parent node, so ancestor offsets
are accumulated while walking the notation tree.
Any parse/IO error yields an empty layout rather than throwing:
a missing or unreadable .aird simply means "no reusable layout", and the report
generator falls back gracefully.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classAbsolute bounds of a diagram node, in GMF coordinates (origin top-left, y downwards). -
Method Summary
Modifier and TypeMethodDescriptionbooleanisEmpty()static AirdLayoutParse the given.aird.title()
-
Method Details
-
boxFor
- Returns:
- bounds for the semantic element with the given resource fragment, or
null.
-
isEmpty
public boolean isEmpty() -
title
- Returns:
- a best-effort diagram name, or
nullif none was found.
-
parse
Parse the given.aird. Never throws: on any error an empty layout is returned.
-