/** Create a new Graphics pane with the passed Layer
* as the main graphics pane.
*/
public GraphicsPane(FigureLayer foregroundLayer) {
// Background events
_backgroundEventLayer = new EventLayer();
_backgroundEventLayer.setEnabled(true);
// Background layer is a figure layer
_backgroundLayer = new FigureLayer();
((FigureLayer) _backgroundLayer).setVisible(false);
((FigureLayer) _backgroundLayer).setEnabled(false);
// Foreground figures
_foregroundLayer = foregroundLayer;
// Overlay layer
_overlayLayer = new OverlayLayer();
// Overlay events
_foregroundEventLayer = new EventLayer();
_foregroundEventLayer.setEnabled(false);
// Initialize all these layers.
_initNewLayer(_backgroundEventLayer);
_initNewLayer(_backgroundLayer);