// the last rows
ViewportLayer viewportLayerBottom = new ViewportLayer(bodyDataLayer);
viewportLayerBottom.setMinRowPosition(10);
// create a CompositeLayer that contains both ViewportLayers
CompositeLayer compositeLayer = new CompositeLayer(1, 2);
compositeLayer.setChildLayer("REGION_A", viewportLayerTop, 0, 0);
compositeLayer.setChildLayer("REGION_B", viewportLayerBottom, 0, 1);
// in order to make printing and exporting work correctly you need to
// register the following
// command handlers
// although in this example printing and exporting is not enabled, we
// show the registering
compositeLayer
.registerCommandHandler(new MultiTurnViewportOnCommandHandler(
viewportLayerTop, viewportLayerBottom));
compositeLayer
.registerCommandHandler(new MultiTurnViewportOffCommandHandler(
viewportLayerTop, viewportLayerBottom));
// set the height of the top viewport to only showing 2 rows at the same
// time