command.java

来自「JHotDraw学习过程中对数组的测试程序haha 学习过程中对数组的测试程序」· Java 代码 · 共 57 行

JAVA
57
字号
/* * @(#)Command.java 5.1 * */package CH.ifa.draw.util;import java.awt.*;import java.util.*;/** * Commands encapsulate an action to be executed. Commands have * a name and can be used in conjunction with <i>Command enabled</i> * ui components. * <hr> * <b>Design Patterns</b><P> * <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> * <b><a href=../pattlets/sld010.htm>Command</a></b><br> * Command is a simple instance of the command pattern without undo * support. * <hr> * * @see CommandButton * @see CommandMenu * @see CommandChoice */public abstract class Command {    private String  fName;    /**     * Constructs a command with the given name.     */    public Command(String name) {        fName = name;    }    /**     * Executes the command.     */    public abstract void execute();    /**     * Tests if the command can be executed.     */    public boolean isExecutable() {        return true;    }    /**     * Gets the command name.     */    public String name() {        return fName;    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?