public override System.Object openBufferedReader(System.String name, System.IO.StreamReader bufferedReader) { try { System.Object atomSetCollectionOrErrorMessage = Resolver.resolve(name, bufferedReader); if (atomSetCollectionOrErrorMessage is System.String) { return(atomSetCollectionOrErrorMessage); } if (atomSetCollectionOrErrorMessage is AtomSetCollection) { AtomSetCollection atomSetCollection = (AtomSetCollection)atomSetCollectionOrErrorMessage; if (atomSetCollection.errorMessage != null) { return(atomSetCollection.errorMessage); } return(atomSetCollection); } return("unknown reader error"); } catch (System.Exception e) { //SupportClass.WriteStackTrace(e, Console.Error); //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'" return("" + e); } }
public BondIterator(AtomSetCollection atomSetCollection) { this.atomSetCollection = atomSetCollection; atoms = atomSetCollection.atoms; bonds = atomSetCollection.bonds; ibond = 0; }
internal StructureIterator(SmarterJmolAdapter enclosingInstance, AtomSetCollection atomSetCollection) { InitBlock(enclosingInstance); structureCount = atomSetCollection.structureCount; structures = atomSetCollection.structures; istructure = 0; }
internal BondIterator(SmarterJmolAdapter enclosingInstance, AtomSetCollection atomSetCollection) { InitBlock(enclosingInstance); this.atomSetCollection = atomSetCollection; atoms = atomSetCollection.atoms; bonds = atomSetCollection.bonds; ibond = 0; }
internal static System.Object resolve(System.String name, System.IO.StreamReader bufferedReader) { AtomSetCollectionReader atomSetCollectionReader; System.String atomSetCollectionReaderName = determineAtomSetCollectionReader(bufferedReader); //logger.log("The Resolver thinks", atomSetCollectionReaderName); System.String className = "org.jmol.adapter.smarter." + atomSetCollectionReaderName + "Reader"; if (atomSetCollectionReaderName == null) { return("unrecognized file format"); } try { //UPGRADE_TODO: The differences in the format of parameters for method 'java.lang.Class.forName' may cause compilation errors. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1092'" System.Type atomSetCollectionReaderClass = System.Type.GetType(className); atomSetCollectionReader = (AtomSetCollectionReader)System.Activator.CreateInstance(atomSetCollectionReaderClass); } catch (System.Exception e) { System.String err = "Could not instantiate:" + className; //logger.log(err); return(err); } //atomSetCollectionReader.Logger = //logger; atomSetCollectionReader.initialize(); AtomSetCollection atomSetCollection = atomSetCollectionReader.readAtomSetCollection(bufferedReader); atomSetCollection.freeze(); if (atomSetCollection.errorMessage != null) { return(atomSetCollection.errorMessage); } if (atomSetCollection.atomCount == 0) { return("No atoms in file"); } return(atomSetCollection); }
public StructureIterator(AtomSetCollection atomSetCollection) { structureCount = atomSetCollection.structureCount; structures = atomSetCollection.structures; istructure = 0; }
public AtomIterator(AtomSetCollection atomSetCollection) { this.atomSetCollection = atomSetCollection; iatom = 0; }
public override JmolAdapter.StructureIterator getStructureIterator(System.Object clientFile) { AtomSetCollection atomSetCollection = (AtomSetCollection)clientFile; return(atomSetCollection.structureCount == 0 ? null : new StructureIterator(atomSetCollection)); }