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