ArrayList<RectangularShape> componentShapes = new ArrayList<RectangularShape>();
for (Vertex vertex: layout.getFirst().keySet())
{
RectangularShape shape = layout.getFirst().get(vertex);
vertexComponentMap.get(vertex).setBounds( shape.getBounds());
maxX = Math.max(maxX, shape.getBounds().x + shape.getBounds().width);
maxY = Math.max(maxY, shape.getBounds().y + shape.getBounds().height);
for (RectangularShape s: componentShapes)
{
if ( shape.intersects(s.getBounds2D()))
componentIntersecting = true;
}
componentShapes.add(shape);
}
if (! skipEdgeLabels)
{
for (Entry<Edge,Pair<RectangularShape,PolyLine>> edgeEntry: layout.getSecond().entrySet())
{
RectangularShape shape = edgeEntry.getValue().getFirst();
edgeLabelComponentMap.get(edgeEntry.getKey()).setBounds(shape.getBounds());
maxX = Math.max(maxX, shape.getBounds().x + shape.getBounds().width);
maxY = Math.max(maxY, shape.getBounds().y + shape.getBounds().height);
for (RectangularShape s: componentShapes)
{
if ( shape.intersects(s.getBounds2D()))
componentIntersecting = true;
}
componentShapes.add(shape);
}
}