setDefaultCloseOperation(HIDE_ON_CLOSE);
if (drawing == null) {
drawing = new AggregateDrawing();
} else {
FigureEnumeration figs = drawing.figures();
while (figs.hasNextFigure()) {
Figure fig = figs.nextFigure();
if (fig instanceof ModelElementFigure &&
((ModelElementFigure) fig).getModelElement() != null) {
drawing.getModel().addElement
(((ModelElementFigure) fig).getModelElement());
}