zsh_root
2024-01-02 7b595546af704983dbafcd0d385c8768ddacefc2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
package Frame;
 
import ColorAndFont.English;
import ColorAndFont.NothJPanel;
import ColorAndFont.UIColor;
import ColorAndFont.buttonTitle;
import DataBase.DatabaseManagement;
import PbuliClass.*;
import tbDataModel_Dell.Dell_hispower;
import tbDataModel_Dell.LineXy;
 
import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumn;
import java.awt.*;
import java.awt.event.*;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;
 
public class AcPowerManage extends jinternalFrame {
 
    private static final long serialVersionUID = 1L;
 
    JPanel inJpanel = null;//ÄÚ²¿Ãæ°å
    NothJPanel northJpanel = null;//±±²¿Ãæ°å
    JPanel centerJpanel = null;//Öв¿Ãæ°å
    JButtonModel jbut;//°´Å¥Ä£ÐÍ
    JTextField searchFileld = null;//ËÑË÷Îı¾¿ò
    JButtonModel search = null;//ËÑË÷°´Å¥
    JButtonModel shuaxin = null;//ˢа´Å¥
    JButtonModel delete = null;//ɾ³ý°´Å¥
    JButtonModel deleteAll = null;//È«²¿É¾³ý°´Å¥
    JTable table = null;//ÉêÃ÷±í¸ñ
    Vector<Vector<String>> rowData = null;
    DefaultTableModel tableModel = null;//±í¸ñÄ£ÐÍ
    @SuppressWarnings("rawtypes")
    List list;
    Container rq;
    JScrollPane gd = null;
    JButtonModel firstPageButton = null;
    JButtonModel latePageButton = null;
    JButtonModel nextPageButton = null;
    JButtonModel lastPageButton = null;
    JButtonModel open = null;//´ò¿ª
    int maxPageNumber;
    Dialog dialog = null;
    static int currentPageNumber = 1;//µ±Ç°Ò³Ãæ
    int allrows;//Êý¾Ý×ÜÌõÊý
    NothJPanel south = null;
    JlableModel nowpage;//µ±Ç°Ò³Âë
    String serch;
    int k;
    String a;
    int selectedRow;//±»Ñ¡ÖеÄÐÐ
    JTextField hang = null;
    String tagid = null;
 
    public AcPowerManage() {
        String title = "ÀúÊ·µçÁ¿";
        if (Systems.sys().getLanguage().equals("English")) {
            title = "Anchor Historical battery";
        }
        this.setTitle(title);
        this.setFrameIcon(new ImageIcon("image/icon/historypowericon.png"));//ÉèÖô°Ìåͼ±ê
        rowData = new Vector<>();
        rq = getContentPane();//»ñÈ¡ÈÝÆ÷
        rq.setLayout(new BorderLayout());
        rq.setBackground(Color.white);
        rq.add(getNorthJpanel(), BorderLayout.NORTH);
        rq.add(getGd(), BorderLayout.CENTER);
        rq.add(getSouth(), BorderLayout.SOUTH);
        getMaxPageNumber();
 
    }
 
