!7 cmodule PieceDatabase { S piece = "white king"; transient MultiMap multiMap; transient SingleComponentPanel scp; transient ImageSurface is; transient ReliableSingleThread rst = dm_rst(module(), r update); start-thread { multiMap = pairsToCIMultiMap(chessOCR_squareImagesCollectorFromAGIBlue().allImages()); rst.trigger(); } void update { if (multiMap == null || is == null) ret; scp.setComponent(jScroll_center(is)); is.setImage(mergeBufferedImagesHorizontally(multiMap.get(replaceObject(piece, "empty square", "empty")))); } visualize { is = jImageSurface(); ret withComputing(rst, northAndCenterWithMargins( main.onChange(rst, dm_comboBox piece(replace(ai_chessPieces(), "empty", "empty square"))), scp = singleComponentPanel(jCenteredLabel("Loading...")))); } }