protected void replaceOperator( final Operator newOP, final VisualGraph<Operator> parent, final GraphWrapper oldGW) { newOP.cloneFrom(this); this.replaceWith(newOP); final GraphWrapper gw = new GraphWrapperOperator(newOP); final GraphBox box = parent.getBoxes().get(oldGW); box.initBox(gw); box.arrange(Arrange.values()[0]); parent.getBoxes().remove(oldGW); parent.getBoxes().put(gw, box); parent.remove(this.panel); parent.add(box.getElement()); for (final Operator preOp : this.precedingOperators) { final GraphWrapper preGW = new GraphWrapperOperator(preOp); final GraphBox preBox = parent.getBoxes().get(preGW); preBox.setLineAnnotations(preOp.drawAnnotations(parent)); } parent.revalidate(); parent.repaint(); }