Hi Ter and Sam,
OK, FWIW, now that I'm using today's version of ANTLR4, my parse-tree-to-Swing-Outline test is working nicely.
Ter: Yes indeed, to use Outline or JTree you have to furnish an implementation of TreeModel. And TreeModel is simply an interface to whatever underlying data you have, it doesn't necessarily have data of its own.
However, the problem is that TreeModel doesn't actually cover all responsibilities needed to separate visual tree from your data (in this case, a parse tree), notably the responsibility to define how to distinguish/identify nodes that are to be displayed as distinct.
The case in point is that JTree and Outline rely on TreePath to distinguish visual nodes, and TreePath relies on data object's equals(). In particular, those components expect equals() to return false for distinct children of the same parent node regardless of whether they might otherwise be considered of equal "value".
So in cases like that, the only solution I've seen so far is to build your own parallel data structure (possibly using DefaultMutableTreeNode) that has node-compares that distinguish different children of same parent. But this introduces a whole lot more complexity associated with maintaining the parallel data structure in sync with the underlying application data.
However, now that RuleContext hashCode and equals() have reverted to underlying Object implementations, I think all is well!
-- Graham