?? createundoableedit.java
字號:
package com.sunking.tp.undoredo;
import java.awt.*;
import javax.swing.undo.*;
import com.sunking.tp.framework.*;
import com.sunking.tp.util.*;
/**
* <p>Title: CreateUndoableEdit</p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2003</p>
* <p>Company: </p>
* @author <a href="mailto:sunkingxie@hotmail.com">SunKing</a>
* @version 1.0
*/
public class CreateUndoableEdit extends AbstractUndoableEdit {
public final static int CREATE_JTPBUTTON = 0;
public final static int CREATE_JTPTEXTAREA = 1;
public final static int CREATE_JTPIMAGE = 2;
int type = -1;
JTPComponent com;
Desktop desk;
public CreateUndoableEdit(int type, Desktop desk, JTPComponent com) {
this.type = type;
this.com = com;
this.desk = desk;
}
String getPresentationNameOfType() {
switch (type) {
case CREATE_JTPBUTTON:
return "JTPButton";
case CREATE_JTPTEXTAREA:
return "JTPTextArea";
default:
return "JTPImage";
}
}
public String getUndoPresentationName() {
return JTPUtil.getString("Undo_Create") + getPresentationNameOfType();
}
public String getRedoPresentationName() {
return JTPUtil.getString("Redo_Create") + getPresentationNameOfType();
}
public void undo() throws CannotUndoException {
super.undo();
( (Container) desk).remove( (Component) com);
desk.fireAssoicatorChanged();
}
public void redo() throws CannotRedoException {
super.redo();
( (Container) desk).add( (Component) com);
desk.fireAssoicatorChanged();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -