I’m writing a custom layout algorithm for a directed graph that I am representing. I’m using SimpleNode’s, where I have a 25x25 icon image, with some rather long text underneath of varying length (~80 characters).
The layout alogirhtm uses a couple of ‘for’ loops around the setTopLeft(x,y) method to place all of the objects in a symettric grid.
However, when viewed, the icons in the grid are slightly misaligned --making it look ‘messy’. I believe this is because that text underneath the SimpleNode is of varying length, and setTopLeft is including the space taken up by the text.
Does anyone know a way to get all of the icon images to line up straight? I’m looking for a setCenter(x,y) method, or setTextWidth(), or something to true it up.
the algorithm lays it out such that