Package devplugin

Examples of devplugin.Program


          for (int j = 0; j < programCount; j++) {
            if (j == 0 && today.getProgramAt(j).getStartTime() > IOUtilities.getMinutesAfterMidnight()) {
              ChannelDayProgram yesterday = TvDataBase.getInstance().getDayProgram(currentDate.addDays(-1), channel);

              if (yesterday != null && yesterday.getProgramCount() > 0) {
                Program p = yesterday.getProgramAt(yesterday.getProgramCount() - 1);

                if (p.isOnAir()) {
                  addToNowRunning(p, programs, additional);
                  Program p1 = today.getProgramAt(0);
                  addToNext(p1, nextPrograms, nextAdditionalPrograms);
                  break;
                }
              }
            }

            Program p = today.getProgramAt(j);

            if (p.isOnAir()) {
              addToNowRunning(p, programs, additional);
              Program nextProgram = null;
              if (j < programCount - 1) {
                nextProgram = today.getProgramAt(j + 1);
              } else {
                ChannelDayProgram tomorrow = TvDataBase.getInstance().getDayProgram(currentDate.addDays(1), channel);
                if (tomorrow != null && tomorrow.getProgramCount() > 0) {
View Full Code Here


        }

        int count = 0;

        while (it != null && it.hasNext()) {
          Program p = it.next();

          int start = p.getStartTime();
          int end = p.getStartTime() + p.getLength();

          if (start <= time && time < end && MainFrame.getInstance().getProgramFilter().accept(p)) {
            programs.add(new ProgramMenuItem(p, ProgramMenuItem.ON_TIME_TYPE, time, -1));
            if (p.getMarkerArr().length > 0
                && p.getMarkPriority() >= Settings.propTrayImportantProgramsPriority.getInt()) {
              additional.add(new ProgramMenuItem(p, ProgramMenuItem.ON_TIME_TYPE, time, -1));
            }
          } else if (start > time && day == 1 && count == 0) {

            int temptime = time + 24 * 60;
            try {
              ChannelDayProgram dayProg = TvDataBase.getInstance().getDayProgram(currentDate, ch);
              p = dayProg.getProgramAt(dayProg.getProgramCount() - 1);

              start = p.getStartTime();
              end = p.getStartTime() + p.getLength();

              if (start <= temptime && temptime < end && MainFrame.getInstance().getProgramFilter().accept(p)) {
                programs.add(new ProgramMenuItem(p, ProgramMenuItem.ON_TIME_TYPE, time, -1));
                if (p.getMarkerArr().length > 0
                    && p.getMarkPriority() >= Settings.propTrayImportantProgramsPriority.getInt()) {
                  additional.add(new ProgramMenuItem(p, ProgramMenuItem.ON_TIME_TYPE, time, -1));
                }
              }
            } catch (Exception ee) {
            }
View Full Code Here

      int rowCount = model.getRowCount(col);
    for (int row = 0; row < rowCount; row++) {
        ProgramPanel panel = model.getProgramPanel(col, row);
       
        if(panel.getProgram().getLength() > 0) {
          Program p = panel.getProgram();
          float scale = ((float)(panel.getMinimumHeight())) / p.getLength();
         
          if(scale > scaleValue && minLength >= p.getLength()) {
            scaleValue = scale;
            minLength = p.getLength();
          }
        }
      }
    }
   
    for (int col = 0; col < columnCount; col++) {
      int rowCount = model.getRowCount(col);
    for (int row = 0; row < rowCount; row++) {
        ProgramPanel panel = model.getProgramPanel(col, row);
        Program program = panel.getProgram();
       
        if (row == 0) {
          if(model.getDate().compareTo(program.getDate()) < 0) {
            columnStartArr[col] = (int)((program.getStartTime() + 24 * 60)* scaleValue);
          }
          else {
            columnStartArr[col] = (int)(program.getStartTime() * scaleValue);
          }
        }
       
        if(row != rowCount - 1) {
          Program next = model.getProgramPanel(col, row + 1).getProgram();
          int startTime = program.getStartTime();
          int endTime = next.getStartTime();
          if (endTime < startTime) {
            // The program ends the next day
            endTime += 24 * 60;
          }
         
View Full Code Here

      int y = layout.getColumnStart(col);
      int rowCount = model.getRowCount(col);
      for (int row = 0; row < rowCount; row++) {
        ProgramPanel panel = model.getProgramPanel(col, row);
        if (panel != null) {
          Program prog = panel.getProgram();
          int startTime = prog.getStartTime();
          if (!mainDate.equals(prog.getDate())) {
            startTime += 24 * 60;
          }

          // Go to the block of this program
          int blockIndex = startTime / (mBlockSize * 60);
 
View Full Code Here

        break;
      }
      Iterator<Program> it=cdp.getPrograms();
      if (it!=null) {
        while (it.hasNext()) {
          Program prog=it.next();
          int progTime=prog.getStartTime();
          Date progDate = prog.getDate();
          // program starts before given end time
          if (compareDateTime(progDate, progTime, toDate, toMinutes) <= 0) {
            // program starts after or at given end time
            if (compareDateTime(progDate, progTime, fromDate, fromMinutes) >= 0)  {
              if (filterAccepts(prog)) {
                ProgramPanel panel = new ProgramPanel(prog);
                mProgramColumn[col].add(panel);
              }
            }
            else {
              // add the last program _before_ the day start time which is still running afterwards
              if (mProgramColumn[col].isEmpty()) {
                if (compareDateTime(progDate, progTime + prog.getLength(), fromDate, fromMinutes) > 0) {
                  if (filterAccepts(prog)) {
                    ProgramPanel panel = new ProgramPanel(prog);
                    mProgramColumn[col].add(panel);
                  }
                }
View Full Code Here

  private void deregisterFromPrograms(ArrayList<ProgramPanel>[] columns) {
    for (ArrayList<ProgramPanel> list : columns) {
      Iterator<ProgramPanel> it=list.iterator();
      while (it.hasNext()) {
        ProgramPanel panel = it.next();
        Program prog = panel.getProgram();
        prog.removeChangeListener(this);
      }
    }
  }
View Full Code Here

  private void registerAtPrograms(ArrayList<ProgramPanel>[] columns) {
    for (ArrayList<ProgramPanel> list : columns) {
      Iterator<ProgramPanel> it=list.iterator();
      while (it.hasNext()) {
        ProgramPanel panel = it.next();
        Program prog = panel.getProgram();
        prog.addChangeListener(this);
      }
    }
  }
View Full Code Here

   *
   * @param evt The change event.
   */
  public void stateChanged(ChangeEvent evt) {
    // A program has changed -> fire the event
    final Program program = (Program) evt.getSource();
    SwingUtilities.invokeLater(new Runnable() {
      public void run() {
        fireProgramHasChanged(program);
      }
    });
View Full Code Here

        if (version >= 5) {
          comment = in.readUTF();
        }
        Date programDate = Date.readData(in);
        String programId = (String) in.readObject();
        Program program = Plugin.getPluginManager().getProgram(programDate,
                programId);

        int referenceCount = 1;

        if (version >= 4) {
View Full Code Here

  public void removeExpiredItems() {
    ArrayList<ReminderListItem> localItems = (ArrayList<ReminderListItem>) mList
            .clone();
    for (ReminderListItem item : localItems) {
      final Program program = item.getProgram();
      if (program == null || program.isExpired() || !ChannelList.isSubscribedChannel(program.getChannel())) {
        remove(item);
      }
    }
  }
View Full Code Here

TOP

Related Classes of devplugin.Program

Copyright © 2015 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.