Ejemplo 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();
    }
  }
Ejemplo n.º 2
0
 void editFile() {
   String[] keys = peer.getModifiedFileNames();
   File f = peer.getModifiedFile(keys[modifiedFilesList.getSelectedIndex()]);
   String[] exec = {"cmd.exe", "/C", f.getPath()};
   try {
     Runtime.getRuntime().exec(exec);
   } catch (IOException e) {
     e.printStackTrace();
   }
 }
Ejemplo n.º 3
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]);
 }