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;
|
}
|
}
|