Esempio n. 1
0
  void addImage() {
    ArrayList<String> fileList = new ArrayList<String>();
    for (String file : peer.getOriginalFiles()) {
      if (false == peer.modifiedFileExists(file)) {
        if (ZipManager.isImage(file)) {
          fileList.add(file);
        }
      }
    }
    for (String file : peer.getModifiedFileNames()) {
      if (ZipManager.isImage(file)) {
        fileList.add(file);
      }
    }
    Object[] files = fileList.toArray();
    String s =
        (String)
            JOptionPane.showInputDialog(
                null,
                "File to use:",
                "New Photo",
                JOptionPane.PLAIN_MESSAGE,
                null,
                files,
                files[0]);

    if ((s != null) && (s.length() > 0)) {
      getCurrentExhibit().addPhoto(new ExhibitPhoto(s, null));
      exhibitPhotosModel.notifyChange();
      peer.makeChange();
    }
  }
Esempio n. 2
0
 private String[] getAllContentList() {
   ArrayList<String> list = new ArrayList<String>();
   for (String s : peer.getOriginalFiles()) {
     if (false == peer.modifiedFileExists(s)) {
       if (ZipManager.isImage(s) == false) {
         list.add(s);
       }
     }
   }
   for (String s : peer.getModifiedFileNames()) {
     if (ZipManager.isImage(s) == false) {
       list.add(s);
     }
   }
   return list.toArray(new String[0]);
 }