Package devplugin

Examples of devplugin.Date


   * @throws IOException if something went wrong reading from the stream
   * @throws ClassNotFoundException if the program could not be deserialized
   */
  private void readProgramsToList(final ArrayList<Program> list, final int size, final ObjectInputStream in) throws IOException, ClassNotFoundException {
    for (int i = 0; i < size; i++) {
      Date date = Date.readData(in);
      String progID = (String) in.readObject();
      Program program = Plugin.getPluginManager().getProgram(date, progID);
      if (program != null) {
        list.add(program);
      }
View Full Code Here


    // Don't save the programs but only their date and id
    int size = in.readInt();
    ArrayList<Program> programList = new ArrayList<Program>(size);
    for (int i = 0; i < size; i++) {
      Date date = Date.readData(in);
      String progID = (String) in.readObject();
      Program program = Plugin.getPluginManager().getProgram(date, progID);
      if (program != null) {
        programList.add(program);
      }
View Full Code Here

      mPlainFont = new Font(Font.DIALOG, Font.PLAIN, fontSize);
      mItalicFont = new Font(Font.DIALOG, Font.ITALIC, fontSize);
      mDashedBorder = new DashedBorder();
    }
    if (value instanceof Date) {
      Date date = (Date) value;
      if (isSelected) {
        mPanel.setBorder(mDashedBorder);
      }
      else {
        mPanel.setBorder(null);
      }
      boolean enabled = TvDataBase.getInstance().dataAvailable(date);
      mLabel.setText(String.valueOf(date.getDayOfMonth()));
      mLabel.setEnabled(enabled);
      CalendarTableModel tableModel = (CalendarTableModel) table.getModel();

      Date today = new Date();
      if (date.equals(today)) {
        mLabel.setFont(mBoldFont);
      } else if (date.compareTo(today) < 0) {
        mLabel.setFont(mItalicFont);
      } else {
View Full Code Here

      return;
    }
    int column = mTable.getSelectedColumn();
    int row = mTable.getSelectedRow();
    if (column >= 0 && row >= 0) {
      Date date = (Date) mTable.getValueAt(row, column);
      CalendarTableModel model = (CalendarTableModel)mTable.getModel();
      if (date != model.getCurrentDate()) {
        // filter out the duplicate events caused by listening to row and column selection changes
        if (column != mLastColumn || row != mLastRow) {
          markDate(date);
View Full Code Here

  private static final int ROWS = 5;
  private Date[][] mDate = new Date[ROWS][COLUMNS];
  private Date mCurrentDate = Date.getCurrentDate();

  public CalendarTableModel(final Date firstDate) {
    Date date = firstDate;
    while (date.getDayOfWeek() != Calendar.MONDAY) {
      date = date.addDays(-1);
    }
    for (int y = 0; y < ROWS; y++) {
      for (int x = 0; x < COLUMNS; x++) {
        mDate[y][x] = date;
        date = date.addDays(1);
      }
    }
  }
View Full Code Here

  }

  protected void rebuildControls() {
    removeAll();
    setLayout(new GridLayout(ROWS, COLUMNS));
    Date date = getFirstDate();
    while (date.getDayOfWeek() != Calendar.MONDAY) {
      date = date.addDays(-1);
    }
    Date weekday = date;
    for (int i = 0; i < COLUMNS; i++) {
      components[i][0] = new JLabel(new SimpleDateFormat("E").format(weekday
          .getCalendar().getTime()));
      add(components[i][0]);
      weekday = weekday.addDays(1);
    }
    for (int y = 1; y < ROWS; y++) {
      for (int x = 0; x < COLUMNS; x++) {
        ExtendedButton currentButton = new ExtendedButton();
        components[x][y] = currentButton;
View Full Code Here

        return result;
      }
    };

    // Get the start date
    devplugin.Date startDate = new Date().addDays(-1);

    // Split the subsribed channels by data service
    Channel[] subscribedChannels = ChannelList.getSubscribedChannels();
    UpdateJob[] jobArr = toUpdateJobArr(subscribedChannels, services);
View Full Code Here

   * @return The return value is an integer instead of a boolean to make the
   *         counting of programs easier
   */
  private int wrongTimeZone(String channelName, String programTitle,
      int minutesAfterMidnight) {
    final Date currentDate = Date.getCurrentDate();
    for (Channel channel : ChannelList.getSubscribedChannels()) {
      if (channel.getDefaultName().equalsIgnoreCase(channelName)) {
        int wrongDays = 0;
        for (int days = 0; days < 3; days++) {
          ChannelDayProgram dayProgram = TvDataBase.getInstance()
              .getDayProgram(currentDate.addDays(days), channel);
          if (dayProgram != null) {
            Iterator<Program> it = dayProgram.getPrograms();
            if (it != null) {
              while (it.hasNext()) {
                Program program = it.next();
View Full Code Here

    setLayout(new BorderLayout(3,3));

    JButton fontsButton = new JButton(mLocalizer.msg("fonts", "Fonts.."));
    JButton fieldsButton = new JButton(mLocalizer.msg("fields", "Fields.."));

    mDateLabel = new JLabel(new Date().getLongDateString());
    mProgramIconLabel = new JLabel(createDemoProgramPanel());

    mIconPanel = new JPanel(new BorderLayout());
    if (mDateFont != null) {
      mIconPanel.add(mDateLabel, BorderLayout.NORTH);
View Full Code Here

    pb.addLabel(mLocalizer.msg("days","Days"), cc.xy(10,3));
  }

  private Date[] createDateObjects(int days) {
    Date[] result = new Date[days];
    Date today = Date.getCurrentDate();
   
    for (int i=0;i<result.length;i++) {
      result[i]=today.addDays(i);
    }
   
    return result;
  }
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.