Exemple #1
0
 public override void characterData(CMLStack xpath, char[] ch, int start, int length)
 {
     System.String s = new System.String(ch, start, length).Trim();
     //logger.debug("Start PMP chardata (" + CurrentElement + ") :" + s);
     //logger.debug(" ElTitle: " + elementTitle);
     if (xpath.ToString().EndsWith("string/") && BUILTIN.Equals("spacegroup"))
     {
         System.String sg = "P1";
         // standardize space group names (see Crystal.java)
         if ("P 21 21 21 (1)".Equals(s))
         {
             sg = "P 2_1 2_1 2_1";
         }
         cdo.setObjectProperty("Crystal", "spacegroup", sg);
     }
     else
     {
         if (xpath.ToString().EndsWith("floatArray/") && (elementTitle.Equals("a") || elementTitle.Equals("b") || elementTitle.Equals("c")))
         {
             System.String axis = elementTitle + "-axis";
             cdo.startObject(axis);
             try
             {
                 SupportClass.Tokenizer st = new SupportClass.Tokenizer(s);
                 //logger.debug("Tokens: " + st.Count);
                 if (st.Count > 2)
                 {
                     System.String token = st.NextToken();
                     //logger.debug("FloatArray (Token): " + token);
                     cdo.setObjectProperty(axis, "x", token);
                     token = st.NextToken();
                     //logger.debug("FloatArray (Token): " + token);
                     cdo.setObjectProperty(axis, "y", token);
                     token = st.NextToken();
                     //logger.debug("FloatArray (Token): " + token);
                     cdo.setObjectProperty(axis, "z", token);
                 }
                 else
                 {
                     //logger.debug("PMP Convention error: incorrect number of cell axis fractions!\n");
                 }
             }
             catch (System.Exception e)
             {
                 //UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Throwable.toString' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'"
                 //logger.debug("PMP Convention error: " + e.ToString());
             }
             cdo.endObject(axis);
         }
         else
         {
             base.characterData(xpath, ch, start, length);
         }
     }
     //logger.debug("End PMP chardata");
 }
 public override void characterData(CMLStack xpath, char[] ch, int start, int length)
 {
     System.String s = new System.String(ch, start, length).Trim();
     if (xpath.ToString().EndsWith("string/") && BUILTIN.Equals("stereo"))
     {
         stereoGiven = true;
         if (s.Trim().Equals("W"))
         {
             //logger.debug("CML W stereo found");
             bondStereo.Add("1");
         }
         else if (s.Trim().Equals("H"))
         {
             //logger.debug("CML H stereo found");
             bondStereo.Add("6");
         }
     }
     else
     {
         base.characterData(xpath, ch, start, length);
     }
 }