?? createnodecommand.java
字號:
package com.example.commands;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.gef.commands.Command;
import com.example.model.FNode;
import com.example.model.FTransModel;
/**
* TODO
* @2006-12-31
* @author xuli
*/
public class CreateNodeCommand extends Command {
protected FTransModel diagram;
protected FNode node;
protected Point location;
// setters
public void setDiagram(FTransModel diagram) {
this.diagram = diagram;
}
public void setNode(FNode node) {
this.node = node;
}
public void setLocation(Point location) {
this.location = location;
}
public void execute() {
if (this.location != null) {
this.node.setLocation(this.location);
}
this.diagram.addChild(this.node);
}
public String getLabel() {
return "";
}
public void redo() {
this.execute();
}
public void undo() {
diagram.removeChild(node);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -