📄 deletetool.java
字号:
package com.sunking.tp.tool;
import com.sunking.tp.framework.*;
import com.sunking.tp.util.*;
/**
*
* <p>Title: </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 DeleteTool extends AbstractTool {
/**
* @param desk
* @param icon
*/
public DeleteTool(Desktop desk, javax.swing.Icon icon) {
super(desk);
setToolTip(JTPUtil.getString("DeleteTool_TIP"));
setIcon(icon);
}
/**
*启用工具
*/
public void enabledTool() {
super.enabledTool();
if (desk.getSelectionJTPComponent().length != 0
|| desk.getSelectionLine() != null){
UndoableEditFactory.getDefault().startEdit(
UndoableEditFactory.DELETE, desk, desk.getSelectionJTPComponent());
desk.deleteSelection(); //删除当前选取的组件或连线
UndoableEditFactory.getDefault().stopEdit(null);
}
desk.setTool(null);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -