?? actionaddalarm.java
字號:
package com.zhtelecom.common.topograph.example.menuaction;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.JOptionPane;
import com.zhtelecom.common.topograph.TopoGraphView;
import com.zhtelecom.common.topograph.TopoObject;
import com.zhtelecom.common.topograph.example.NMSExample;
public class ActionAddAlarm extends AbstractAction
{
public void actionPerformed(ActionEvent e)
{
//之前已被賦值,這里獲取該拓撲對象。也可以通過TopoGraphView.getContextGraphView()快速獲取唯一實例。
TopoGraphView topoView = (TopoGraphView) getValue("topoGraphView");
String rs = JOptionPane.showInputDialog(topoView,
"請輸入要添加的告警對象的級別(0,1,2,3,4,5,6),0-最低,6-最高");
if (rs == null || rs.equals(""))
{
rs = "2";
}
int level = Integer.parseInt(rs);
TopoObject obj = topoView.getSelectedObject();
obj.addAlarm("告警" + NMSExample.getNum(), level);
}
public ActionAddAlarm()
{
super("添加告警");
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -