@Override public void addNotify(Drawing drawing) { for (Figure child : new LinkedList<Figure>(children)) { child.addNotify(drawing); } super.addNotify(drawing); } @Override
@Override public void addNotify(Drawing drawing) { super.addNotify(drawing); for (Figure child : getChildren()) { child.addNotify(drawing); } }
@Override public boolean add(Figure figure) { basicAdd(figure); if (getDrawing() != null) { figure.addNotify(getDrawing()); } return true; } @Override
@Override public void add(int index, Figure figure) { basicAdd(index, figure); if (getDrawing() != null) { figure.addNotify(getDrawing()); } } @Override
@Override public void addNotify(Drawing drawing) { super.addNotify(drawing); if (getPresentationFigure() != null) { getPresentationFigure().addNotify(drawing); } }
@Override public void add(int index, Figure figure) { basicAdd(index, figure); if (getDrawing() != null) { figure.addNotify(getDrawing()); } fireFigureAdded(figure, index); invalidate(); }
public final void addAll(int index, Collection<? extends Figure> figures) { for (Figure f : figures) { basicAdd(index++, f); if (getDrawing() != null) { f.addNotify(getDrawing()); } fireFigureAdded(f, index); } invalidate(); }
/** * Set a figure which renders this BasicCompositeFigure. The presentation * tasks for the BasicCompositeFigure are delegated to this presentation * figure. * * * * * * @param newPresentationFigure figure takes over the presentation tasks */ public void setPresentationFigure(@Nullable Figure newPresentationFigure) { if (this.presentationFigure != null) { this.presentationFigure.removeFigureListener(presentationFigureHandler); if (getDrawing() != null) { this.presentationFigure.removeNotify(getDrawing()); } } this.presentationFigure = newPresentationFigure; if (this.presentationFigure != null) { this.presentationFigure.addFigureListener(presentationFigureHandler); if (getDrawing() != null) { this.presentationFigure.addNotify(getDrawing()); } } // FIXME: We should calculate the layout here. }