I suppose I should drop the requirement that the piece that castles must be royal. As at the moment the Applet generates the code the Diagram in it still thinks the royal piece is the King. I don't think there is any downside to that: if one specifies a piece can castle, that piece will obviously need partners, and the Diagram should figure out how wide the board is at that point. Even if the piece is non-royal.
I suppose I should drop the requirement that the piece that castles must be royal. As at the moment the Applet generates the code the Diagram in it still thinks the royal piece is the King. I don't think there is any downside to that: if one specifies a piece can castle, that piece will obviously need partners, and the Diagram should figure out how wide the board is at that point. Even if the piece is non-royal.