package com.vci.client.omd.versionrule.util; //package plm.bs.omd.versionrule.client.util; // //import java.util.List; // //import javax.swing.JButton; //import javax.swing.JLabel; //import javax.swing.JOptionPane; //import javax.swing.JPanel; //import javax.swing.JScrollPane; //import javax.swing.JTextArea; //import javax.swing.JTextField; //import javax.swing.JTree; //import javax.swing.tree.DefaultMutableTreeNode; // //import org.dom4j.Document; //import org.dom4j.DocumentHelper; //import org.dom4j.Element; // //import plm.bs.omd.versionrule.client.ClientStart; //import plm.bs.omd.versionrule.client.ui.AttribPanel; //import plm.corba.versionRuleManager.VersionRule; // //import com.vci.corba.common.VCIError; // //public class Algorithm { // // /** // * // */ // @SuppressWarnings("unused") // private static final long serialVersionUID = 1L; // static String no1=null,no2=null,no3=null,no4=null,no5=null,no6=null,no7=null; // @SuppressWarnings("unused") // private static VersionRule versionRule = null; // //定义文本框,用于用户输入数据 // @SuppressWarnings("unused") // private static JTextField jtf1=new JTextField(20), // jtf2=new JTextField(20), // jtf3=new JTextField(20), // jtf4=new JTextField(20), // jtf5=new JTextField(20), // jtf6=new JTextField(20), // jtf7=new JTextField(20); // //定义标签,显示文本框的含义 // @SuppressWarnings("unused") // private JLabel jl1 = new JLabel("名称"), // jl2 = new JLabel("标签"), // jl3 = new JLabel("跳跃字符"), // jl4 = new JLabel("初始值"), // jl5 = new JLabel("步长"), // jl6 = new JLabel("前缀"), // jl7 = new JLabel("后缀"), // jl8 = new JLabel("描述"), // jl11 = new JLabel("名称(不能为空)"), // jl22 = new JLabel("标签(对名称的解释)"), // jl33 = new JLabel("跳跃字符(以逗号分隔)"), // jl44 = new JLabel("初始值(不能为空)"), // jl55 = new JLabel("步长(不能为空)"), // jl66 = new JLabel("前缀(可以为空)"), // jl77 = new JLabel("后缀(可以为空)"), // jl88 = new JLabel("描述(可以为空)"); // //定义文本域,用于书写描述信息 // @SuppressWarnings("unused") // private static JTextArea jta=new JTextArea(3,20); // //定义容器,用于接收需要布局的容器 // @SuppressWarnings("unused") // private static JPanel jp; // //定义主容器 // @SuppressWarnings("unused") // private static AttribPanel attribpanel=null; // //定义按钮 // @SuppressWarnings("unused") // private static JButton addButton,modifyButton,deleteButton,checkButton,saveButton,cancelButton; // //定义小容器用于界面分区的时候使用 // @SuppressWarnings("unused") // private static JPanel northJPanel,westJPanel = new JPanel(),mainJPanel,centerJPanel; // //定义滚动条用于存放tree // @SuppressWarnings("unused") // private static JScrollPane scrollPane = new JScrollPane(); // //定义一棵树 // private static JTree tree; // @SuppressWarnings("unused") // private static String nodeName=null,ssss="",associated=""; // // //初始值与步长相加的算法 // @SuppressWarnings("rawtypes") // public static void arithmetic() throws VCIError{ // String t=""; // String d=""; // String versionrulename=""; // String xmlPath_ = ClientStart.getService().getVersionRulePath(); // String text = ClientStart.getService().readXml(xmlPath_); // Document doc = null; // DefaultMutableTreeNode node=(DefaultMutableTreeNode)tree.getLastSelectedPathComponent(); // if(node!=null&&node.isLeaf()){ // try { // doc = DocumentHelper.parseText(text); // if(doc == null){ // return; // } // Element root = doc.getRootElement(); // List list = root.elements(); // for(int i=0;it.length()){ // realName=name1; // String h=check(realName); // ssss=h; // }else{ // ll=t.length()-name1.length(); // for(int j=0;j'Z'){ // if(s1.charAt(0)!='0'){ // ll=Integer.parseInt(s1)+1; // realName=ll+""+(char)('A'+(y-'Z'-1)); // String h=check(realName); // ssss=h; // } // if(s1.charAt(0)=='0'){ // k:for(int i=0;is1.length()){ // realName=name1+(char)('A'+(y-'Z'-1)); // String h=check(realName); // ssss=h; // }else{ // ll=s1.length()-name1.length(); // for(int j=0;j'Z'){ // if(s1.charAt(0)!='0'){ // ll=Integer.parseInt(t)+1; // realName=ll+""+"A"+(char)('A'+(y-'Z'-1)); // String h=check(realName); // ssss=h; // } // if(s1.charAt(0)=='0'){ // k:for(int i=0;is1.length()){ // realName=name1+"A"+(char)('A'+(y-'Z'-1)); // String h=check(realName); // ssss=h; // }else{ // ll=s1.length()-name1.length(); // for(int j=0;j'z'){ // if(s1.charAt(0)!='0'){ // ll=Integer.parseInt(s1)+1; // realName=ll+""+(char)('a'+y-'z'-1); // String h=check(realName); // ssss=h; // } // if(s1.charAt(0)=='0'){ // k:for(int i=0;is1.length()){ // realName=name1+(char)('a'+y-'z'-1); // String h=check(realName); // ssss=h; // }else{ // ll=s1.length()-name1.length(); // for(int j=0;j'z'){ // if(s1.charAt(0)!='0'){ // ll=Integer.parseInt(t)+1; // realName=ll+""+"a"+(char)('a'+y-'z'-1); // String h=check(realName); // ssss=h; // } // if(s1.charAt(0)=='0'){ // k:for(int i=0;is1.length()){ // realName=name1+"a"+(char)('a'+y-'z'-1); // String h=check(realName); // ssss=h; // }else{ // ll=s1.length()-name1.length(); // for(int j=0;js1.length()){ // if(s.matches("[A-Z]*")){ // if(s.length()==1){ // String sss=""; // int y=s.charAt(0)+1; // if(y<='Z'){ // for(int lll=0;lll'Z'){ // realName="A"+(char)('A'+(y-'Z'-1))+(ll-Integer.parseInt(sss)); // String h=check(realName); // ssss=h; // } // }else if(s.length()==2&&(s.charAt(0)!='Z'&&s.charAt(1)!='Z')){ // String s2=""; // int y=s.charAt(1)+1; // if(y<='Z'){ // for(int llll=0;llll'Z'){ // JOptionPane.showMessageDialog(null,"版本号最高可以为ZZXXX创建失败"); // return; // } // } // } // }else if(s.matches("[a-z]*")){ // if(s.length()==1){ // String sss=""; // int y=s.charAt(0)+1; // if(y<='z'){ // for(int lll=0;lll'z'){ // realName="a"+(char)('a'+(y-'z'-1))+(ll-Integer.parseInt(sss)); // String h=check(realName); // ssss=h; // } // }else if(s.length()==2&&(s.charAt(0)!='z'&&s.charAt(1)!='z')){ // String s2=""; // int y=s.charAt(1)+1; // if(y<='z'){ // for(int llll=0;llll'z'){ // JOptionPane.showMessageDialog(null,"版本号最高可以为zzXXX创建失败"); // return; // } // } // } // } // }else{ // realName=s+ll1; // String h=check(realName); // ssss=h; // } // } // if(s1.charAt(0)=='0'){ // k:for(int i=0;is1.length()){ // if(s.matches("[A-Z]*")){ // if(s.length()==1){ // String sss=""; // int y=s.charAt(0)+1; // if(y<='Z'){ // for(int lll=0;lll'Z'){ // realName="A"+(char)('A'+(y-'Z'-1))+(ll-Integer.parseInt(sss)); // String h=check(realName); // ssss=h; // } // }else if(s.length()==2&&(s.charAt(0)!='Z'&&s.charAt(1)!='Z')){ // String s2=""; // int y=s.charAt(1)+1; // if(y<='Z'){ // for(int llll=0;llll'Z'){ // JOptionPane.showMessageDialog(null,"版本号最高可以为ZZXXX创建失败"); // return; // } // } // } // }else if(s.matches("[a-z]*")){ // if(s.length()==1){ // String sss=""; // int y=s.charAt(0)+1; // if(y<='z'){ // for(int lll=0;lll'z'){ // realName="a"+(char)('a'+(y-'z'-1))+(ll-Integer.parseInt(sss)); // String h=check(realName); // ssss=h; // } // }else if(s.length()==2&&(s.charAt(0)!='z'&&s.charAt(1)!='z')){ // String s2=""; // int y=s.charAt(1)+1; // if(y<='z'){ // for(int llll=0;llll'z'){ // JOptionPane.showMessageDialog(null,"版本号最高可以为ZZXXX创建失败"); // return; // } // } // } // } // }else{ // ll=s1.length()-name1.length(); // for(int j=0;j'Z'){ // JOptionPane.showMessageDialog(null,"版本号最高可以为ZZXXX创建失败"); // return; // } // } // } // }else if(df.matches("[a-z]*")){ // if(df.length()==1){ // y=df.charAt(0)+1; // if(y<='z'){ // realName=(char)(df.charAt(0)+1)+"-"+(ll-10); // String h=check(realName); // ssss=h; // }else{ // realName="a"+(char)('a'+(y-'z'-1))+"-"+(ll-10); // String h=check(realName); // ssss=h; // } // }else if(df.length()==2){ // y=df.charAt(1)+1; // if(y<='z'){ // realName=(char)df.charAt(0)+""+(char)(df.charAt(1)+1)+"-"+(ll-10); // String h=check(realName); // ssss=h; // }else{ // int tt=df.charAt(0)+1; // if(tt<='z'){ // realName=(char)(df.charAt(0)+1)+""+(char)('a'+(y-'z'-1))+"-"+(ll-10); // String h=check(realName); // ssss=h; // }else if(tt>'z'){ // JOptionPane.showMessageDialog(null,"版本号最高可以为zzXXX创建失败"); // return; // } // } // } // }else if(df.matches("[0-9]*")){ // if(df.charAt(0)!='0'){ // realName=Integer.parseInt(df)+1+"-"+(ll-10); // String h=check(realName); // ssss=h; // }else if(df.charAt(0)=='0'){ // k:for(int i=0;i'Z'){ // JOptionPane.showMessageDialog(null,"版本号最高可以为ZZXXX创建失败"); // return; // } // } // } // }else if(df.matches("[a-z]*")){ // if(df.length()==1){ // y=df.charAt(0)+1; // if(y<='z'){ // realName=(char)(df.charAt(0)+1)+"-0"+(ll-100); // String h=check(realName); // ssss=h; // }else{ // realName="a"+(char)('a'+(y-'z'-1))+"-0"+(ll-100); // String h=check(realName); // ssss=h; // } // }else if(df.length()==2){ // y=df.charAt(1)+1; // if(y<='z'){ // realName=df.charAt(0)+""+(char)(df.charAt(1)+1)+"-0"+(ll-100); // String h=check(realName); // ssss=h; // }else{ // int tt=df.charAt(0)+1; // if(tt<='z'){ // realName=(char)(df.charAt(0)+1)+""+(char)('a'+(y-'z'-1))+"-0"+(ll-100); // String h=check(realName); // ssss=h; // }else if(tt>'z'){ // JOptionPane.showMessageDialog(null,"版本号最高可以为zzXXX创建失败"); // return; // } // } // } // }else if(df.matches("[0-9]*")){ // if(df.charAt(0)!='0'){ // realName=Integer.parseInt(df)+1+"-0"+(ll-100); // String h=check(realName); // ssss=h; // }else if(df.charAt(0)=='0'){ // k:for(int i=0;idf1.length()){ // String sss=""; // for(int lll=0;lll'Z'){ // JOptionPane.showMessageDialog(null,"版本号最高可以为ZZXXX创建失败"); // return; // } // } // } // }else if(df.matches("[a-z]*")){ // if(df.length()==1){ // y=df.charAt(0)+1; // if(y<='z'){ // realName=(char)(df.charAt(0)+1)+"-"+(ll-Integer.parseInt(sss)); // String h=check(realName); // ssss=h; // }else{ // realName="a"+(char)('a'+(y-'z'-1))+"-"+(ll-Integer.parseInt(sss)); // String h=check(realName); // ssss=h; // } // }else if(df.length()==2){ // y=df.charAt(1)+1; // if(y<='z'){ // realName=df.charAt(0)+""+(char)(df.charAt(1)+1)+"-"+(ll-Integer.parseInt(sss)); // String h=check(realName); // ssss=h; // }else{ // int tt=df.charAt(0)+1; // if(tt<='z'){ // realName=(char)(df.charAt(0)+1)+""+(char)('a'+(y-'z'-1))+"-"+(ll-Integer.parseInt(sss)); // String h=check(realName); // ssss=h; // }else if(tt>'z'){ // JOptionPane.showMessageDialog(null,"版本号最高可以为zzXXX创建失败"); // return; // } // } // } // }else if(df.matches("[0-9]*")){ // if(df.charAt(0)!='0'){ // realName=Integer.parseInt(df)+1+"-"+(ll-Integer.parseInt(sss)); // String h=check(realName); // ssss=h; // }else if(df.charAt(0)=='0'){ // k:for(int i=0;i'Z'){ // JOptionPane.showMessageDialog(null,"版本号最高可以为ZZXXX创建失败"); // return; // } // } // } // }else if(df.matches("[a-z]*")){ // if(df.length()==1){ // y=df.charAt(0)+1; // if(y<='z'){ // realName=(char)(df.charAt(0)+1)+"-"+(char)('A'+(ll-'Z'-1)); // String h=check(realName); // ssss=h; // }else{ // realName="a"+(char)('a'+(y-'z'-1))+"-"+(char)('A'+(ll-'Z'-1)); // String h=check(realName); // ssss=h; // } // }else if(df.length()==2){ // y=df.charAt(1)+1; // if(y<='z'){ // realName=df.charAt(0)+""+(char)(df.charAt(1)+1)+"-"+(char)('A'+(ll-'Z'-1)); // String h=check(realName); // ssss=h; // }else{ // int tt=df.charAt(0)+1; // if(tt<='z'){ // realName=(char)(df.charAt(0)+1)+""+(char)('a'+(y-'z'-1))+"-"+(char)('A'+(ll-'Z'-1)); // String h=check(realName); // ssss=h; // }else if(tt>'z'){ // JOptionPane.showMessageDialog(null,"版本号最高可以为zzXXX创建失败"); // return; // } // } // } // }else if(df.matches("[0-9]*")){ // if(df.charAt(0)!='0'){ // realName=Integer.parseInt(df)+1+"-"+(char)('A'+(ll-'Z'-1)); // String h=check(realName); // ssss=h; // }else if(df.charAt(0)=='0'){ // k:for(int i=0;i'Z'){ // JOptionPane.showMessageDialog(null,"版本号最高可以为ZZXXX创建失败"); // return; // } // } // } // }else if(df.matches("[a-z]*")){ // if(df.length()==1){ // y=df.charAt(0)+1; // if(y<='z'){ // realName=(char)(df.charAt(0)+1)+"-"+"A"+(char)('A'+(ll2-'Z'-1)); // String h=check(realName); // ssss=h; // }else{ // realName="a"+(char)('a'+(y-'z'-1))+"-"+"A"+(char)('A'+(ll2-'Z'-1)); // String h=check(realName); // ssss=h; // } // }else if(df.length()==2){ // y=df.charAt(1)+1; // if(y<='z'){ // realName=df.charAt(0)+""+(char)(df.charAt(1)+1)+"-"+"A"+(char)('A'+(ll2-'Z'-1)); // String h=check(realName); // ssss=h; // }else{ // int tt=df.charAt(0)+1; // if(tt<='z'){ // realName=(char)(df.charAt(0)+1)+""+(char)('a'+(y-'z'-1))+"-"+"A"+(char)('A'+(ll2-'Z'-1)); // String h=check(realName); // ssss=h; // }else if(tt>'z'){ // JOptionPane.showMessageDialog(null,"版本号最高可以为zzXXX创建失败"); // return; // } // } // } // }else if(df.matches("[0-9]*")){ // if(df.charAt(0)!='0'){ // realName=Integer.parseInt(df)+1+"-"+"A"+(char)('A'+(ll2-'Z'-1)); // String h=check(realName); // ssss=h; // }else if(df.charAt(0)=='0'){ // k:for(int i=0;i'Z'){ // JOptionPane.showMessageDialog(null,"版本号最高可以为ZZXXX创建失败"); // return; // } // } // } // }else if(df.matches("[a-z]*")){ // if(df.length()==1){ // y=df.charAt(0)+1; // if(y<='z'){ // realName=(char)(df.charAt(0)+1)+"-"+(char)('a'+(ll-'z'-1)); // String h=check(realName); // ssss=h; // }else{ // realName="a"+(char)('a'+(y-'z'-1))+"-"+(char)('a'+(ll-'z'-1)); // String h=check(realName); // ssss=h; // } // }else if(df.length()==2){ // y=df.charAt(1)+1; // if(y<='z'){ // realName=df.charAt(0)+""+(char)(df.charAt(1)+1)+"-"+(char)('a'+(ll-'z'-1)); // String h=check(realName); // ssss=h; // }else{ // int tt=df.charAt(0)+1; // if(tt<='z'){ // realName=(char)(df.charAt(0)+1)+""+(char)('a'+(y-'z'-1))+"-"+(char)('a'+(ll-'z'-1)); // String h=check(realName); // ssss=h; // }else if(tt>'z'){ // JOptionPane.showMessageDialog(null,"版本号最高可以为zzXXX创建失败"); // return; // } // } // } // }else if(df.matches("[0-9]*")){ // if(df.charAt(0)!='0'){ // realName=Integer.parseInt(df)+1+"-"+(char)('a'+(ll-'z'-1)); // String h=check(realName); // ssss=h; // }else if(df.charAt(0)=='0'){ // k:for(int i=0;i'Z'){ // JOptionPane.showMessageDialog(null,"版本号最高可以为ZZXXX创建失败"); // return; // } // } // } // }else if(df.matches("[a-z]*")){ // if(df.length()==1){ // y=df.charAt(0)+1; // if(y<='z'){ // realName=(char)(df.charAt(0)+1)+"-"+"a"+(char)('a'+(ll2-'z'-1)); // String h=check(realName); // ssss=h; // }else{ // realName="a"+(char)('a'+(y-'z'-1))+"-"+"a"+(char)('a'+(ll2-'z'-1)); // String h=check(realName); // ssss=h; // } // }else if(df.length()==2){ // y=df.charAt(1)+1; // if(y<='z'){ // realName=df.charAt(0)+""+(char)(df.charAt(1)+1)+"-"+"a"+(char)('a'+(ll2-'z'-1)); // String h=check(realName); // ssss=h; // }else{ // int tt=df.charAt(0)+1; // if(tt<='z'){ // realName=(char)(df.charAt(0)+1)+""+(char)('a'+(y-'z'-1))+"-"+"a"+(char)('a'+(ll2-'z'-1)); // String h=check(realName); // ssss=h; // }else if(tt>'z'){ // JOptionPane.showMessageDialog(null,"版本号最高可以为zzXXX创建失败"); // return; // } // } // } // }else if(df.matches("[0-9]*")){ // if(df.charAt(0)!='0'){ // realName=Integer.parseInt(df)+1+"-"+"a"+(char)('a'+(ll2-'z'-1)); // String h=check(realName); // ssss=h; // }else if(df.charAt(0)=='0'){ // k:for(int i=0;i1){ // String[] st = arg1.split(","); // for(int i=0;i