ludc
2025-01-16 986aa62ed00bee39363bab41b4eeb8259d446efd
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
package com.vci.client.omd.linktype;
 
import java.awt.Dimension;
import java.awt.Toolkit;
 
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
 
import com.vci.client.common.providers.ServiceProvider;
import com.vci.client.omd.attribpool.ui.APClient;
import com.vci.client.ui.exception.VCIException;
import com.vci.client.ui.frame.UIConstructorInterface;
import com.vci.corba.common.VCIError;
import com.vci.corba.omd.ltm.LinkTypeServicePrx;
 
@SuppressWarnings("all") 
public class LinkTypeStart implements UIConstructorInterface{
    private static LinkTypeServicePrx linkTypeService = null;
    private static LinkTypeStart linkTypeStart = null;
    
    private static LinkTypeStart getInstance(){
        if(linkTypeStart == null){
            linkTypeStart = new LinkTypeStart();
        }
        return linkTypeStart;
    }
 
    /**
     * @param args
     */
//    public static void main(String[] args){
//        Dimension d=Toolkit.getDefaultToolkit().getScreenSize();
//        JFrame.setDefaultLookAndFeelDecorated(true);
//        JFrame jframe = new JFrame("链接类型管理");
//        jframe.setSize(d.width, d.height);
////        jframe.setBounds(d.width/4, d.height/4, d.width/2, d.height/3*2);
//        LinkTypeUI link = null;
//        try {
//            link = (LinkTypeUI) LinkTypeStart.getInstance().start();
//        } catch (VCIError e2) {
//            // TODO Auto-generated catch block
//            e2.printStackTrace();
//        }
//        if(link == null){
//            JOptionPane.showMessageDialog(null, "初始Panel失败", "初始Panel失败", JOptionPane.WARNING_MESSAGE);
//        }
//        jframe.add(link);
//        jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//        jframe.setVisible(true);
//        
//        String apContent = null;
//        
//        try {
//            apContent = APClient.getService().getAPData();
//        } catch (VCIError e) {
//            // TODO Auto-generated catch block
//            e.printStackTrace();
//        }
//        
//        String ltContent = null;
//        try {
//            ltContent = LinkTypeStart.getService().getLTData();
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//        //生成DDL 虽然每次改变业务类型都应该重写生成的DDL, 但考虑到此DDL文件只是留作记录
//        //频繁重写会影响整体性能, 所以在退出程序时重新DDL
//        DDLToolClient.getService().generatorODDLForLt(apContent, ltContent);
//        DDLToolClient.getService().generatorSDDLForLt(apContent, ltContent);
//    }
 
 
    @Override
    public void destory() throws VCIError{
        // TODO Auto-generated method stub
        
    }
 
    @Override
    public void init() throws VCIError {
        if(linkTypeService != null){
            return;
        }
        try {
            linkTypeService = ServiceProvider.getOMDService().getLinkTypeService();
        } catch (Exception e) {
            throw new VCIError("", new String[0]);
        }
        
    }
 
    @Override
    public JPanel start() throws VCIError {
        LinkTypeUI.cleanInstance();
        LinkTypeUI link = LinkTypeUI.getInstance();
        return link;
    }
    
    public static LinkTypeServicePrx getService(){
        if(linkTypeService == null){
            try {
                LinkTypeStart.getInstance().init();
            } catch (VCIError e) {
                e.printStackTrace();
            }
        }
        return linkTypeService;
    }
}