persistable sclass G22ScreenPartsPanel extends G22CRUDAndDetailPanel { SimpleCRUD_v2 makeCRUD() { var crud = new SimpleCRUD_v2<>(g22utils.concepts(), G22ScreenPart); crud.entityName = -> "Screen part"; crud.addButton("Add all screens", rThread addAllScreens); ret crud; } void addAllScreens { uniq(g22utils.concepts(), G22ScreenPart, name := "All screens", bounds := combinedScreenBounds()); } JComponent makeDetailView(G22ScreenPart screenPart) { var maxSize = 100; var full = combinedScreenRect(); var rect = screenPart.bounds; var scale = min(doubleRatio(maxSize, full.w()), doubleRatio(maxSize, full.h())); var image = whiteImage(iround(scale*full.w()), iround(scale*full.h())); if (rect != null) { var scaled = scaleRect(rect, scale); fillRect(image, scaled, java.awt.Color.gray); } image = addBorderToImage(image, java.awt.Color.black, 1); ret g22utils.stdImageSurface(image); } selfType g22utils(G22Utils g22utils) { super.g22utils(g22utils); this; } }