/** * 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; }
/** Brings a figure to the front. */ public synchronized void bringToFront(Figure figure) { if (fFigures.contains(figure)) { fFigures.removeElement(figure); fFigures.addElement(figure); figure.changed(); } }
/** Adds a figure to the list of figures. Initializes the the figure's container. */ public Figure add(Figure figure) { if (!fFigures.contains(figure)) { fFigures.addElement(figure); figure.addToContainer(this); } return figure; }
/** Sends a figure to the back of the drawing. */ public synchronized void sendToBack(Figure figure) { if (fFigures.contains(figure)) { fFigures.removeElement(figure); fFigures.insertElementAt(figure, 0); figure.changed(); } }