I’m trying to add a lot of icons on a JGoDocument. Dynamically, the icons should take an arbitrary positioning without disturbing each other…Is there anything that JGo document itself (or any other Jgo API) provides this facility or I do I need to write a “positioning algorithm” myself…Thanks in advance…
There are a lot of different policies that you could want, so there isn’t any built-in support for that.
However, you can use the JGoDocument.isUnoccupied predicate to tell you if a region you choose is free of any nodes in it.
Alternatively, as long as there are no unconnected nodes (and all are connected to a single graph), you could use force-directed autolayout to position everything. But whether that is reasonable depends on your application.