for (NodeView nodeView : nodeViews) {
Bounds nodeViewBounds = nodeView.getBounds(false);
// Only paint node views that intersect the current clip rectangle
if (nodeViewBounds.intersects(paintBounds)) {
// Create a copy of the current graphics context and
// translate to the node view's coordinate system
Graphics2D nodeViewGraphics = (Graphics2D)graphics.create();
nodeViewGraphics.translate(nodeViewBounds.x, nodeViewBounds.y);