Package devplugin

Examples of devplugin.Program


      if(mMarkerArr.length < 1) {
        MarkedProgramsList.getInstance().removeProgram(this);
      }
    }
    else if(mState == Program.WAS_UPDATED_STATE) {
      Program p = Plugin.getPluginManager().getProgram(getDate(), getID());

      if(p != null) {
        p.unmark(marker);
      }
    }
  }
View Full Code Here


    }
    if (o == null) {
      return false;
    }
    if (o instanceof Program) {
      Program program = (Program)o;

      String title = getTitle();
      String otherTitle = program.getTitle();

      return getStartTime() == program.getStartTime()
        && equals(mChannel, program.getChannel())
        && equals(getDate(), program.getDate())
        && title != null && otherTitle != null
        && title.compareTo(otherTitle) == 0;
    }
    return false;
  }
View Full Code Here

                        sleep(Plugin.SINGLE_CLICK_WAITING_TIME);
                        mPerformingSingleClick = true;

                        int row = mProgramTable.rowAtPoint(e.getPoint());
                        mProgramTable.changeSelection(row, 0, false, false);
                        Program p = (Program) mProgramTableModel.getValueAt(row, 1);

                        devplugin.Plugin.getPluginManager().handleProgramSingleClick(p, CapturePlugin.getInstance());
                        mPerformingSingleClick = false;
                      } catch (InterruptedException e) { // ignore
                      }
                    }
                  };
                 
                  mLeftSingleClickThread.setPriority(Thread.MIN_PRIORITY);
                  mLeftSingleClickThread.start();
                }
                else if (SwingUtilities.isLeftMouseButton(e) && (e.getClickCount() == 2) && e.getModifiersEx() == 0) {
                    if(!mPerformingSingleClick && mLeftSingleClickThread != null && mLeftSingleClickThread.isAlive()) {
                      mLeftSingleClickThread.interrupt();
                    }
                   
                    if(!mPerformingSingleClick) {
                      int row = mProgramTable.rowAtPoint(e.getPoint());
                      mProgramTable.changeSelection(row, 0, false, false);
                      Program p = (Program) mProgramTableModel.getValueAt(row, 1);
 
                      devplugin.Plugin.getPluginManager().handleProgramDoubleClick(p, CapturePlugin.getInstance());
                    }
                }
                else if (SwingUtilities.isMiddleMouseButton(e) && (e.getClickCount() == 1)) {
                  mMiddleSingleClickThread = new Thread("Single middle click") {
                    public void run() {
                      try {
                        mPerformingSingleMiddleClick = false;
                        sleep(Plugin.SINGLE_CLICK_WAITING_TIME);
                        mPerformingSingleMiddleClick = true;

                        int row = mProgramTable.rowAtPoint(e.getPoint());
                        mProgramTable.changeSelection(row, 0, false, false);
                        Program p = (Program) mProgramTableModel.getValueAt(row, 1);

                        devplugin.Plugin.getPluginManager().handleProgramMiddleClick(p, CapturePlugin.getInstance());
                        mPerformingSingleMiddleClick = false;
                      } catch (InterruptedException e) { // ignore
                      }
                    }
                  };
                 
                  mMiddleSingleClickThread.setPriority(Thread.MIN_PRIORITY);
                  mMiddleSingleClickThread.start();
                }
                else if (SwingUtilities.isMiddleMouseButton(e) && (e.getClickCount() == 2)) {
                    if(!mPerformingSingleMiddleClick && mMiddleSingleClickThread != null && mMiddleSingleClickThread.isAlive()) {
                      mMiddleSingleClickThread.interrupt();
                    }
                   
                    if(!mPerformingSingleMiddleClick) {
                      int row = mProgramTable.rowAtPoint(e.getPoint());
                      mProgramTable.changeSelection(row, 0, false, false);
                      Program p = (Program) mProgramTableModel.getValueAt(row, 1);
 
                      devplugin.Plugin.getPluginManager().handleProgramMiddleDoubleClick(p, CapturePlugin.getInstance());
                    }
                }
              }
