You could try overriding the figure for compartment. Override isVisible()
method on the figure. Make it return false if children are empty. Children
of the compartment, however, won't be direct children... you'd have to go
down a couple of levels to reach them.