    /**
     * »ñÈ¡±±²¿Ãæ°å
     */
    public NothJPanel getNorthJpanel() {
        if (northJpanel == null) {
            northJpanel = new NothJPanel();
            Box topicBox = Box.createHorizontalBox();// ´´½¨Ò»¸öˮƽÏäÈÝÆ÷
            topicBox.add(getSearchFileld());//Ìí¼ÓËÑË÷Îı¾¿ò
            topicBox.add(Box.createHorizontalStrut(3));// Ìí¼ÓÒ»¸ö3ÏñËØ¿íµÄˮƽ֧Öù
            topicBox.add(getSearch());//Ìí¼ÓËÑË÷°´Å¥
            topicBox.add(Box.createHorizontalStrut(10));// Ìí¼ÓÒ»¸ö5ÏñËØ¿íµÄˮƽ֧Öù
            topicBox.add(getShuaxin());//Ìí¼Óˢа´Å¥
            topicBox.add(Box.createHorizontalStrut(10));// Ìí¼ÓÒ»¸ö5ÏñËØ¿íµÄˮƽ֧Öù
            topicBox.add(getDelete());//Ìí¼Óɾ³ý°´Å¥
            topicBox.add(Box.createHorizontalStrut(10));// Ìí¼ÓÒ»¸ö5ÏñËØ¿íµÄˮƽ֧Öù
            topicBox.add(getDeleteAll());//Ìí¼Óɾ³ýÈ«²¿°´Å¥
            topicBox.add(Box.createHorizontalStrut(10));// Ìí¼ÓÒ»¸ö5ÏñËØ¿íµÄˮƽ֧Öù
            topicBox.add(getOutport());//Ìí¼Óµ¼³ö°´Å¥
            topicBox.add(Box.createHorizontalStrut(10));// Ìí¼ÓÒ»¸ö5ÏñËØ¿íµÄˮƽ֧Öù
            topicBox.add(getOpen());
            northJpanel.add(topicBox);
        }
        return northJpanel;
    }
 
    /**
     * »ñÈ¡Äϲ¿Ãæ°åµÄ·½·¨
     */
    public NothJPanel getSouth() {
        if (south == null) {
            south = new NothJPanel();
            Box topicBox = Box.createHorizontalBox();// ´´½¨Ò»¸öˮƽÏäÈÝÆ÷
            topicBox.add(getFirstPageButton());//Ìí¼ÓËÑË÷Îı¾¿ò
            topicBox.add(Box.createHorizontalStrut(15));// Ìí¼ÓÒ»¸ö3ÏñËØ¿íµÄˮƽ֧Öù
            topicBox.add(getLatePageButton());//Ìí¼ÓËÑË÷°´Å¥
            topicBox.add(Box.createHorizontalStrut(15));// Ìí¼ÓÒ»¸ö5ÏñËØ¿íµÄˮƽ֧Öù
            topicBox.add(getNextPageButton());//Ìí¼Óˢа´Å¥
            topicBox.add(Box.createHorizontalStrut(15));// Ìí¼ÓÒ»¸ö5ÏñËØ¿íµÄˮƽ֧Öù
            topicBox.add(getLastPageButton());//Ìí¼Óɾ³ý°´Å¥
            nowpage = new JlableModel("µÚ" + currentPageNumber + "Ò³");
            topicBox.add(Box.createHorizontalStrut(25));// Ìí¼ÓÒ»¸ö15ÏñËØ¿íµÄˮƽ֧Öù
            topicBox.add(nowpage);
            south.add(topicBox);
        }
        return south;
    }
 
