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
package LedShow;
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import ColorAndFont.UIColor;
import DrawJPG.ImageIOHandler;
import Method.JButtonImage;
import PbuliClass.Leds;
import PbuliClass.jinternalFrame;
 
public class LEDPreview extends jinternalFrame {
 
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    JLabel lable=null;
    JButton shuaxin=null;
    JPanel mb=null;
 
    //³õʼ»¯
    public static void chushi() {
        ImageIOHandler image = new ImageIOHandler();
        File file=new File("image/mapfile/led.png");
        ImageIOHandler.writeImage(image.bi, image.picType, file);
        image = null;
        file=null;
    }
 
    public LEDPreview() {
        chushi();
        this.setTitle("ͶÆÁÔ¤ÀÀ");
        Container rq=getContentPane();//»ñÈ¡ÈÝÆ÷
        rq.setLayout(new BorderLayout());
        rq.setBackground(UIColor.getNorth_color());
        rq.add(getMb() ,BorderLayout.CENTER);
        this.setFrameIcon(new ImageIcon("image/icon/LED.png"));//ÉèÖô°Ìåͼ±ê
    }
 
 
    public JLabel getLable() {
        if(lable==null) {            
            lable=new JLabel(new ImageIcon("image/mapfile/led.png"));
            
        }
        return lable;
    }
 
    public JButton getShuaxin() {
        if(shuaxin==null) {
            shuaxin=JButtonImage.JButton_image("image/mapfile/led.png", "LEDÆÁĻԤÀÀ");
            shuaxin.setSize(Integer.parseInt(Leds.get_tb_led().getLed_w()), Integer.parseInt(Leds.get_tb_led().getLed_h()));
            shuaxin.setLocation(200, 50);            
            shuaxin.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    chushi();
                    ImageIcon images = new ImageIcon("image/mapfile/led.png");
                    images.getImage().flush();
                    shuaxin.setIcon(images);
                    
                }
            });
        }
        return shuaxin;
    }
 
    public JPanel getMb() {
        if(mb==null) {
            mb=new JPanel();
            mb.setBackground(UIColor.getNorth_color());
            mb.setLayout(null);
            mb.add(getShuaxin());
        }
        return mb;
    }
 
 
}