View Full Code Here

    private void showPopup(MouseEvent e) {
      int row = mProgramTable.rowAtPoint(e.getPoint());

      mProgramTable.changeSelection(row, 0, false, false);

      Program p = (Program) mProgramTableModel.getValueAt(row, 1);

      JPopupMenu menu = devplugin.Plugin.getPluginManager().createPluginContextMenu(p, CapturePlugin.getInstance());
      menu.show(mProgramTable, e.getX() - 15, e.getY() - 15);
    }
View Full Code Here

       if ((row > mProgramTableModel.getRowCount()) || (row < 0)) {
           return;
       }

       DeviceIf dev = (DeviceIf) mProgramTableModel.getValueAt(row, 0);
       Program prg = (Program) mProgramTableModel.getValueAt(row, 1);

       int ret = JOptionPane.showConfirmDialog(UiUtilities.getLastModalChildOf(mParent),
               mLocalizer.msg("ReallyDelete","Really delete recording?"),
               Localizer.getLocalization(Localizer.I18N_DELETE)+"?",
               JOptionPane.YES_NO_OPTION);
View Full Code Here

      }
    }

    for (Channel channel : channels) {

      Program prg = findProgram(date, time, channel, false);
      Program nprg = null;

      if (prg == null) {
        prg = findProgram(date.addDays(-1), time + 60 * 24, channel, false);
      }

      if (prg != null) {
        nprg = findNextProgram(prg);
      } else {
        Iterator<Program> it = Plugin.getPluginManager().getChannelDayProgram(date, channel);

        if (it.hasNext()) {
          Program p = it.next();
         
          if (p.getStartTime() > time && mCurrentFilter.accept(p)) {
            nprg = p;
          } else {
            nprg = findProgram(date, time + 60, channel, true);
          }
        } else {
          nprg = findProgram(date, time + 60, channel, true);
        }

        if(nprg == null) {
          it = Plugin.getPluginManager().getChannelDayProgram(date.addDays(1), channel);
         
          while(it.hasNext() && nprg == null) {
            Program p = it.next();
           
            if(!p.isExpired() && mCurrentFilter.accept(p)) {
              nprg = p;
            }
          }
        }
      }
View Full Code Here

   * @return following Program
   */
  private Program findNextProgram(Program prg) {
    Iterator<Program> it = Plugin.getPluginManager().getChannelDayProgram(prg.getDate(), prg.getChannel());

    Program nprg = null;
    boolean last = false;

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

      if (prg.equals(p) && it.hasNext()) {
        while (it.hasNext()) {
          Program test = it.next();
         
          if(!test.isExpired() && mCurrentFilter.accept(test)) {
            return test;
          }
        }
       
        last = true;
      } else if (prg.equals(p) && !it.hasNext()) {
        last = true;
      }
    }

    if (last) {
      it = Plugin.getPluginManager().getChannelDayProgram(prg.getDate().addDays(1), prg.getChannel());

      while (it.hasNext()) {
        Program p = it.next();
       
        if(!p.isExpired() && mCurrentFilter.accept(p)) {
          return p;
        }
      }

    }
View Full Code Here

   * @param channel Channel
   * @return added a Program
   */
  private Program findProgram(Date date, int time, Channel channel, boolean next) {
    for (Iterator<Program> it = Plugin.getPluginManager().getChannelDayProgram(date, channel); it.hasNext();) {
      Program program = it.next();

      int start = program.getStartTime();
      int ende = program.getStartTime() + program.getLength();
     
      if (((!next && (start <= time) && (ende > time)) || (next && start > IOUtilities.getMinutesAfterMidnight())) && mCurrentFilter.accept(program)) {
        return program;
      }
    }
View Full Code Here

   * Called when a Mouse-Event occurs
   *
   * @param e Event
   */
  private void mouseClickedOnTable(final MouseEvent e) {
    final Program prg = getProgramByClick(e);

    if (prg == null) {
      return;
    }
    if (SwingUtilities.isLeftMouseButton(e) && (e.getClickCount() == 1) && e.getModifiersEx() == 0) {
View Full Code Here

  private Program getProgramByClick(MouseEvent e) {
    int col = mProgramTable.getColumnModel().getColumnIndexAtX(e.getX());
    int row = mProgramTable.rowAtPoint(e.getPoint());
    mProgramTable.setRowSelectionInterval(row, row);

    Program prg = null;

    if (col == 1) {
      prg = mModel.getProgram(row);
    } else if (col == 2) {
      prg = mModel.getNextProgram(row);
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.