Package util.ui

Examples of util.ui.ProgramPanel


      int y = mLayout.getColumnStart(col);

      int rowCount = mModel.getRowCount(col);
      for (int row = 0; row < rowCount; row++) {
        // Get the program
        ProgramPanel panel = mModel.getProgramPanel(col, row);

        // Render the program
        if (panel != null) {
          int cellHeight = panel.getHeight();

          // Check whether the cell is within the clipping area
          if (((y + cellHeight) > clipBounds.y)
              && (y < (clipBounds.y + clipBounds.height))) {

            Rectangle rec = new Rectangle(x, y, mColumnWidth, cellHeight);
            if (Settings.propProgramTableMouseOver.getBoolean()) {
              if ((mMouse != null) && (rec.contains(mMouse))) {
                mouseOver = true;
              } else {
                mouseOver = false;
              }
            }

            // calculate clipping intersection between global clip border and current cell rectangle
            Shape oldClip = grp.getClip();
            rec = rec.intersection((Rectangle)oldClip);

            // Paint the cell
            if (rec.width > 0 || rec.height > 0) {
              grp.setClip(rec);
              grp.translate(x, y);

              panel.setSize(mColumnWidth, cellHeight);
              panel.paint(mouseOver,(row == mCurrentRow && col == mCurrentCol), grp);

              grp.translate(-x, -y);
              grp.setClip(oldClip);
            }
          }
View Full Code Here


    if (y < currY) {
      return null;
    }
    int rowCount = mModel.getRowCount(col);
    for (int row = 0; row < rowCount; row++) {
      ProgramPanel panel = mModel.getProgramPanel(col, row);
      currY += panel.getHeight();
      if (y < currY) {
        return panel.getProgram();
      }
    }

    return null;
  }
View Full Code Here

  public void forceRepaintAll() {
    int columnCount = mModel.getColumnCount();
    for (int col = 0; col < columnCount; col++) {
      int rowCount = mModel.getRowCount(col);
      for (int row = 0; row < rowCount; row++) {
        ProgramPanel panel = mModel.getProgramPanel(col, row);
        panel.setTextColor(Settings.propProgramPanelForegroundColor.getColor());
        panel.setProgramPanelSettings(new ProgramPanelSettings(Settings.propPictureType.getInt(), Settings.propPictureStartTime.getInt(), Settings.propPictureEndTime.getInt(), false, Settings.propIsPictureShowingDescription.getBoolean(), Settings.propPictureDuration.getInt(), Settings.propPicturePluginIds.getStringArray()));
        panel.forceRepaint();
      }
    }
  }
View Full Code Here

    int columnCount = mModel.getColumnCount();
    for (int col = 0; col < columnCount; col++) {
      int colHeight = mLayout.getColumnStart(col);
      int rowCount = mModel.getRowCount(col);
      for (int row = 0; row < rowCount; row++) {
        ProgramPanel panel = mModel.getProgramPanel(col, row);
        colHeight += panel.getHeight();
      }

      if (colHeight > mHeight) {
        mHeight = colHeight;
      }
View Full Code Here

    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);
      Program program = panel.getProgram();
      int startTime = program.getStartTime();

      // Add 24 hours for every day different to the model's main date
      startTime += program.getDate().getNumberOfDaysSince(mainDate) * 24 * 60;

      // upper border of current program panel
      if (startTime == minutesAfterMidnight) {
        return timeY;
      }

      // somewhere inside current panel
      final int progLength = program.getLength();
      int panelHeight = panel.getHeight();
      if (progLength > 0 && startTime < minutesAfterMidnight
          && startTime + progLength > minutesAfterMidnight) {
        if (panelHeight > 800) {
          return 0// very large programs (due to filters) falsify calculation
        }
View Full Code Here

    int width = mColumnWidth;

    int y = mLayout.getColumnStart(cellCol);
    int rowCount = mModel.getRowCount(cellCol);
    for (int row = 0; row < rowCount; row++) {
      ProgramPanel panel = mModel.getProgramPanel(cellCol, row);
      int height = panel.getHeight();
      if (row == cellRow) {
        return new Rectangle(x, y, width, height);
      }
      y += height;
    }
View Full Code Here

        Rectangle rectCur = getCellRect(mCurrentCol,1);

        if(rectCur != null && rectPrev != null) {
          Point cellIndex = getMatrix(rectCur.x, mCurrentY);
          if(cellIndex.y != -1) {
            ProgramPanel panel = mModel.getProgramPanel(cellIndex.x, cellIndex.y);
            if(panel != null && !panel.getProgram().isExpired()) {
              find = false;
              found = true;
              mCurrentRow = cellIndex.y;
            }
          }
        }
      }

      if(find) {
        for(int i = 0; i < rows; i++) {
          ProgramPanel panel = mModel.getProgramPanel(mCurrentCol, i);
          if(panel.getProgram().isOnAir() || !panel.getProgram().isExpired()) {
            found = true;
            mCurrentRow = i;
            break;
          }
        }
View Full Code Here

    repaintCurrentCell();
    if(mCurrentCol == -1) {
      right();
    } else {
      int rows = mModel.getRowCount(mCurrentCol);
      ProgramPanel panel = mModel.getProgramPanel(mCurrentCol, mCurrentRow);

      if(panel.getProgram().isOnAir()) {
        mCurrentRow = rows - 1;
      } else {
        mCurrentRow--;
      }
View Full Code Here

      right();
    } else {
      int rows = mModel.getRowCount(mCurrentCol);
      if(mCurrentRow >= rows -1) {
        for(int i = 0; i < rows; i++) {
          ProgramPanel panel = mModel.getProgramPanel(mCurrentCol, i);
          if(panel.getProgram().isOnAir() || !panel.getProgram().isExpired()) {
            mCurrentRow = i;
            break;
          }
        }
      } else {
View Full Code Here

          Rectangle rectCur = getCellRect(mCurrentCol,1);

          if(rectCur != null && rectPrev != null) {
            Point cellIndex = getMatrix(rectCur.x, mCurrentY);
            if(cellIndex.y != -1) {
              ProgramPanel panel = mModel.getProgramPanel(cellIndex.x, cellIndex.y);
              if(panel != null && !panel.getProgram().isExpired()) {
                find = false;
                found = true;
                mCurrentRow = cellIndex.y;
              }
            }
          }
        }

        if(find) {
          for(int i = 0; i < rows; i++) {
            ProgramPanel panel = mModel.getProgramPanel(mCurrentCol, i);
            if(panel.getProgram().isOnAir() || !panel.getProgram().isExpired()) {
              found = true;
              mCurrentRow = i;
              break;
            }
          }
View Full Code Here

TOP

Related Classes of util.ui.ProgramPanel

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.