Package devplugin

Examples of devplugin.Date


   * @param minutesAfterMidnight
   * @return
   */
  private int getTimeYOfColumn(int col, int minutesAfterMidnight) {
    int timeY = mLayout.getColumnStart(col);
    Date mainDate = mModel.getDate();

    int lastPanelHeight = 0;
    int rowCount = mModel.getRowCount(col);
    for (int row = 0; row < rowCount; row++) {
      ProgramPanel panel = mModel.getProgramPanel(col, row);
View Full Code Here


    mGotoChannelMenu.setEnabled(channels.length > 0);
  }

  public void updateDateItems() {
    mGotoDateMenu.removeAll();
    Date curDate = new Date();
    Date maxDate = TvDataBase.getInstance().getMaxSupportedDate();
    while (maxDate.getNumberOfDaysSince(curDate) >= 0) {
      if (!TvDataBase.getInstance().dataAvailable(curDate)) {
        break;
      }
      if (curDate.isFirstDayOfWeek() && mGotoDateMenu.getItemCount() > 0) {
        mGotoDateMenu.addSeparator();
View Full Code Here

      ArrayList<ProgramMenuItem> nextAdditionalPrograms = new ArrayList<ProgramMenuItem>();

      /*
       * Search through all channels.
       */
      Date currentDate = Date.getCurrentDate();
      for (Channel channel : channels) {
        ChannelDayProgram today = TvDataBase.getInstance().getDayProgram(currentDate, channel);

        if (today != null && today.getProgramCount() > 0) {
          final int programCount = today.getProgramCount();
          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) {
                  nextProgram = tomorrow.getProgramAt(0);
                }
              }
              if (nextProgram != null) {
View Full Code Here

      Channel[] c = getTrayChannels();

      ArrayList<ProgramMenuItem> programs = new ArrayList<ProgramMenuItem>();
      ArrayList<ProgramMenuItem> additional = new ArrayList<ProgramMenuItem>();

      Date currentDate = Date.getCurrentDate();
      for (Channel ch : c) {
        Iterator<Program> it = null;
        int day = 0;

        try {
          it = TvDataBase.getInstance().getDayProgram(
              currentDate.addDays((time < IOUtilities.getMinutesAfterMidnight() ? ++day : day)), ch).getPrograms();
        } catch (Exception ee) {
        }

        int count = 0;
View Full Code Here

    // we need to check all the time from midnight to end of day because the filters may include
    // programs before the beginOfDay time
    int blockSize = Settings.propTimeBlockSize.getInt() * 60;
    int blockCount = ((Settings.propProgramTableEndOfDay.getInt() + 24 * 60) / blockSize) +1;
   
    Date nextProgramTableDate = model.getDate().addDays(1);

    // calculate the height of each block independently
    for(int block = 0; block <  blockCount; block++) {
      int maxHeight = 0;
      Arrays.fill(minimumBlockHeight,0);
View Full Code Here

    for (int i = 0; i < blockCount; i++) {
      blocks[i] = new TimeBlock(i * mBlockSize * 60);
    }

    // Go through the model and find the block borders
    Date mainDate = ((DefaultProgramTableModel) model).getDate();
    int columnCount = model.getColumnCount();
    for (int col = 0; col < columnCount; col++) {
      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

    mListenerList = new ArrayList<ProgramTableModelListener>();
    mTodayEarliestTime=todayEarliestTime;
    mTomorrowLatestTime=tomorrowLatestTime;


    mMainDay = new Date();

    setChannels(channelArr);


    mTimer = new Timer(10000, new ActionListener() {
View Full Code Here

      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)) {
View Full Code Here

    if (monitor != null) {
      monitor.setMaximum(mChannelArr.length - 1);
      monitor.setValue(0);
    }

    Date nextDay = mMainDay.addDays(1);
    for (int i = 0; i < mChannelArr.length; i++) {
      mProgramColumn[i].clear();
      DateRange dateRange = mDateRangeForChannel.get(mChannelArr[i]);
      ChannelDayProgram[] cdp = new ChannelDayProgram[dateRange.getCount()];
View Full Code Here

        int reminderMinutes = in.readInt();
        String comment = null;
        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;
View Full Code Here

TOP

Related Classes of devplugin.Date

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.