2c2 < * @(#)FigureTransferCommand.java 5.2 --- > * @(#)FigureTransferCommand.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 14a21,22 > * > * @version <$CURRENT_VERSION$> 16,18c24 < abstract class FigureTransferCommand extends Command { < < protected DrawingView fView; --- > public abstract class FigureTransferCommand extends AbstractCommand { 26,27c32 < super(name); < fView = view; --- > super(name, view); 33,35c38,43 < protected void deleteSelection() { < fView.drawing().removeAll(fView.selection()); < fView.clearSelection(); --- > protected void deleteFigures(FigureEnumeration fe) { > while (fe.hasMoreElements()) { > view().drawing().orphan(fe.nextFigure()); > } > > view().clearSelection(); 39c47 < * Copies the selection to the clipboard. --- > * Copies the FigureEnumeration to the clipboard. 41,43c49,50 < protected void copySelection() { < FigureSelection selection = fView.getFigureSelection(); < Clipboard.getClipboard().setContents(selection); --- > protected void copyFigures(FigureEnumeration fe, int figureCount) { > Clipboard.getClipboard().setContents(new StandardFigureSelection(fe, figureCount)); 50,57c57,58 < protected void insertFigures(Vector figures, int dx, int dy) { < FigureEnumeration e = new FigureEnumerator(figures); < while (e.hasMoreElements()) { < Figure figure = e.nextFigure(); < figure.moveBy(dx, dy); < figure = fView.add(figure); < fView.addToSelection(figure); < } --- > FigureEnumeration insertFigures(FigureEnumeration fe, int dx, int dy) { > return view().insertFigures(fe, dx, dy, false); 59d59 <