code: public void onActivate() {
  		menu = getContextMenu();
  		mapWidget.setContextMenu(menu);
  
  		if (maxBoundsDisplayed) {
  			VectorLayer layer = getFeatureTransaction().getLayer();
  			GeometryFactory factory = mapWidget.getMapModel().getGeometryFactory();
  			LinearRing hole = factory.createLinearRing(new Bbox(layer.getLayerInfo().getMaxExtent()));
  			LinearRing shell = factory.createLinearRing(mapWidget.getMapModel().getMapView().getMaxBounds());
  			Polygon polygon = factory.createPolygon(shell, new LinearRing[] { hole });
  
  			maxExtent = new GfxGeometry("maxExtent");
  			maxExtent.setGeometry(polygon);
  			maxExtent.setStyle(new ShapeStyle("#000000", .6f, "#990000", 1, 2));
  			mapWidget.registerWorldPaintable(maxExtent);
  		}
  	}
docs: -------------------------------------------------------------------------