Package org.jmol.io

Class JmolUtil


  • public class JmolUtil
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      JmolUtil()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private boolean clearAndCachePngjFile​(FileManager fm, java.lang.String[] data)  
      java.lang.Object getAtomSetCollectionOrBufferedReaderFromZip​(Viewer vwr, java.io.InputStream is, java.lang.String fileName, java.lang.String[] zipDirectory, java.util.Map<java.lang.String,​java.lang.Object> htParams, int subFilePtr, boolean asBufferedReader)
      A rather complicated means of reading a ZIP file, which could be a single file, or it could be a manifest-organized file, or it could be a Spartan directory.
      byte[] getCachedPngjBytes​(FileManager fm, java.lang.String pathName)  
      java.lang.Object getImage​(Viewer vwr, java.lang.Object fullPathNameOrBytes, java.lang.String echoName, boolean forceSync)  
      private java.lang.String[] getSpartanSubfiles​(java.lang.String[] zipDirectory)
      Called to see if we have a zipped up Mac directory.
      private boolean isSpartanZip​(java.lang.String[] zipDirectory)
      check for a Spartan directory.
      private java.lang.String shortSceneFilename​(java.lang.String pathName)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JmolUtil

        public JmolUtil()
    • Method Detail

      • getImage

        public java.lang.Object getImage​(Viewer vwr,
                                         java.lang.Object fullPathNameOrBytes,
                                         java.lang.String echoName,
                                         boolean forceSync)
      • getAtomSetCollectionOrBufferedReaderFromZip

        public java.lang.Object getAtomSetCollectionOrBufferedReaderFromZip​(Viewer vwr,
                                                                            java.io.InputStream is,
                                                                            java.lang.String fileName,
                                                                            java.lang.String[] zipDirectory,
                                                                            java.util.Map<java.lang.String,​java.lang.Object> htParams,
                                                                            int subFilePtr,
                                                                            boolean asBufferedReader)
        A rather complicated means of reading a ZIP file, which could be a single file, or it could be a manifest-organized file, or it could be a Spartan directory.
        Parameters:
        vwr -
        is -
        fileName -
        zipDirectory -
        htParams -
        subFilePtr -
        asBufferedReader -
        Returns:
        a single atomSetCollection
      • getCachedPngjBytes

        public byte[] getCachedPngjBytes​(FileManager fm,
                                         java.lang.String pathName)
      • clearAndCachePngjFile

        private boolean clearAndCachePngjFile​(FileManager fm,
                                              java.lang.String[] data)
      • shortSceneFilename

        private java.lang.String shortSceneFilename​(java.lang.String pathName)
      • getSpartanSubfiles

        private java.lang.String[] getSpartanSubfiles​(java.lang.String[] zipDirectory)
        Called to see if we have a zipped up Mac directory. Assignment can be made if (1) there is only one file in the collection and (2) that file is "xxxx.spardir/" Note that __MACOS files are ignored by the ZIP file reader.
        Parameters:
        zipDirectory -
        Returns:
        subFileList
      • isSpartanZip

        private boolean isSpartanZip​(java.lang.String[] zipDirectory)
        check for a Spartan directory. This is not entirely satisfying, because we aren't reading the file in the proper sequence. this code is a hack that should be replaced with the sort of code running in FileManager now. 0 entry is not used here, as it is the root directory
        Parameters:
        zipDirectory -
        Returns:
        true if a zipped-up Spartan directory