You might want to look at the edu.mit.csail.sdg.alloy4viz.StaticProjector
class and its project
methods---that's how the Alloy Visualizer implements projections. If your visualization uses the edu.mit.csail.sdg.alloy4viz.AlloyModel
class, you should be able to reuse the existing code in StaticProjector
; from your post it seems, however, that you'd prefer not use any of the alloy4viz classes, in which case it should not be too difficult to understand how StaticProjector
works and reapply the same ideas to your project. Or you could convert an A4Solution
object to an AlloyInstance
[1] and build your visualizer around the alloy4viz classes, which, in my opinion, would be a good way to go about your project.
[1] something like:
a4sol.writeXML("instance.xml")
AlloyInstance inst = StaticInstanceReader.parseInstance(new File("instance.xml"));