2,2c2,2 < * @(#)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 7a15,16 > import CH.ifa.draw.util.UndoableAdapter; > import CH.ifa.draw.util.Undoable; 8,8c17,17 < import java.util.*; --- > import java.util.*; 9,9d17 < import CH.ifa.draw.util.Command; 16a24,24 > * @version <$CURRENT_VERSION$> 18,18c26,26 < public class BringToFrontCommand --- > public class BringToFrontCommand extends AbstractCommand { 19,21d26 < extends Command { < < private DrawingView fView; 29,29c34,34 < super(name); --- > super(name, view); 30,30d34 < fView = view; 33a38,42 > setUndoActivity(createUndoActivity()); > getUndoActivity().setAffectedFigures(view().selectionElements()); > FigureEnumeration fe = getUndoActivity().getAffectedFigures(); > while (fe.hasMoreElements()) { > view().drawing().bringToFront(fe.nextFigure()); 34,36d37 < FigureEnumeration k = new FigureEnumerator(fView.selectionZOrdered()); < while (k.hasMoreElements()) { < fView.drawing().bringToFront(k.nextFigure()); 38,38c44,44 < fView.checkDamage(); --- > view().checkDamage(); 42,42c48,48 < 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); > } > } > }