2c2 < * @(#)DuplicateCommand.java 5.2 --- > * @(#)DuplicateCommand.java 3a4,9 > * Project: JHotdraw - a GUI framework for technical drawings > * http://www.jhotdraw.org > * http://jhotdraw.sourceforge.net > * Copyright: © by the original author(s) and all contributors > * License: Lesser GNU Public License (LGPL) > * http://www.opensource.org/licenses/lgpl-license.html 8,9d13 < import java.util.*; < import CH.ifa.draw.util.*; 10a15,16 > import CH.ifa.draw.util.*; > import java.util.*; 13a20,21 > * > * @version <$CURRENT_VERSION$> 27,29c35,36 < FigureSelection selection = fView.getFigureSelection(); < < fView.clearSelection(); --- > setUndoActivity(createUndoActivity()); > FigureSelection selection = view().getFigureSelection(); 31,33c38,45 < Vector figures = (Vector)selection.getData(FigureSelection.TYPE); < insertFigures(figures, 10, 10); < fView.checkDamage(); --- > // create duplicate figure(s) > FigureEnumeration figures = (FigureEnumeration)selection.getData(StandardFigureSelection.TYPE); > getUndoActivity().setAffectedFigures(figures); > > view().clearSelection(); > getUndoActivity().setAffectedFigures( > insertFigures(getUndoActivity().getAffectedFigures(), 10, 10)); > view().checkDamage(); 37c49 < return fView.selectionCount() > 0; --- > return view().selectionCount() > 0; 39a52,57 > /** > * Factory method for undo activity > */ > protected Undoable createUndoActivity() { > return new PasteCommand.UndoActivity(view()); > } 41,42d58 < <