/** * Removes a figure from the composite. * * @see #removeAll */ public Figure remove(Figure figure) { if (fFigures.contains(figure)) { figure.removeFromContainer(this); fFigures.removeElement(figure); } return figure; }
/** * Removes all children. * * @see #remove */ public void removeAll() { FigureEnumeration k = figures(); while (k.hasMoreElements()) { Figure figure = k.nextFigure(); figure.removeFromContainer(this); } fFigures.removeAllElements(); }