2c2 < * @(#)BringToFrontCommand.java 5.2 --- > * @(#)BringToFrontCommand.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.Command; 10a15,17 > import CH.ifa.draw.util.UndoableAdapter; > import CH.ifa.draw.util.Undoable; > import java.util.*; 16a24 > * @version <$CURRENT_VERSION$> 18,21c26 < public class BringToFrontCommand < extends Command { < < private DrawingView fView; --- > public class BringToFrontCommand extends AbstractCommand { 29,30c34 < super(name); < fView = view; --- > super(name, view); 34,36c38,42 < FigureEnumeration k = new FigureEnumerator(fView.selectionZOrdered()); < while (k.hasMoreElements()) { < fView.drawing().bringToFront(k.nextFigure()); --- > setUndoActivity(createUndoActivity()); > getUndoActivity().setAffectedFigures(view().selectionElements()); > FigureEnumeration fe = getUndoActivity().getAffectedFigures(); > while (fe.hasMoreElements()) { > view().drawing().bringToFront(fe.nextFigure()); 38c44 < fView.checkDamage(); --- > view().checkDamage(); 42c48 < return fView.selectionCount() > 0; --- > return view().selectionCount() > 0; 43a50,52 > > protected Undoable createUndoActivity() { > return new BringToFrontCommand.UndoActivity(view()); 45a55,58 > public static class UndoActivity extends SendToBackCommand.UndoActivity { > public UndoActivity(DrawingView newDrawingView) { > super(newDrawingView); > } 46a60,64 > protected void sendToCommand(Figure f) { > getDrawingView().drawing().bringToFront(f); > } > } > }