Package devplugin

Examples of devplugin.Program


    }
    Date currentDate = getPluginManager().getCurrentDate();
    final Channel[] channels = getPluginManager().getSubscribedChannels();
    for (Channel channel : channels) {
      for (Iterator<Program> iter = getPluginManager().getChannelDayProgram(currentDate, channel); iter.hasNext();) {
        Program prog = iter.next();
        if (getRating(prog) != null) {
          prog.validateMarking();
        }
      }
    }
  }
View Full Code Here


    Channel[] channels = Plugin.getPluginManager().getSubscribedChannels();
    Date date = Date.getCurrentDate();
    for (int d = 0; d < 31; d++) {
      for (Channel channel : channels) {
        for (Iterator<Program> it = Plugin.getPluginManager().getChannelDayProgram(date, channel); it.hasNext();) {
          Program program = it.next();
          if (program != null) {
            String title = program.getTitle();
            if (title != null) {
              HashSet<PluginTreeNode> nodes = titles.get(title);
              if (nodes != null) {
                for (PluginTreeNode titleNode : nodes) {
                  titleNode.addProgramWithoutCheck(program);
                }
              }
            }
          }
        }
      }
      date = date.addDays(1);
    }

    // now add the title nodes to the plugin tree
    PluginTreeNode topOverall = mRootNode.addNode(mLocalizer.msg("topOverall", "Top programs"));
    PluginTreeNode topAction = mRootNode.addNode(mLocalizer.msg("topAction", "Top action"));
    PluginTreeNode topFun = mRootNode.addNode(mLocalizer.msg("topFun", "Top fun"));
    PluginTreeNode topErotic = mRootNode.addNode(mLocalizer.msg("topErotic", "Top erotic"));
    PluginTreeNode topTension = mRootNode.addNode(mLocalizer.msg("topTension", "Top tension"));
    PluginTreeNode topEntitlement = mRootNode.addNode(mLocalizer.msg("topEntitlement", "Top entitlement"));
    addList(topOverall, listOverall);
    addList(topAction, listAction);
    addList(topFun, listFun);
    addList(topErotic, listErotic);
    addList(topTension, listTension);
    addList(topEntitlement, listEntitlement);

    // add unrated favorites
    PluginTreeNode favoritesNode = mRootNode.addNode(mLocalizer.msg(
        "unratedFavorites", "Unrated favorites"));
    favoritesNode.setGroupingByDateEnabled(false);
    Program[] programs = getPluginManager().getMarkedPrograms();

    // search all unrated favorites
    List<Program> unratedFavs = new ArrayList<Program>();
    for (Program program : programs) {
      if (program.isExpired()) {
        Marker[] markers = program.getMarkerArr();
        for (Marker marker : markers) {
          if (marker.getId()
              .equalsIgnoreCase(FAVORITES_PLUGIN_ID)) {
            if (getPersonalRating(program) == null) {
              unratedFavs.add(program);
View Full Code Here

              mProgramSelectionChanging = true;
             
              Program[] progs = ((ProgramList)e.getSource()).getSelectedPrograms();
             
              if(progs != null) {
                Program prog = progs[progs.length-1];
               
                Calendar c = Calendar.getInstance();
               
                c.setTimeInMillis(prog.getDate().getCalendar().getTimeInMillis());
                c.set(Calendar.HOUR_OF_DAY, prog.getHours());
                c.set(Calendar.MINUTE, prog.getMinutes());
 
                if (prog.getLength() <= 0) {
                  c.add(Calendar.MINUTE, 1);
                } else {
                  c.add(Calendar.MINUTE, prog.getLength());
                }
                c.set(Calendar.SECOND, 0);
               
                c.add(Calendar.MINUTE, postTime);
               
View Full Code Here

    Channel programChannel = p.getChannel();
   
    Iterator<Program> channelDayProgram = Plugin.getPluginManager().getChannelDayProgram(programDate,programChannel);
   
    while(channelDayProgram.hasNext() && model.size() <= additionalProgramCount) {
      Program prog = channelDayProgram.next();
     
      if((prog.equals(p) || (!model.isEmpty() && model.size() <= additionalProgramCount)) /*&& prog.getLength() > 0*/) {
        model.addElement(prog);
      }
    }
   
    if(model.size() <= additionalProgramCount) {
      programDate = programDate.addDays(1);
      channelDayProgram = Plugin.getPluginManager().getChannelDayProgram(programDate, programChannel);
     
      if(channelDayProgram != null) {
        while(channelDayProgram.hasNext() && model.size() <= additionalProgramCount) {
          Program prog = channelDayProgram.next();
          if(model.size() <= additionalProgramCount && prog.getLength() > 0) {
            model.addElement(prog);
          }
        }
      }
    }
View Full Code Here

      Iterator<Program> channelDayProgram = Plugin.getPluginManager().getChannelDayProgram(programDate, programChannel);
     
      boolean found = false;
     
      while(channelDayProgram != null && channelDayProgram.hasNext()) {
        Program prog = channelDayProgram.next();

        if(prog.equals(mProgram)) {
          found = true;
        }
        else if(found && prog.getStartTime() >= startTime && (prog.getStartTime() + prog.getLength()) <= endTime) {
          additionalPrograms.add(prog);
        }
        else if(found) {
          break;
        }
      }
     
      if(endTime > 60 * 24) {
        if(programDate.getDayOfMonth() == day) {
          programDate = programDate.addDays(1);
         
          channelDayProgram = Plugin.getPluginManager().getChannelDayProgram(programDate, programChannel);
         
          endTime -= 60 * 24;
         
          while(channelDayProgram != null && channelDayProgram.hasNext()) {
            Program prog = channelDayProgram.next();
           
            if((prog.getStartTime() + prog.getLength()) <= endTime) {
              additionalPrograms.add(prog);
            }
            else {
              break;
            }
View Full Code Here

   */
  public void setEndDate(java.util.Date endDate) {
    int lastSelectedIndex = 0;
   
    for(int i = 1; i < mProgramList.getModel().getSize(); i++) {
      Program prog = (Program)mProgramList.getModel().getElementAt(i);
     
      Calendar progDate = prog.getDate().getCalendar();
      progDate.set(Calendar.HOUR_OF_DAY, prog.getHours());
      progDate.set(Calendar.MINUTE, prog.getMinutes());
     
      if (prog.getLength() <= 0) {
        progDate.add(Calendar.MINUTE, 1);
      } else {
        progDate.add(Calendar.MINUTE, prog.getLength());
      }
      progDate.set(Calendar.SECOND, 0);
     
      if(progDate.getTime().compareTo(endDate) <= 0) {
        lastSelectedIndex = i;
View Full Code Here

    Date end = (Date) in.readObject();

    String id = (String) in.readObject();
    devplugin.Date date = devplugin.Date.readData(in);

    Program aktP = Plugin.getPluginManager().getProgram(date, id);
    if (aktP != null) {
      mProgram = aktP;
    }

    setStart(start);
    setEnd(end);

    if (version > 1) {
      setTitle((String) in.readObject());
    }
   
    if(version >= 3) {
      if(in.readBoolean()) {
        int n = in.readInt();
       
        ArrayList<Program> tempList = new ArrayList<Program>();
       
        for(int i = 0; i < n; i++) {
          id = in.readUTF();
          devplugin.Date programDate = devplugin.Date.readData(in);
         
          Program prog = Plugin.getPluginManager().getProgram(programDate, id);
         
          if(prog != null) {
            tempList.add(prog);
          }
        }
View Full Code Here

          for (Program program : sameTitlePrograms) {
            if (titleNode != null) {
              PluginTreeNode prog = titleNode.addProgram(program);
              prog.setNodeFormatter(new NodeFormatter() {
                public String format(ProgramItem pitem) {
                  Program p = pitem.getProgram();
                  Date progDate = p.getDate();
                  String progDateText;

                  if (progDate.equals(currentDate.addDays(-1))) {
                    progDateText = Localizer
                        .getLocalization(Localizer.I18N_YESTERDAY);
                  } else if (progDate.equals(currentDate)) {
                    progDateText = Localizer.getLocalization(Localizer.I18N_TODAY);
                  } else if (progDate.equals(currentDate.addDays(1))) {
                    progDateText = Localizer.getLocalization(Localizer.I18N_TOMORROW);
                  } else {
                    progDateText = p.getDateString();
                  }

                  return (progDateText + "  " + p.getTimeString() + "  " + p
                      .getChannel());
                }
              });
            }
            if (settings.isGroupingByBoth()) {
View Full Code Here

    }
  }

  protected void revalidateContainingPrograms(ArrayList<Program> deletedPrograms) {
    for (int i = size() - 1; i >= 0; i--) {
      Program markedProgram = remove(i);
      switch (markedProgram.getProgramState()) {
      case Program.WAS_UPDATED_STATE:
        Program updatedProg = Plugin.getPluginManager().getProgram(markedProgram.getDate(), markedProgram.getID());
        addElement(updatedProg);
        break;
      case Program.IS_VALID_STATE:
        addElement(markedProgram);
        break;
View Full Code Here

  }

  private void updateTable() {
    mProgram.clear();
    for (int i = 0; i < size(); i++) {
      Program p = elementAt(i);
      if (p == null) {
        continue;
      }
      if (!mProgram.containsKey(p.getTitle())) {
        LinkedList<Program> list1 = new LinkedList<Program>();
        mProgram.put(p.getTitle(), list1);
        list1.addFirst(p);
      } else {
        LinkedList<Program> list1 = mProgram.get(p.getTitle());
        list1.addLast(p);
      }
    }
  }
View Full Code Here

TOP

Related Classes of devplugin.Program

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.