package Frame;
|
import java.awt.BorderLayout;
|
import java.awt.Color;
|
import java.awt.Container;
|
import java.awt.Font;
|
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionListener;
|
import java.awt.event.MouseEvent;
|
import java.awt.event.MouseListener;
|
import java.io.IOException;
|
import java.util.Iterator;
|
import java.util.Vector;
|
import javax.swing.ImageIcon;
|
import javax.swing.JCheckBox;
|
import javax.swing.JPanel;
|
import javax.swing.JScrollPane;
|
import javax.swing.JTable;
|
import javax.swing.JTextArea;
|
import javax.swing.JTextField;
|
import javax.swing.ListSelectionModel;
|
import javax.swing.event.InternalFrameEvent;
|
import javax.swing.event.InternalFrameListener;
|
import javax.swing.table.DefaultTableModel;
|
import ColorAndFont.ChooseFont;
|
import ColorAndFont.English;
|
import ColorAndFont.UIColor;
|
import ColorAndFont.buttonTitle;
|
import Judge.JugeNumber;
|
import Method.GetNowTime;
|
import Method.JComboBoxModel;
|
import PbuliClass.JButtonModel;
|
import PbuliClass.JlableModel;
|
import PbuliClass.ShowMessage;
|
import PbuliClass.Systems;
|
import PbuliClass.greateTables;
|
import PbuliClass.jinternalFrame;
|
import anchor.Anchor_Dell;
|
import tbDataModel.S2data;
|
import tbDataModel_Dell.DellS2;
|
import tbDataModel_Dell.Dell_Wifi;
|
|
/* ´ËÀàÓÃÓÚÍøÂçÄ£¿éS2Ïà¹ØÉèÖÃ*/
|
public class S2Manage extends jinternalFrame{
|
/**
|
*
|
*/
|
private static final long serialVersionUID = 1L;
|
|
Container rq;
|
String ip=null;
|
JlableModel jl_name=new JlableModel("Óû§Ãû:");
|
JlableModel jl_pass=new JlableModel("ÃÜ Âë:");
|
JlableModel jl_shebeiname=new JlableModel("É豸ID:");
|
JlableModel jl_port=new JlableModel("Ä¿±ê¶Ë¿Ú:");
|
JlableModel jl_model=new JlableModel("¹¤×÷ģʽ:");
|
JlableModel jl_ip=new JlableModel("¾²Ì¬IP:");
|
JlableModel jl_wangguan=new JlableModel("Íø ¹Ø:");
|
JlableModel jl_ziwang=new JlableModel("×ÓÍøÑÚÂë:");
|
JlableModel jl_fuwuip=new JlableModel("Ä¿±êIP:");
|
JlableModel jl_MAC=new JlableModel("MACµØÖ·:");
|
JlableModel jl_bendiport=new JlableModel("±¾µØ¶Ë¿Ú:");
|
JlableModel jl_botelv=new JlableModel("²¨ÌØÂÊ:");
|
|
static JTextField jt_name=new JTextField();
|
static JTextField jt_pass=new JTextField();
|
static JTextField jt_shebeiname=new JTextField();
|
static JTextField jt_port=new JTextField();
|
static JComboBoxModel jb_xieyi=null;//ÐÒéÀàÐÍ
|
static JTextField jt_ip=new JTextField();
|
static JTextField jt_wangguan=new JTextField();
|
static JTextField jt_ziwang=new JTextField();
|
static JTextField jt_fuwuip=new JTextField();
|
static JTextField jt_MAC=new JTextField();
|
static JTextField jt_bendiport=new JTextField();
|
static JTextField jt_botelv=new JTextField();
|
|
String mac=null;
|
|
static JTextArea textArea=null;
|
|
JButtonModel jbt_serch=null;//ËÑË÷°´Å¥
|
JButtonModel jbt_help=null;//°ïÖú
|
JButtonModel jbt_save=null;//±£´æ
|
JButtonModel jbt_clear=null;//Çå¿Õ
|
JButtonModel jbt_reboot=null;//ÖØÆô
|
JButtonModel jbt_reset=null;//»Ö¸´³ö³§ÉèÖÃ
|
JButtonModel jbt_alertall=null;//ÐÞ¸ÄÈ«²¿
|
JButtonModel jbt_openwlan=null;//´ò¿ªÍøÂç
|
|
|
JCheckBox jc_ip=null;
|
JCheckBox jc_wangguan=null;
|
JCheckBox jc_adress=null;
|
|
|
JPanel jp_mb=null;//Äϲ¿Ãæ°å
|
JScrollPane gd=null;//¹ö¶¯Ãæ°å
|
JScrollPane gd2=null;//¹ö¶¯Ãæ°å
|
JTable table=null;//ÉêÃ÷±í¸ñ
|
static DefaultTableModel tableModel=null;//ÉùÃ÷±í¸ñÄ£ÐÍ
|
|
Vector<Vector<String>> rowData=null;
|
static boolean alertall=false;
|
static int caozuotyep=0;
|
|
JComboBoxModel box_anchorid=null;//»ùÕ¾µÄ¼¯ºÏ
|
JTextField jf_ancip=new JTextField("255.255.255.255");
|
String anchorid=null;
|
String path=null;
|
|
|
public S2Manage() {
|
String title="ÍøÂçÉèÖÃ";
|
if(Systems.sys().getLanguage().equals("English")) {
|
title="Anchor Network settings";
|
}
|
this.setBounds(175, 0, 850,540);
|
this.setTitle(title);
|
rq=getContentPane();//»ñÈ¡ÈÝÆ÷
|
rq.setLayout(new BorderLayout());
|
rq.setBackground(Color.white);
|
rq.add(getJp_mb());
|
this.setFrameIcon(new ImageIcon("image/icon/anchoricon.png"));//ÉèÖô°Ìåͼ±ê
|
rowData=new Vector<>();
|
jt_name.setEnabled(false);
|
jt_pass.setEnabled(false);
|
this.addInternalFrameListener(new InternalFrameListener() {
|
public void internalFrameOpened(InternalFrameEvent e) {
|
}
|
|
public void internalFrameIconified(InternalFrameEvent e) {
|
|
}
|
|
public void internalFrameDeiconified(InternalFrameEvent e) {
|
|
}
|
|
public void internalFrameDeactivated(InternalFrameEvent e) {
|
}
|
|
public void internalFrameClosing(InternalFrameEvent e) {
|
}
|
|
public void internalFrameClosed(InternalFrameEvent e) {
|
textArea=null;
|
tableModel=null;
|
DellS2.getRow().removeAllElements();
|
cleartx();
|
alertall=false;
|
}
|
|
public void internalFrameActivated(InternalFrameEvent e) {
|
|
}
|
});
|
|
}
|
|
|
public JPanel getJp_mb() {
|
if(jp_mb==null) {
|
jp_mb=new JPanel();
|
jp_mb.setBackground(UIColor.getNorth_color());
|
jp_mb.setLayout(null);
|
jp_mb.add(getJbt_serch());
|
jp_mb.add(getJbt_help() );
|
jp_mb.add(getGd());
|
jp_mb.add(getJbt_save());
|
jp_mb.add(getGd2());
|
jp_mb.add(getJbt_clear());
|
jp_mb.add(getJbt_reboot() );
|
jp_mb.add(getJbt_reset() );
|
jp_mb.add(getJc_ip());
|
jp_mb.add(getJc_wangguan());
|
jp_mb.add(getJc_adress());
|
jp_mb.add(getJbt_alertall());
|
jp_mb.add(getJbt_openwlan());
|
jp_mb.add(jl_bendiport);
|
jp_mb.add(jt_bendiport);
|
jp_mb.add(getBox_anchorid());
|
jp_mb.add(jf_ancip);
|
jp_mb.add(jl_botelv);
|
jp_mb.add(jt_botelv);
|
|
|
int x1=410;
|
int y1=50;
|
|
int x2=630;
|
int y2=50;
|
|
box_anchorid.setBounds(10,10, 100, 25);
|
jf_ancip.setBounds(130,10,200, 25);
|
|
|
|
|
gd.setBounds(10, y1,380,380);
|
jbt_serch.setBounds(10,y1+400, 60, 25);
|
jbt_save.setBounds(80, y1+400, 60, 25);
|
jbt_alertall.setBounds(150, y1+400, 90, 25);
|
jbt_reset.setBounds(250, y1+400,60, 25);
|
jbt_reboot.setBounds(320,y1+400,60, 25);
|
jbt_openwlan.setBounds(580,y1+400,80, 25);
|
jbt_clear.setBounds(670, y1+400,60, 25);
|
jbt_help.setBounds(740, y1+400, 60, 25);
|
|
|
gd2.setBounds(x1, y1+240, 400, 130);
|
|
|
|
jp_mb.add(jt_name);
|
jp_mb.add(jt_pass);
|
jp_mb.add(jt_shebeiname);
|
jp_mb.add(jt_port);
|
jp_mb.add(getJb_xieyi());
|
jp_mb.add(jt_ip);
|
jp_mb.add(jt_wangguan);
|
jp_mb.add(jt_ziwang);
|
jp_mb.add(jt_fuwuip);
|
jp_mb.add(jt_MAC);
|
jp_mb.add(jl_name);
|
jp_mb.add(jl_pass);
|
jp_mb.add(jl_shebeiname);
|
jp_mb.add(jl_port);
|
jp_mb.add(jl_model);
|
jp_mb.add(jl_ip);
|
jp_mb.add(jl_wangguan);
|
jp_mb.add(jl_ziwang);
|
jp_mb.add(jl_fuwuip);
|
jp_mb.add(jl_MAC);
|
|
|
|
//Óû§Ãû
|
jl_name.setBounds(x1, y1, 80, 25);
|
jt_name.setBounds(x1+80, y1, 100, 25);
|
|
//ÃÜÂë
|
jl_pass.setBounds(x1,y1+40, 80, 25);
|
jt_pass.setBounds(x1+80, y1+40, 100, 25);
|
|
//É豸Ãû³Æ
|
jl_shebeiname.setBounds(x1, y1+80, 80, 25);
|
jt_shebeiname.setBounds(x1+80, y1+80,100, 25);
|
|
//·þÎñÆ÷¶Ë¿Ú
|
jl_port.setBounds(x1, y1+120, 80, 25);
|
jt_port.setBounds(x1+80, y1+120,100, 25);
|
|
//¹¤×÷ģʽ
|
jl_model.setBounds(x1, y1+160, 80, 25);
|
jb_xieyi.setBounds(x1+80, y1+160,100, 25);
|
|
//±¾µØ¶Ë¿Ú
|
jl_bendiport.setBounds(x1, y1+200, 80, 25);
|
jt_bendiport.setBounds(x1+80, y1+200,100, 25);
|
|
//ipµØÖ·
|
jl_ip.setBounds(x2, y2, 80, 25);
|
jt_ip.setBounds(x2+80, y2,100, 25);
|
jc_ip.setBounds(x2+185, y2,20, 25);
|
|
//Íø¹Ø
|
jl_wangguan.setBounds(x2, y2+40, 80, 25);
|
jt_wangguan.setBounds(x2+80, y2+40,100, 25);
|
jc_wangguan.setBounds(x2+185, y2+40,20, 25);
|
|
//×ÓÍøÑÚÂë
|
jl_ziwang.setBounds(x2, y2+80, 80, 25);
|
jt_ziwang.setBounds(x2+80, y2+80,100, 25);
|
|
//·þÎñÆ÷IPµØÖ·
|
jl_fuwuip.setBounds(x2, y2+120, 80, 25);
|
jt_fuwuip.setBounds(x2+80, y2+120,100, 25);
|
jc_adress.setBounds(x2+185, y2+120,20, 25);
|
|
//MACµØÖ·
|
jl_MAC.setBounds(x2, y2+160, 80, 25);
|
jt_MAC.setBounds(x2+80, y2+160,100, 25);
|
|
//²¨ÌØÂÊ
|
jl_botelv.setBounds(x2, y1+200, 80, 25);
|
jt_botelv.setBounds(x2+80, y1+200,100, 25);
|
|
|
}
|
return jp_mb;
|
}
|
|
|
/**ËÑË÷°´Å¥*/
|
public JButtonModel getJbt_serch() {
|
if(jbt_serch==null) {
|
jbt_serch=new JButtonModel("ËÑ Ë÷");
|
jbt_serch.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
alertall=false;
|
jc_adress.setSelected(false);
|
jc_ip.setSelected(false);
|
jc_wangguan.setSelected(false);
|
DellS2.getRow().removeAllElements();
|
updateTable();
|
String ip=jf_ancip.getText().trim();
|
if(ip.length()<6) {
|
ShowMessage.zidingyi("ÇëÊäÈëÕýÈ·µÄipµØÖ·"+ip);
|
}
|
DellS2.serch(ip);
|
|
}
|
});
|
|
}
|
return jbt_serch;
|
}
|
|
/**°ïÖú°´Å¥*/
|
public JButtonModel getJbt_help() {
|
if(jbt_help==null) {
|
jbt_help=new JButtonModel("more");
|
jbt_help.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
try {
|
Runtime.getRuntime().exec("cmd /c systemFiles\\IP\\anchormage.exe");
|
} catch (IOException e1) {
|
e1.printStackTrace();
|
ShowMessage.zidingyi("´ò¿ªÊ§°Ü£¡");
|
}
|
}
|
});
|
|
}
|
return jbt_help;
|
}
|
|
/**±£´æ²ÎÊý*/
|
public JButtonModel getJbt_save() {
|
if(jbt_save==null) {
|
jbt_save=new JButtonModel(buttonTitle.getSave());
|
jbt_save.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
String mokuaiid=jt_shebeiname.getText();
|
String ip=jt_ip.getText();
|
String wangguan=jt_wangguan.getText();
|
String ziwang=jt_ziwang.getText();
|
//ÐÒéÀàÐÍ
|
String model="00";
|
//²¨ÌØÂÊ
|
String btl=jt_botelv.getText().trim();
|
|
String type=(String) jb_xieyi.getSelectedItem();
|
if(type.equals("TCP-Client")) {
|
model="01";
|
}
|
|
String fuwuport=jt_port.getText().trim();
|
|
if(!JugeNumber.isDigit(fuwuport)) {
|
ShowMessage.zidingyi(fuwuport+"Ä¿±ê¶Ë¿Ú±ØÐëȫΪÊý×Ö...");
|
return;
|
}
|
|
ShowMessage.isIpAdress(ip);
|
ShowMessage.isIpAdress(wangguan);
|
ShowMessage.isIpAdress(ziwang);
|
String adress=jt_fuwuip.getText().trim();
|
String macid=jt_MAC.getText();
|
if(macid.length() !=12) {
|
ShowMessage.zidingyi(macid+"MACµØÖ·ÓÐÎó£¡");
|
return;
|
}
|
DellS2.alert_s2(ip, wangguan, ziwang, mokuaiid, macid);
|
//´®¿Ú²ÎÊýÍøÂçÉèÖÃ
|
DellS2.alert_s2_chuankou(adress, macid,model,fuwuport,btl);
|
//Ö´ÐÐÖØÆôÉ豸²Ù×÷
|
DellS2.reads2peizhi((byte)0x02,macid);
|
|
}
|
});
|
}
|
return jbt_save;
|
}
|
|
|
|
|
|
/**ˢбí¸ñ·½·¨*/
|
public void updateTable() {
|
if(tableModel !=null) {
|
tableModel.getDataVector().clear();
|
getRowData(DellS2.getRow());
|
gd.validate();
|
}
|
}
|
|
/**Ìí¼Ó±í¸ñÐÐÏòÁ¿Êý¾Ý·½·¨*/
|
public void getRowData( Vector<S2data> s2_vector ) {
|
Iterator<S2data> iterator = s2_vector.iterator();//´´½¨µü´úÆ÷
|
|
while (iterator.hasNext()) {//µü´úÆ÷´æÔÚÔªËØ
|
Vector<String> row = new Vector<>();
|
S2data s2 = iterator.next();//½«µü´úÆ÷ÀïÃæµÄÔªËØ¸øµ½list¼¯ºÏ
|
row.add(s2.getIp());
|
row.add(s2.getName());
|
row.add(s2.getMac());
|
row.add(s2.getVersion());
|
tableModel.addRow(row);
|
}
|
}
|
|
|
|
public JScrollPane getGd() {
|
if(gd==null) {
|
gd=new JScrollPane(getTable());
|
gd.getViewport().setBackground(UIColor.getNorth_color());
|
}
|
return gd;
|
}
|
|
public JScrollPane getGd2() {
|
if(gd2==null) {
|
gd2=new JScrollPane(get_text_area());
|
}
|
return gd2;
|
}
|
|
/**»ñÈ¡»ùÕ¾±í¸ñµÄ·½·¨*/
|
public JTable getTable() {
|
if(table==null) {
|
//Ìí¼Ó±í¸ñÁÐÏòÁ¿
|
String[] name1= {"É豸ip","É豸Ãû³Æ","MACµØÖ·","°æ±¾"};//±í¸ñÁÐÃû
|
String[] name2= {"Device ip","device name","MAC address","version"};//±í¸ñÁÐÃû
|
String[] columnNames=English.columnNames(name1, name2);
|
Vector<String> columnName=new Vector<>();
|
for(int i=0;i<columnNames.length;i++){
|
columnName.add(columnNames[i]);
|
}
|
|
|
greateTables tables=new greateTables();
|
|
if(tableModel==null) {
|
tableModel=new DefaultTableModel(rowData, columnName){
|
/**
|
*
|
*/
|
private static final long serialVersionUID = 1L;
|
|
// ʵÏÖÈÃÕû¸ö±í¸ñ²»²»ÔÊÐí±»±à¼
|
public boolean isCellEditable(int row,int column){
|
return false;
|
}
|
};
|
table=tables.getTable(tableModel);
|
//ÉèÖÃÖ»ÄÜÑ¡Öе¥ÐÐ
|
table.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
//¸ø±í¸ñÌí¼Ó¼àÌýʼþ
|
//¸øtable¼ÓÉÏÒ»¸öÊó±êʼþ¼àÌýÆ÷¶ÔÏó
|
table.addMouseListener(new MouseListener() {
|
public void mouseReleased(MouseEvent e) {
|
// TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
|
|
}
|
|
@Override
|
public void mousePressed(MouseEvent e) {
|
// TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
|
|
}
|
|
@Override
|
public void mouseExited(MouseEvent e) {
|
// TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
|
|
}
|
|
@Override
|
public void mouseEntered(MouseEvent e) {
|
// TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
|
|
}
|
|
@Override
|
public void mouseClicked(MouseEvent e) {
|
alertall=false;
|
cleartx();
|
int row=table.getSelectedRow();
|
if(row<0) {
|
ShowMessage.zidingyi("µ±Ç°Ñ¡ÖÐÐÐΪ£º"+row);
|
return;
|
}
|
mac=(String) table.getValueAt(row, 2);
|
ip=(String) table.getValueAt(row, 0);
|
DellS2.reads2peizhi((byte)0x03,mac);
|
|
}
|
});
|
|
}
|
|
}
|
return table;
|
|
}
|
|
|
|
public static JTextArea get_text_area() {
|
if(textArea==null) {
|
textArea=new JTextArea(10,2);
|
textArea.setBackground(Color.white);
|
textArea.setForeground(Color.black);
|
textArea.setFont(ChooseFont.getFont(12));
|
|
}
|
return textArea;
|
}
|
|
|
public JButtonModel getJbt_clear() {
|
|
if(jbt_clear==null) {
|
jbt_clear=new JButtonModel("Çå ¿Õ");
|
jbt_clear.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
textArea.setText("");
|
}
|
});
|
}
|
return jbt_clear;
|
}
|
|
|
|
public static DefaultTableModel getTableModel() {
|
return tableModel;
|
}
|
|
|
public static JTextField getJt_name() {
|
return jt_name;
|
}
|
|
|
public static JTextField getJt_pass() {
|
return jt_pass;
|
}
|
|
|
public static JTextField getJt_shebeiname() {
|
return jt_shebeiname;
|
}
|
|
|
public static JTextField getJt_port() {
|
return jt_port;
|
}
|
|
|
public static JTextField getJt_ip() {
|
return jt_ip;
|
}
|
|
|
public static JTextField getJt_wangguan() {
|
return jt_wangguan;
|
}
|
|
|
public static JTextField getJt_ziwang() {
|
return jt_ziwang;
|
}
|
|
|
public static JTextField getJt_fuwuip() {
|
return jt_fuwuip;
|
}
|
|
|
public static JTextField getJt_MAC() {
|
return jt_MAC;
|
}
|
|
|
public static JTextField getJt_bendiport() {
|
return jt_bendiport;
|
}
|
|
|
public static void setJt_name(JTextField jt_name) {
|
S2Manage.jt_name = jt_name;
|
}
|
|
public void cleartx() {
|
jt_name.setText("");
|
jt_pass.setText("");
|
jt_shebeiname.setText("");
|
jt_bendiport.setText("");
|
jt_port.setText("");
|
jb_xieyi.setSelectedIndex(0);
|
jt_ip.setText("");
|
jt_wangguan.setText("");
|
jt_ziwang.setText("");
|
jt_fuwuip.setText("");
|
jt_MAC.setText("");
|
}
|
|
|
public JButtonModel getJbt_reboot() {
|
if(jbt_reboot==null) {
|
jbt_reboot=new JButtonModel("ÖØ Æô");
|
jbt_reboot.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
if(mac==null) {
|
ShowMessage.zidingyi("ûÓÐÑ¡ÖÐÉ豸");
|
return;
|
}
|
DellS2.reads2peizhi((byte)0x02,mac);
|
|
}
|
});
|
}
|
return jbt_reboot;
|
}
|
|
|
public JButtonModel getJbt_reset() {
|
if(jbt_reset==null) {
|
jbt_reset=new JButtonModel("ÖØ ÖÃ");
|
jbt_reset.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
if(mac==null) {
|
ShowMessage.zidingyi("ûÓÐÑ¡ÖÐÉ豸");
|
return;
|
}
|
// DellS2.reads2peizhi((byte)0x0b,mac);
|
}
|
});
|
}
|
return jbt_reset;
|
}
|
|
|
public JCheckBox getJc_ip() {
|
if(jc_ip==null) {
|
jc_ip=new JCheckBox();
|
jc_ip.setBackground(UIColor.getNorth_color());
|
jc_ip.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
DellS2.getalls2();
|
|
}
|
});
|
}
|
return jc_ip;
|
}
|
|
|
public JCheckBox getJc_wangguan() {
|
if(jc_wangguan==null) {
|
jc_wangguan=new JCheckBox();
|
jc_wangguan.setBackground(UIColor.getNorth_color());
|
jc_wangguan.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
DellS2.getalls2();
|
|
}
|
});
|
}
|
return jc_wangguan;
|
}
|
|
|
public JCheckBox getJc_adress() {
|
if(jc_adress==null) {
|
jc_adress=new JCheckBox();
|
jc_adress.setBackground(UIColor.getNorth_color());
|
jc_adress.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
DellS2.getalls2();
|
|
}
|
});
|
}
|
return jc_adress;
|
}
|
|
|
public JButtonModel getJbt_alertall() {
|
if(jbt_alertall==null) {
|
jbt_alertall=new JButtonModel("È«²¿ÐÞ¸Ä");
|
jbt_alertall.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
|
if(!jc_adress.isSelected() && !jc_wangguan.isSelected() && !jc_ip.isSelected()) {
|
ShowMessage.zidingyi("ÇëÑ¡ÖÐÐèÒªÐ޸ĵÄÄÚÈÝ·½¿òÄÚ´ò¹³£¡");
|
return;
|
}
|
|
alertall=true;
|
|
String ip=jt_ip.getText().trim();
|
String wangguan=jt_wangguan.getText().trim();
|
String adress=jt_fuwuip.getText().trim();
|
ShowMessage.isIpAdress(ip);
|
ShowMessage.isIpAdress(wangguan);
|
String botelv=jt_botelv.getText().trim();
|
|
|
if(!jc_adress.isSelected()) {
|
adress="1";
|
}
|
|
if( !jc_wangguan.isSelected()) {
|
wangguan="1";
|
}
|
|
if(!jc_ip.isSelected()) {
|
ip="1";
|
}
|
|
String port=jt_port.getText().trim();
|
if(!JugeNumber.isDigit(port)) {
|
port="8234";
|
}
|
|
DellS2.alertall_S2(ip, wangguan, adress,port,botelv);
|
}
|
});
|
}
|
return jbt_alertall;
|
}
|
|
|
public static boolean isAlertall() {
|
return alertall;
|
}
|
|
|
public static void setAlertall(boolean alertall) {
|
S2Manage.alertall = alertall;
|
}
|
|
/**ÐÒéÀàÐÍ*/
|
public static JComboBoxModel getJb_xieyi() {
|
if(jb_xieyi==null) {
|
String[] neirong= {"UDP-Client","TCP-Client","TCP-Server","UDP-Server"};
|
jb_xieyi=new JComboBoxModel(neirong);
|
if (Dell_Wifi.getMoren().getXieyitype()==null){
|
return jb_xieyi;
|
}
|
if(Dell_Wifi.getMoren().getXieyitype().equals("UDP")) {
|
jb_xieyi.setSelectedIndex(0);
|
}else {
|
jb_xieyi.setSelectedIndex(1);
|
}
|
}
|
return jb_xieyi;
|
}
|
|
|
public JButtonModel getJbt_openwlan() {
|
if(jbt_openwlan==null) {
|
jbt_openwlan=new JButtonModel(English.name("´ò¿ªÍøÒ³", "Open"));
|
jbt_openwlan.addActionListener(new ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
if(ip==null) {
|
ShowMessage.zidingyi("ûÓÐÑ¡ÖÐÐèÒª´ò¿ªµÄÉ豸£¡");
|
return;
|
}
|
|
try {
|
String url ="http://"+ip;
|
java.net.URI uri = java.net.URI.create(url);
|
// »ñÈ¡µ±Ç°ÏµÍ³×ÀÃæÀ©Õ¹
|
java.awt.Desktop dp = java.awt.Desktop.getDesktop();
|
// ÅжÏϵͳ×ÀÃæÊÇ·ñÖ§³ÖÒªÖ´ÐеŦÄÜ
|
if (dp.isSupported(java.awt.Desktop.Action.BROWSE)) {
|
dp.browse(uri);
|
// »ñȡϵͳĬÈÏä¯ÀÀÆ÷´ò¿ªÁ´½Ó
|
}
|
} catch (NullPointerException e1) {
|
// ´ËΪuriΪ¿ÕʱÅ׳öÒì³£
|
e1.printStackTrace();
|
} catch (IOException e1) {
|
// ´ËΪÎÞ·¨»ñȡϵͳĬÈÏä¯ÀÀÆ÷
|
e1.printStackTrace();
|
}
|
}
|
});
|
|
}
|
return jbt_openwlan;
|
}
|
|
|
public static int getCaozuotyep() {
|
return caozuotyep;
|
}
|
|
|
public static void setCaozuotyep(int caozuotyep) {
|
S2Manage.caozuotyep = caozuotyep;
|
}
|
|
|
/**»ñÈ¡»ùÕ¾µÄIDÏÂÀ¿ò*/
|
public JComboBoxModel getBox_anchorid() {
|
if( box_anchorid==null) {
|
box_anchorid=new JComboBoxModel(Anchor_Dell.get_anchorid3());
|
box_anchorid.setFont(new Font("΢ÈíÑźÚ", Font.PLAIN, 12));//ÉèÖÃ×ÖÌå
|
box_anchorid.setEnabled(true);
|
//ÏÂÀ¿ò¿ÉÒÔÊäÈë
|
box_anchorid.setEditable(true);
|
box_anchorid.addActionListener(new ActionListener() {
|
@Override
|
public void actionPerformed(ActionEvent e) {
|
|
anchorid=(String) box_anchorid.getSelectedItem();
|
if(anchorid.equals("ËùÓлùÕ¾")){
|
jf_ancip.setText("255.255.255.255");
|
}else if(anchorid.equals("Ñ¡Ôñ»ùÕ¾")){
|
jf_ancip.setText("255.255.255.255");
|
}else{
|
String ip=Anchor_Dell.get_anchor(anchorid).getAnc_ip();
|
if(ip ==null) {
|
jf_ancip.setText("");
|
return;
|
}else {
|
jf_ancip.setText(ip);
|
}
|
|
}
|
}
|
});
|
}
|
return box_anchorid;
|
}
|
|
|
public static JTextField getJt_botelv() {
|
return jt_botelv;
|
}
|
|
|
|
/**Ìí¼ÓÎı¾*/
|
public static void addmesg(String message) {
|
textArea.append(GetNowTime.HH_MM_SS()+":"+message+"/n");
|
textArea.setCaretPosition(textArea.getText().length());
|
}
|
}
|