The GraphZoomScrollPane is a Swing JPanel container designed to wrap a VisualizationViewer. It provides custom horizontal and vertical scrollbars that automatically synchronize with the graph's scale and translation.
When a user zooms in or out using the VisualizationViewer, the GraphZoomScrollPane updates the scrollbar ranges and sizes. Conversely, adjusting the scrollbars allows the user to pan across the graph by modifying the translation component of the VisualizationViewer's layout transformer.
To use it, instantiate the component by passing an existing VisualizationViewer to its constructor.
// Assuming 'vv' is an existing VisualizationViewer instance
GraphZoomScrollPane scrollPane = new GraphZoomScrollPane(vv);
// Add 'scrollPane' to your UI container