/* * @(#)Command.java * * 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 */ package CH.ifa.draw.util; import CH.ifa.draw.framework.DrawingView; /** * Commands encapsulate an action to be executed. Commands have * a name and can be used in conjunction with Command enabled * ui components. *
* Design Patterns

*  o * Command
* Command is a simple instance of the command pattern without undo * support. *


* * @see CommandButton * @see CommandMenu * @see CommandChoice * * @version <$CURRENT_VERSION$> */ public interface Command { /** * Executes the command. */ public void execute(); /** * Tests if the command can be executed. */ public boolean isExecutable(); /** * Gets the command name. */ public String name(); public DrawingView view(); public Undoable getUndoActivity(); public void setUndoActivity(Undoable newUndoableActivity); }