// Need an effigy and a tableau so that menu ops work properly.
if (_tableau == null) {
Effigy containerEffigy = Configuration.findEffigy(toplevel());
if (containerEffigy == null) {
throw new InternalErrorException(
"Cannot find effigy for top level: "
+ toplevel().getFullName());
}
try {
_effigy = new TokenEffigy(containerEffigy, containerEffigy
.uniqueName("imageEffigy"));
// The default identifier is "Unnamed", which is
// no good for two reasons: Wrong title bar label,
// and it causes a save-as to destroy the original window.
_effigy.identifier.setExpression(getFullName());
_frame = new ImageWindow();
_tableau = new ImageTableau(_effigy, "tokenTableau",
_frame, _oldXSize, _oldYSize);
_tableau.setTitle(getName());
_frame.setTableau(_tableau);
_windowProperties.setProperties(_frame);
// Regrettably, since setSize() in swing doesn't actually
// set the size of the frame, we have to also set the
// size of the internal component.
Component[] components = _frame.getContentPane()
.getComponents();
if (components.length > 0) {
_pictureSize.setSize(components[0]);
}
_tableau.show();
} catch (Exception ex) {
throw new InternalErrorException(ex);
}
} else {
// Erase previous image.
_effigy.clear();