📄 zcmdgroup.java
字号:
/*
* Copyright 2002 EZCell , Inc. All rights reserved.
* Version 1.0.
* Author W.John
*/
package ezcell;
import java.util.Hashtable;
import java.util.Vector;
import javax.swing.undo.AbstractUndoableEdit;
/**
* DOCUMENT ME!
*
* @version 1.00
* @author W.John
*/
class ZCmdGroup extends AbstractUndoableEdit implements ZCommand {
Vector cmdList = new Vector();
int selectionMode = SELECT_010;
Hashtable table;
ZSheet sheet;
ZRect cells;
ZCmdGroup(ZSheet sheet, ZRect cells, int selectionMode) {
this.sheet = sheet;
this.cells = cells;
this.selectionMode = selectionMode;
if (ZCmdFormat.getAutoUndo()) {
ZCmdFormat.undoManager.addCommand(this);
}
}
public void setRect(ZRect rect){ cells = rect;}
/**
*
* @return
*/
public ZRect getCells() {
return cells;
}
/**
*
* @return
*/
public int getSelectMode() {
return selectionMode;
}
/**
*
* @return
*/
public ZSheet getSheet() {
return sheet;
}
/**
* put your documentation comment here
* @param cmd
*/
public void add(AbstractUndoableEdit cmd) {
cmdList.add(cmd);
}
/**
*
* @param key
*
* @return
*/
public Object get(String key) {
if (table != null) {
return table.get(key);
}
return null;
}
/**
*
* @param key
* @param value
*/
public void put(String key, Object value) {
if (table == null) {
table = new Hashtable();
}
table.put(key, value);
}
/**
* put your documentation comment here
*/
public void redo() {
super.redo() ;
try {
for (int i = 0; i < cmdList.size(); i++) {
AbstractUndoableEdit cmd = (AbstractUndoableEdit) cmdList.elementAt(i);
cmd.redo();
}
} catch (Exception e) {
}
;
}
/**
*/
public void undo() {
super.undo() ;
try {
for (int i = cmdList.size() - 1; i >= 0; i--) {
AbstractUndoableEdit cmd = (AbstractUndoableEdit) cmdList.elementAt(i);
cmd.undo();
}
} catch (Exception e) {
}
;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -