コード例 #1
0
 @Override
 public void mouseClicked(MouseEvent arg0) {
   int col = tableFiles.columnAtPoint(arg0.getPoint());
   if (col == 0) {
     int row = tableFiles.rowAtPoint(arg0.getPoint());
     row = tableFiles.convertRowIndexToModel(row);
     MediaFile mf = mediaFileEventList.get(row);
     // open the video file in the desired player
     if (mf.isVideo()) {
       try {
         TmmUIHelper.openFile(mf.getFile());
       } catch (Exception e) {
         LOGGER.error("open file", e);
         MessageManager.instance.pushMessage(
             new Message(
                 MessageLevel.ERROR,
                 mf,
                 "message.erroropenfile",
                 new String[] {":", e.getLocalizedMessage()}));
       }
     }
     // open the graphic in the lightbox
     if (mf.isGraphic()) {
       MainWindow.getActiveInstance()
           .createLightbox(mf.getPath() + File.separator + mf.getFilename(), "");
     }
   }
 }
コード例 #2
0
  @Override
  public void actionPerformed(ActionEvent e) {
    List<Movie> selectedMovies =
        new ArrayList<Movie>(MovieUIModule.getInstance().getSelectionModel().getSelectedMovies());

    if (selectedMovies.size() > 0) {
      MovieScrapeMetadataDialog dialog =
          new MovieScrapeMetadataDialog(BUNDLE.getString("movie.scrape.metadata")); // $NON-NLS-1$
      dialog.setLocationRelativeTo(MainWindow.getActiveInstance());
      dialog.setVisible(true);
      // get options from dialog
      MovieSearchAndScrapeOptions options = dialog.getMovieSearchAndScrapeConfig();
      // do we want to scrape?
      if (dialog.shouldStartScrape()) {
        // scrape
        TmmThreadPool scrapeTask = new MovieScrapeTask(selectedMovies, false, options);
        if (TmmTaskManager.getInstance().addMainTask(scrapeTask)) {
          JOptionPane.showMessageDialog(null, BUNDLE.getString("onlyoneoperation")); // $NON-NLS-1$
        }
      }
    }
  }