示例#1
0
 /**
  * Sets the file annotation data.
  *
  * @param data The value to set.
  */
 void setFileAnnotationData(FileAnnotationData data) {
   fileAnnotation = data;
   if (data == null) {
     fileID = 0;
     fileName = null;
     nameSpace = null;
     return;
   }
   this.fileID = data.getFileID();
   this.fileName = data.getFileName();
   nameSpace = data.getNameSpace();
 }
示例#2
0
 /**
  * Downloads the file.
  *
  * @see EditorLoader#cancel()
  */
 public void load() {
   if (data != null) {
     OriginalFile f = ((FileAnnotation) data.asAnnotation()).getFile();
     if (f.isLoaded()) {
       handle = mhView.loadFile(file, f.getId().getValue(), f.getSize().getValue(), this);
     }
   } else {
     Entry entry;
     Iterator i = files.entrySet().iterator();
     FileAnnotationData fa;
     filesMap = new HashMap<FileAnnotationData, File>(files.size());
     File f;
     // int index = 0;
     String dir = MetadataViewerAgent.getTmpDir();
     while (i.hasNext()) {
       entry = (Entry) i.next();
       fa = (FileAnnotationData) entry.getKey();
       f = new File(dir + File.separator + fa.getFileID() + "_" + fa.getFileName());
       f.deleteOnExit();
       filesMap.put(fa, f);
     }
     handle = mhView.loadFiles(filesMap, this);
   }
 }