CircledPortrayal2D is working correctly for me using ObjectGridPortrayal2D but not using HexaObjectGridPortrayal2D.
With the HexaObjectGrid2D, the circle that ObjectGrid2D is supposed to produce does appear if it’s turned on always (when passing false to the constructor for the onlyCircleWhenSelected argument).
However, when onlyCircleWhenSelected is true, clicking on the underlying simple portrayal has no effect: The circle doesn’t appear (the inspector appears inspector tab with a double-click, though). If I switch to using ObjectGridPortrayal2D, the only-when-selected behavior works normally.
The code as I’ve left it uses HexaObjectGridPortrayal2D, so if you click on the square in the middle of the display, nothing will happen in the display. However, if you delete the two instances of “Hexa” in line 16 in StudentsWithUI.java, a blue circle will appear around the square when it’s clicked.
I tried clicking all around the square, too—I thought that maybe something was out of sync in the way in which HexaObjectGridePortrayal2D shifts the displayed positions of the underlying rectangular grid. This experiment was unsuccessful.
I’ve also looked for information in the manual and the classdocs that would indicate that CircledPortrayal2D isn’t supposed to work with HexaObjectGridPortrayal2D, but haven’t found anything that suggests that it wouldn’t work.
The symptoms seem identical to those in an earlier issue with SparseGrid2D and SparseGridPortrayal2D:
In that case, the problem was in SparseGrid2D. In this case, the underlying grid is the same, though, both for the working and non-working versions: It’s an ObjectGrid2D.