@Override public AbstractAttributedDecoratedFigure clone() { AbstractAttributedDecoratedFigure that = (AbstractAttributedDecoratedFigure) super.clone(); if (this.decorator != null) { that.decorator = (Figure) this.decorator.clone(); } return that; } }
@Override protected Figure createFigure() { if (prototype instanceof CompositeFigure) { // we must not apply default attributs to the composite figure, // because this would change the look of the figures that we // read from the SVG file. return (Figure) prototype.clone(); } else { return super.createFigure(); } }
@SuppressWarnings("unchecked") protected Figure createFigure() { Figure f = (Figure) prototype.clone(); getEditor().applyDefaultAttributesTo(f); if (prototypeAttributes != null) { for (Map.Entry<AttributeKey, Object> entry : prototypeAttributes.entrySet()) { f.set(entry.getKey(), entry.getValue()); } } return f; }
@Override public LabeledLineConnectionFigure clone() { LabeledLineConnectionFigure that = (LabeledLineConnectionFigure) super.clone(); that.childHandler = new ChildHandler(that); that.children = new ArrayList<Figure>(); for (Figure thisChild : this.children) { Figure thatChild = (Figure) thisChild.clone(); that.children.add(thatChild); thatChild.addFigureListener(that.childHandler); } return that; } @Override
@Override public AbstractCompositeFigure clone() { AbstractCompositeFigure that = (AbstractCompositeFigure) super.clone(); that.children = new ArrayList<Figure>(); that.eventHandler = that.createEventHandler(); for (Figure thisChild : this.children) { Figure thatChild = (Figure) thisChild.clone(); that.children.add(thatChild); thatChild.addFigureListener(that.eventHandler); } return that; }
final ArrayList<Figure> duplicates = new ArrayList<Figure>(figures.size()); for (Figure f : figures) { Figure df = (Figure) f.clone(); d.add(df); duplicates.add(df);
@Override @SuppressWarnings("unchecked") public GraphicalCompositeFigure clone() { GraphicalCompositeFigure that = (GraphicalCompositeFigure) super.clone(); that.presentationFigure = (this.presentationFigure == null) ? null : (Figure) this.presentationFigure.clone(); if (that.presentationFigure != null) { that.presentationFigure.addFigureListener(that.presentationFigureHandler); } that.attributes=(HashMap<AttributeKey, Object>) this.attributes.clone(); that.forbiddenAttributes= this.forbiddenAttributes==null?null:(HashSet<AttributeKey>) this.forbiddenAttributes.clone(); return that; }
tx.translate(5, 5); for (Figure f : sorted) { Figure d = (Figure) f.clone(); d.transform(tx); duplicates.add(d);
Figure obj = readElement(refElem); if (obj != null) { Figure figure = (Figure) obj.clone(); for (Map.Entry<AttributeKey, Object> entry : a2.entrySet()) { figure.set(entry.getKey(), entry.getValue());
} else { prototype = imagePrototype; final ImageHolderFigure loaderFigure = ((ImageHolderFigure) prototype.clone()); worker = new Worker() {
final ImageHolderFigure loaderFigure = ((ImageHolderFigure) prototype.clone()); Worker worker = new Worker() {