!7 sclass LockMatrix > DynModule { transient int n; transient BitSet data; transient JComponent canvas; JComponent visualize() { ret awtDoEvery(canvas = JComponent() { public void paint(Graphics2D g) { int w = getWidth(), h = getHeight(); int rows = ifloor(sqrt(n)); if (rows == 0) fillRect(g, 0, 0, w, h, Color.white); int cols = (n+rows-1)/rows; for y to rows: { for x to cols: { fillRect(g, x1, y1, x2-x1, y2-y1, Color.white); } } } }, 1000, r updateMe); } void update { new BitSet bs; L l = dm_listModules(); for i over l: if (getLockOwner((Lock) get(l, 'lock)) != null) bs.set(i); setFields(n := l(l), data := bs); repaint(canvas); } }