621622623624625626627628629630631632
Figure centerFigure = parent; while (centerFigure != null) { if (! (centerFigure instanceof ChildFigure)) break; ChildFigure cf = (ChildFigure) centerFigure; if (cf.getParent() == null) break; centerFigure = cf.getParent(); } return centerFigure; }