sclass G22GalleryPanel is Swingable { settable transient G22Utils g22utils; transient new JGallery_v2 gallery; transient ImageSurface selectedImageSurface; transient new G22AnalysisPanel analysisPanel; void selectImage(GalleryImage img) { if (img != null) gallery.selectFile(img.path); } cachedVisualize { var selectedImageSurface = stdImageSurface(); gallery.onAdaptingButton(button -> { if (!g22utils.devMode()) ret; componentPopupMenuItem(button, "Upload image...", rThread { uploadImageFileDialog(button.imageFile()) }); }); new AWTOnConceptChangesByClass(g22utils.concepts(), GalleryImage, gallery.visualize(), -> { print("Updating gallery"); var files = sortFilesAlphaNumIC( map(list(g22utils.concepts(), GalleryImage), i -> i.path)); gallery.setImageFiles(files); updateEnclosingTabTitleWithCount(gallery.visualize(), l(files)); }).install(); /*analysisPanel.editAnalyzer = l1 editAnalyzer; analysisPanel.g22utils(g22utils).imageSurface(galleryImageSurface); ownResource(analysisPanel); main onChange(analysisPanel, me());*/ /*gallery.openImage = img -> { galleryImageSurface.loadImage(img); analysisPanel.setImage(img); };*/ ret withBottomMargin( jvsplit(0.75, jhsplit(0.25, jCenteredSection("All Images", gallery.visualize()), jRaisedCenteredSection("Selected Image", withRightAlignedButtons(galleryImageSurface.visualize(), "Gallery CRUD" := r { showUIURL("Gallery CRUD") } ) ) ), analysisPanel.visualize() )); } }