Package devplugin

Examples of devplugin.PluginTreeNode


    mRootNode.addAction(null);
    mRootNode.addAction(openSettings);
    mRootNode.removeAllChildren();
    mRootNode.getMutableTreeNode().setShowLeafCountEnabled(false);

    PluginTreeNode topicNode = mRootNode.addNode(Localizer.getLocalization(Localizer.I18N_PROGRAMS));
    topicNode.setGroupingByDateEnabled(false);
    PluginTreeNode dateNode = mRootNode.addNode(mLocalizer.msg("days", "Days"));
    dateNode.setGroupingByDateEnabled(true);

    ArrayList<Program> allPrograms = new ArrayList<Program>(1000);
    FavoriteTreeModel.getInstance().updatePluginTree(topicNode, allPrograms);
    HashSet<Program> allProgramsSet = new HashSet<Program>(allPrograms);
    for (Program program : allProgramsSet) {
      dateNode.addProgramWithoutCheck(program);
    }

    mRootNode.update();
    ReminderPlugin.getInstance().updateRootNode(mHasRightToSave);
View Full Code Here


   */
  public Plugin() {
    SettingsKeys.setSettings(getSettings());
    for (int i = rankNode.length - 1; i >= 0; i--) {
      String title = Integer.toString(i + 1) + "+";
      rankNode[i] = new PluginTreeNode(title);
      rankNode[i].setGroupingByDateEnabled(false);
      rootNode.add(rankNode[i]);
    }
    logoIcon = ImageUtilities.createImageIconFromJar("de/kunysch/localimdb/localimdb.png", getClass());
  }
View Full Code Here

  public PluginTreeNode getRootNode() {
    return rootNode;
  }

  private void updatePluginTree() {
    PluginTreeNode root = getRootNode();
    Channel[] channels = devplugin.Plugin.getPluginManager().getSubscribedChannels();
    if (null == channels) {
      return;
    }
    // iterate over all programs to find programs with ratings
    Date day = getPluginManager().getCurrentDate();
    HashMap<Program, ArrayList<Movie>> programs = new HashMap<Program, ArrayList<Movie>>();
    final int startOfDay = getPluginManager().getTvBrowserSettings().getProgramTableStartOfDay();
    final int endOfDay = getPluginManager().getTvBrowserSettings().getProgramTableEndOfDay();
    for (Channel channel : channels) {
      if (isChannelHidden(channel)) {
        continue;
      }
      // show only today and tomorrow
      for (int dayOffset = 0; dayOffset < 2; dayOffset++) {
        Iterator<Program> iter = devplugin.Plugin.getPluginManager().getChannelDayProgram(day.addDays(dayOffset),
            channel);
        if (iter != null) {
          try {
            while (iter.hasNext()) {
              Program prog = iter.next();
              if (dayOffset == 0 && prog.getTimeField(ProgramFieldType.START_TIME_TYPE) < startOfDay) {
                continue;
              }
              if (dayOffset == 1 && prog.getTimeField(ProgramFieldType.START_TIME_TYPE) > endOfDay) {
                continue;
              }
              Set<Movie>[] movies = findMovies(prog);
              if (null != movies) {
                ArrayList<Movie> list = new ArrayList<Movie>();
                if (movies[0] != null) {
                  list.addAll(movies[0]);
                }
                if (movies[1] != null) {
                  list.addAll(movies[1]);
                }
                if (list.size() > 0) {
                  programs.put(prog, list);
                }
              }
            }
          } catch (NullPointerException e) {
          }
        }
      }
    }
    // show programs under sub nodes with rating from 1+ to 9+
    for (Program program : programs.keySet()) {
      ArrayList<Movie> movies = programs.get(program);
      for (Movie movie : movies) {
        int index = movie.getRank() / 10 - 1;
        if (index == rankNode.length) {
          index = rankNode.length - 1;
        }
        addPluginTreeNode(rankNode[index], movie, program);
      }
    }
    root.update();
  }
View Full Code Here

    // otherwise all programs get marked automatically
    if (parent.contains(program, false)) {
      return;
    }
    ProgramItem item = new ProgramItem(program);
    PluginTreeNode node = new PluginTreeNode(item);
    parent.add(node);
  }
View Full Code Here

TOP

Related Classes of devplugin.PluginTreeNode

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.