Setting the positions of nodes based on a layout
If you have the control over the Position class, why not have a setPosition which takes the layout as a parameter? This would render the loop to be:

for (Node n: g.getNodes().values) {
    n.setPosition(lo);
}


This way you hide the conversion within the method, but it is still clear that your position is set relative to the layout, lo.  How you implement the setPosition() isn't then as interesting, but you could then easily do something like:

public void setPosition(Layout lo) {

    Position newPos = new Position(
        new Double(lo.getX(this.id)), 
        new Double(lo.getY(this.id)));

    setPosition(newPos());
}


This assumes that the id is available as an Integer within the Node class, but you'll get the gist of the idea and can surely complete it.