    public JButtonModel getFirstPageButton() {
        if (firstPageButton == null) {
            firstPageButton = new JButtonModel(buttonTitle.getHome());
            firstPageButton.setEnabled(false);
            firstPageButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    currentPageNumber = 1;
                    nowpage.setText("µÚ" + currentPageNumber + "Ò³");
                    lastPageButton.setEnabled(true);
                    nextPageButton.setEnabled(true);
                    k = Integer.parseInt(getHang().getText());
                    serch = "select * from tb_ac_history_power limit 0," + k;
                    updateSerch(serch);
                    currentPageNumber = 1;
                    firstPageButton.setEnabled(false);
                    latePageButton.setEnabled(false);
                }
            });
        }
        return firstPageButton;
    }
 
    public JButtonModel getLatePageButton() {
        if (latePageButton == null) {
            latePageButton = new JButtonModel(buttonTitle.getPrevious());
            latePageButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    lastPageButton.setEnabled(true);
                    latePageButton.setEnabled(true);
                    --currentPageNumber;
                    nowpage.setText("µÚ" + currentPageNumber + "Ò³");
                    if (currentPageNumber == 1) {
                        latePageButton.setEnabled(false);
                        firstPageButton.setEnabled(false);
                    }
                    if (currentPageNumber >= 1) {
                        k = Integer.parseInt(getHang().getText().trim());
                        a = String.valueOf(currentPageNumber * k - k);
                        serch = "select * from tb_ac_history_power limit " + a + "," + k;
                        updateSerch(serch);
                        nextPageButton.setEnabled(true);
                    }
                }
            });
        }
        return latePageButton;
    }
 
    public JButtonModel getNextPageButton() {
        if (nextPageButton == null) {
            nextPageButton = new JButtonModel(buttonTitle.getNext());
            nextPageButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    ++currentPageNumber;
                    nowpage.setText("µÚ" + currentPageNumber + "Ò³");
                    k = Integer.parseInt(getHang().getText().trim());
                    a = String.valueOf(currentPageNumber * k - k);
                    serch = "select * from tb_ac_history_power limit " + a + "," + k;
                    updateSerch(serch);
                    if (currentPageNumber != 1) {
                        firstPageButton.setEnabled(true);
                        latePageButton.setEnabled(true);
                    }
                    if (currentPageNumber == maxPageNumber) {
                        nextPageButton.setEnabled(false);
                        lastPageButton.setEnabled(false);
                    }
 
 
                }
            });
        }
        return nextPageButton;
    }
 
    public JButtonModel getLastPageButton() {
        if (lastPageButton == null) {
            lastPageButton = new JButtonModel(buttonTitle.getLast());
            lastPageButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    nextPageButton.setEnabled(false);
                    lastPageButton.setEnabled(false);
                    k = Integer.parseInt(getHang().getText().trim());
                    a = String.valueOf(getMaxPageNumber() * k - k);
                    serch = "select * from tb_ac_history_power limit " + a + "," + k;
                    updateSerch(serch);
                    latePageButton.setEnabled(true);
                    firstPageButton.setEnabled(true);
                    currentPageNumber = getMaxPageNumber();
                    nowpage.setText("µÚ" + currentPageNumber + "Ò³");
 
                }
            });
 
        }
        return lastPageButton;
    }
 
 
    /**
     * Ã¿Ò³ÏÔʾÐÐÊý
     */
    public JTextField getHang() {
        if (hang == null) {
            hang = new JTextField(5);
            hang.setText("200");
 
        }
        return hang;
 
    }
 
 
    public int getMaxPageNumber() {
        String sql = "select * from tb_ac_history_power order by id desc";
        allrows = DatabaseManagement.serch(sql).size();
        double k = Integer.parseInt(getHang().getText().trim());
        double j = allrows / k;
        return maxPageNumber = (int) Math.ceil(j);
 
        //Math.ceil() º¯Êý·µ»Ø´óÓÚ»òµÈÓÚÒ»¸ö¸ø¶¨Êý×ÖµÄ×îСÕûÊý
    }
 
 
    /**
     * »ñÈ¡ËÑË÷Îı¾¿òµÄ·½·¨
     */
    public JTextField getSearchFileld() {
        if (searchFileld == null) {
            searchFileld = new JTextField(10);
            searchFileld.addKeyListener(new KeyListener() {    //¼üÅÌʼþ¼àÌý
                public void keyTyped(KeyEvent e) {
                }
 
                public void keyReleased(KeyEvent e) {
                    int keyCode = e.getKeyCode();
                    if (keyCode == KeyEvent.VK_ENTER) {
                        getSearch().doClick();//ËÑË÷°´Å¥±»µã»÷
                    }
                }
 
                public void keyPressed(KeyEvent e) {
                }
            });
        }
        return searchFileld;
    }
 
 
    /**
     * »ñÈ¡ËÑË÷°´Å¥µÄ·½·¨
     */
    public JButtonModel getSearch() {
        if (search == null) {
            search = new JButtonModel(buttonTitle.getSerch());
            search.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    // Ö´ÐÐSQL²éѯÓï¾ä»ñµÃµÄ½á¹û¼¯
                    try {
                        if (getSearchFileld().getText().length() > 1) {
                            String go = searchFileld.getText().trim();
                            String a = "select * from tb_ac_history_power  where anchorId= '" + go + "'  limit 500";
                            updateSerch(a);
                        }
                    } catch (Exception er) {
                        er.printStackTrace();
                    }
                }
            });
        }
        return search;
    }
 
 
    /**
     * »ñȡˢа´Å¥µÄ·½·¨
     */
    public JButtonModel getShuaxin() {
        if (shuaxin == null) {
            shuaxin = new JButtonModel(buttonTitle.getRefresh());
            shuaxin.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    updateTable();
                }
            });
 
        }
        return shuaxin;
    }
 
 
    /**
     * »ñȡɾ³ý°´Å¥µÄ·½·¨
     */
    public JButtonModel getDelete() {
        if (delete == null) {
            delete = new JButtonModel(buttonTitle.getDelete());
            delete.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    int[] selectedRows = table.getSelectedRows();//±»Ñ¡ÖÐÐеÄË÷Òý¼¯ºÏ
                    if (selectedRows.length != 0) {
                        for (int i = 0; i < selectedRows.length; i++) {
                            String deleteSql = "DELETE FROM tb_ac_history_power WHERE id='" + table.getValueAt(selectedRows[i], 0) + "'";
                            DatabaseManagement.update(deleteSql);// É¾³ý±êÇ©ÐÅÏ¢
                        }
 
                        //ɾ³ýËùÓб»Ñ¡ÖеÄÐÐ
                        for (int j = selectedRows.length - 1; j >= 0; j--) {//ÕâÊǹؼü´úÂë
                            tableModel.removeRow(selectedRows[j]);//ɾ³ýÈÎÒⱻѡÖÐÐÐ
                        }
                        table.setModel(tableModel);//¸üбí¸ñÄ£ÐÍ
 
                        //ɾ³ý³É¹¦ÌáʾÐÅÏ¢
                        ShowMessage.delteSuccess(selectedRows.length);
 
                    } else {
                        ShowMessage.zidingyi("ÇëÑ¡ÖÐÐèҪɾ³ýµÄÐУ¡");
                    }
                    updateTable();
                }
            });
        }
        return delete;
    }
 
 
    /**
     * »ñȡȫ²¿É¾³ý°´Å¥µÄ·½·¨
     */
    public JButtonModel getDeleteAll() {
        if (deleteAll == null) {
            deleteAll = new JButtonModel(buttonTitle.getDeleteall());
            deleteAll.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    //Ñ¡Ôñ¶Ô»°¿òÈçyes·µ»Ø0£¬NO·µ»Ø1£¬È¡Ïû·µ»Ø2
                    WarningMessage warning = new WarningMessage();
                    warning.setMessage("Ñ¡Ôñɾ³ýÈ«²¿½«»á°Ñ±í¸ñÊý¾ÝÈ«²¿É¾³ýÈ·¶¨Âð£¿");
                    int warn = warning.getwarMss(getNorthJpanel());
                    int tagnum = table.getRowCount();//±í¸ñ×ÜÐÐÊý
                    if (tagnum != 0 && warn == 0) {
                        String deleteSql = "TRUNCATE TABLE tb_ac_history_power";
                        ShowMessage.deleteAll(DatabaseManagement.update(deleteSql));
                    }
 
                    int a = table.getRowCount();
                    for (int i = 0; i < a; i++) {
                        tableModel.removeRow(0);
                    }
                    rq.repaint();
                }
            });
 
        }
        return deleteAll;
    }
 
 
    /**
     * »ñÈ¡µ¼³ö±í¸ñ°´Å¥µÄ·½·¨
     */
    public JButtonModel getOutport() {
        OutButton.setAddtime("time");
        OutButton.setDataName("tb_ac_history_power");
        return new OutButton().get_ouotport_button();
    }
 
    /**
     * »ñÈ¡¹ö¶¯Ãæ°åµÄ·½·¨
     */
    public JScrollPane getGd() {
        gd = new JScrollPane(getTable());
        gd.getViewport().setBackground(UIColor.getNorth_color());
        return gd;
    }
 
    /**
     * Ìí¼Ó±í¸ñÐÐÏòÁ¿Êý¾Ý·½·¨
     */
    public void getRowData(List<?> list) {
        Iterator<?> iterator = list.iterator();//´´½¨µü´úÆ÷
        while (iterator.hasNext()) {//µü´úÆ÷´æÔÚÔªËØ
            List<?> info = (List<?>) iterator.next();//½«µü´úÆ÷ÀïÃæµÄÔªËØ¸øµ½info¼¯ºÏ
            @SuppressWarnings("rawtypes")
            Vector<Comparable> row = new Vector<Comparable>();
            row.add(String.valueOf(info.get(0)));// ÐòºÅ
            row.add(String.valueOf(info.get(1)));// »ùÕ¾ID
            String power=String.valueOf(info.get(2));
            row.add(power);// »ùÕ¾µçÁ¿
            power=power.replace("%", "");
            row.add(Integer.parseInt(power));// ±êÇ©µçÁ¿
            row.add(String.valueOf(info.get(3)));// ¸üÐÂʱ¼ä
            tableModel.addRow(row);// Ïò±í¸ñ¶ÔÏóÌí¼ÓÐÐÊý¾Ý
        }
 
    }
 
 
    /**
     * »ñÈ¡±êÇ©µçÁ¿±í¸ñµÄ·½·¨
     */
    @SuppressWarnings("serial")
    public JTable getTable() {
        if (table == null) {
            String[] name1 = {"ÐòºÅ", "»ùÕ¾ID", "µçÁ¿(%)", "µçÁ¿×´Ì¬", "ʱ¼ä"};//±í¸ñÁÐÃû
            String[] name2 = {"Serial Number", "Tag ID", "Power(%)", "Power Status", "Time"};//±í¸ñÁÐÃû
            String[] columnNames = English.columnNames(name1, name2);
            //Ìí¼Ó±í¸ñÁÐÏòÁ¿
            Vector<String> columnName = new Vector<>();
            for (int i = 0; i < columnNames.length; i++) {
                columnName.add(columnNames[i]);
            }
 
            String sql = "select * from tb_ac_history_power  order by id desc limit 500 ";
            list = DatabaseManagement.serch(sql);//½«ÁбíÖÐËùÓнá¹û¼¯¸øµ½list¼¯ºÏ
 
            greateTables tables = new greateTables();
            tableModel = new DefaultTableModel(rowData, columnName) {
                //  ÊµÏÖÈÃÕû¸ö±í¸ñ²»²»ÔÊÐí±»±à¼­
                public boolean isCellEditable(int row, int column) {
                    return false;
                }
            };
            table = tables.getTable(tableModel);
            getRowData(list);
            table.getColumnModel().getColumn(3).setPreferredWidth(135);// ÉèÖõÚ3Áпí
            TableColumn column = table.getColumnModel().getColumn(3);// »ñÈ¡±í¸ñµÚ4ÁжÔÏó
            column.setCellRenderer(new TableCellRenderer() {// ÉèÖõÚ4ÁеÄäÖȾÆ÷
                public Component getTableCellRendererComponent(
                        JTable table, Object value, boolean isSelected,
                        boolean hasFocus, int row, int column) {
                    if (value instanceof Integer) {
                        JProgressBar bar = new JProgressBar();//´´½¨½ø¶ÈÌõ
                        Integer percent = (Integer) value;//°Ñµ±Ç°Öµ×ªÎªÕûÊý
                        bar.setValue(percent);//ÉèÖýø¶ÈÌõµÄÖµ
                        //bar.setStringPainted(true);//ÏÔʾ½ø¶ÈÌõÎı¾
                        if (percent <= 15) {
                            bar.setForeground(Color.red);//ÏÔʾ½ø¶ÈÌõµÄÑÕÉ«
                        } else if (percent > 50) {
                            bar.setForeground(Color.green);//ÏÔʾ½ø¶ÈÌõµÄÑÕÉ«
                        } else if (percent <= 50 && percent > 15) {
                            bar.setForeground(Color.yellow);//ÏÔʾ½ø¶ÈÌõµÄÑÕÉ«
                        }
 
                        bar.setBackground(UIColor.getNorth_color());
 
                        bar.setBorderPainted(false);//ÊÇ·ñÏÔʾ½ø¶ÈÌõ±ß¿ò
 
                        if (row % 2 == 0) {
                            bar.setBackground(UIColor.getTable_1());
                        } else {
                            bar.setBackground(UIColor.getTable_2());
                        }
 
                        if (isSelected) {
                            bar.setBackground(UIColor.getTable_sekected());
                        }
                        return bar;// °Ñͼ±ê×÷ΪΪäÖȾ¿Ø¼þ
                    } else {
                        return null;
                    }
                }
            });
 
        }
        return table;
    }
 
 
    /**
     * Ë¢Ð±í¸ñ·½·¨
     */
    public void updateTable() {
 
        if (tableModel != null) {
            tableModel.getDataVector().clear();
            String sql = "select * from tb_ac_history_power  order by id desc limit 500";
            list = DatabaseManagement.serch(sql);
            getRowData(list);
            gd.validate();
        }
    }
 
    /**
     * ËÑË÷·½·¨
     */
    public void updateSerch(String serch) {
        if (tableModel != null) {
            tableModel.getDataVector().clear();
            list = DatabaseManagement.serch(serch);//½«ÁбíÖÐËùÓнá¹û¼¯¸øµ½list¼¯ºÏ
            getRowData(list);
        }
    }
 
 
    public JButtonModel getOpen() {
        if (open == null) {
            open = new JButtonModel(buttonTitle.getAnalysis());
            open.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    Dell_hispower.getHispower_vec().removeAllElements();
                    tagid = searchFileld.getText().trim();
                    if (tagid.length() > 3) {
                        Dell_hispower.insert2(tagid);
                        if (dialog == null) {
                            dialog =new Dialog(tagid + "µçÁ¿");
                        }
                    } else {
                        ShowMessage.zidingyi("ÇëÊäÈëÕýÈ·µÄÉ豸±àºÅ");
                    }
                }
            });
        }
        return open;
 
}
 
    class Dialog extends JDialog implements WindowListener {
 
        /**
         *
         */
        private static final long serialVersionUID = 1L;
 
        /**
         * »ñÈ¡¶Ô»°¿ò·½·¨
         */
        public Dialog(String title) {
            super();
            this.setAlwaysOnTop(true);//×ÜÊÇÖö¥
            this.setTitle(title);
            Toolkit toolkit = getToolkit();// »ñµÃ´°Ì幤¾ß°ü
            Dimension screenSize = toolkit.getScreenSize();// »ñÈ¡ÆÁÄ»´óС
            int width = (int) (screenSize.width * 0.5);// ¼ÆËã´°Ìåпí¶È
            int height = (int) (screenSize.height * 0.5);// ¼ÆËã´°Ìåпí¶È
            int x0 = width - 390;//´°Ìåx0×ø±ê
            int y0 = height - 240;//´°Ìåy0×ø±ê
            Container rq = getContentPane();
            this.setIconImage(new ImageIcon("image/icon/historypowericon.png").getImage());
            this.addWindowListener((WindowListener) this);
            rq.add(new LineXy().getMb(title));
            this.setBounds(x0, y0, 780, 480);
            this.setVisible(true);
        }
 
 
        public void windowOpened(WindowEvent e) {
            // TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
 
        }
 
        @Override
        public void windowClosing(WindowEvent e) {
            // TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
            dialog = null;
 
        }
 
        @Override
        public void windowClosed(WindowEvent e) {
            // TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
 
        }
 
        @Override
        public void windowIconified(WindowEvent e) {
            // TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
 
        }
 
        @Override
        public void windowDeiconified(WindowEvent e) {
            // TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
 
        }
 
        @Override
        public void windowActivated(WindowEvent e) {
            // TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
 
        }
 
        @Override
        public void windowDeactivated(WindowEvent e) {
            // TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
 
        }
    }
}