87,87c87,87 < * Removes the figure from the drawing and releases it. --- > * Removes a figure from the figure list, but 87a88,91 > * doesn't release it. Use this method to temporarily > * manipulate a figure outside of the drawing. > * > * @param figure that is part of the drawing and should be added 89,89d92 < 90,90c93,93 < public synchronized Figure remove(Figure figure) { --- > public synchronized Figure orphan(Figure figure) { 90a94,94 > Figure orphanedFigure = super.orphan(figure); 91a96,96 > if (orphanedFigure.listener() != null) { 92,92d95 < if (figure.listener() != null) { 93,93c97,97 < figure.listener().figureRequestRemove(new FigureChangeEvent(figure, null)); --- > orphanedFigure.listener().figureRequestRemove(new FigureChangeEvent(orphanedFigure, null)); 94,94d97 < return figure; 96,96c99,99 < return null; --- > return orphanedFigure; 98a102,106 > public synchronized Figure add(Figure figure) { > Figure addedFigure = super.add(figure); > if (addedFigure.listener() != null) { > addedFigure.listener().figureRequestUpdate(new FigureChangeEvent(figure, null)); > return addedFigure; 99,114d101 < /** < * Handles a removeFromDrawing request that < * is passed up the figure container hierarchy. < * @see FigureChangeListener < */ < public void figureRequestRemove(FigureChangeEvent e) { < Figure figure = e.getFigure(); < if (fFigures.contains(figure)) { < // Bugfix: This call will cleans up the quad-tree as well [JY] < super.remove(figure); < //fFigures.removeElement(figure); < //figure.removeFromContainer(this); // will invalidate figure < figure.release(); < } < else { < System.err.println("Attempt to remove non-existing figure"); 115a108,108 > return addedFigure; 132a126,126 > * Forces an update of the drawing change listeners. 133,133d125 < * Forces an update