Package net.sourceforge.seriesdownloader.model

Examples of net.sourceforge.seriesdownloader.model.Show


  private boolean attemptAdd(PageHelper helper) {
    String name = params.get("add");
    if (Util.isEmpty(name))
      return false;
   
    Show newShow = new Show(name);
    boolean added = WatchListController.addShow(newShow);
   
    if (added)
      helper.getBody().addElement("h3").setText(name + " added.");
    else
View Full Code Here


  private boolean edited() {
    // Update episode information.
    int editId = Util.parseInt(params.get("edit"), -1);
    if (editId != -1) {
      Show show = WatchListController.findShowByTVRageId(editId);
      if (!Util.isEmpty(params.get("episode"))) {
        String episode = params.get("episode");
        show.setNextEpisode(new Episode(episode, "Unknown"));
        show.setNextAirDate(null);
        new ShowInfoFinder(show).start();
      }
      return true;
    }
    return false;
View Full Code Here

 
  private boolean deleted() {
    // Delete show from list.
    int deleteId = Util.parseInt(params.get("delete"), -1);
    if (deleteId != -1) {
      Show show = WatchListController.findShowByTVRageId(deleteId);
      WatchListController.removeShow(show);
      return true;
    }
    return false;
  }
View Full Code Here

        , Util.nonNullString(show.getNextEpisode()) };
  }

  public static class TableModel extends DefaultTableModel {
    public void setValueAt(Object value, int row, int column) {
      Show changed = (Show) getValueAt(row, 0);
      switch (column) {
        case 0:
          changed.setLabel((String) value);
          break;
        case 1:
          changed.getNextEpisode().setName((String) value);
          break;
        case 2:
          changed.setNextAirDate(Util.parseDate(value));
          break;
        case 3:
          changed.setNextAirDate(null);
          changed.setNextEpisode(new Episode((String) value, null));
          break;
      }
      new ShowInfoFinder(changed).start();

      if (column != 0)
View Full Code Here

      for (Show show : data)
        model.addRow(WatchListController.getRowData(show));
    } else {
      for (int i = 0; i < table.getRowCount(); i++) {
        Show show = (Show) table.getValueAt(i, 0);
        Object[] values = WatchListController.getRowData(show);
        for (int j = 1; j < values.length; j++)
          ((TableModel) table.getModel()).setValueAtClean(values[j], i, j);
      }
    }
View Full Code Here

   
    Document doc = DocumentHelper.parseText(source);
    List<Element> nodes = doc.selectNodes("//show");
    for (Element node : nodes)
    {
      Show show = new Show(node.elementText("name"));
      show.setTvrageUrl(node.elementText("link"));
      show.setTvrageId(Util.parseInt(node.elementText("showid"), -1));
      shows.add(show);
    }
   
    return shows;
  }
View Full Code Here

    } else if (e.getSource() == downloadNow) {
      DownloadTrigger.trigger((Show) target.getValueAt(lastClickedRow, 0), false);
    } else if (e.getSource() == openBrowser) {
      Util.openURL(((Show) target.getValueAt(lastClickedRow, 0)).getTvrageUrl());
    } else if (e.getSource() == renewInfo) {
      Show show = (Show) target.getValueAt(lastClickedRow, 0);
      show.setNextEpisode(null);
      new ShowInfoFinder(show).start();
    } else if (e.getSource() == updateAll) {
      ShowUpdater.updateAllShows();
    }
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.seriesdownloader.model.Show

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.