Package devplugin

Examples of devplugin.Program


          Iterator<Program> programIterator = Plugin.getPluginManager().getChannelDayProgram(new Date(recordingStart),
              tvBrowserChannel);

          while (programIterator.hasNext()) {
            channelHasData = true;
            Program program = programIterator.next();
            int programStartMinutes = program.getStartTime();
            int programEndMinutes = programStartMinutes + program.getLength();

            if ((programStartMinutes >= recordingStartMinutes) && (programEndMinutes <= recordingEndMinutes)) {
              ProgramTime programTime = new ProgramTime(program, recordingStart.getTime(), recordingEnd.getTime());
              TopfieldTimerEntry timerEntry = new TopfieldTimerEntry(fileName, entryNumber, mode, tuner, programTime);
              timerList.add(timerEntry);
View Full Code Here


        try {
          minutes = Integer.parseInt(m);
        }catch(NumberFormatException e) {
          minutes = 10;
        }
        Program program = item.getProgram();

        if(program != null) {
          mReminderList.add(program, new ReminderContent(minutes));
        }
View Full Code Here

      for (int i = 0; i < size; i++) {
        in.readInt();   // read version
        int reminderMinutes = in.readInt();
        Date programDate = Date.readData(in);
        String programId = (String) in.readObject();
        Program program = Plugin.getPluginManager().getProgram(programDate, programId);

        // Only add items that were able to load their program
        if (program != null) {
          mReminderList.add(program, new ReminderContent(reminderMinutes));
        }
View Full Code Here

              }
            } else if (flavors[0].getHumanPresentableName().equals("Program")) {
              PluginProxy[] pa = PluginProxyManager.getInstance().getActivatedPlugins();

              boolean found = false;
              Program program = (Program) tr.getTransferData(flavors[0]);

              for (PluginProxy pluginAccess : pa) {
                if (pluginAccess.getRootNode().getMutableTreeNode().equals(target)) {
                  Action action = getAction(pluginAccess
                      .getContextMenuActions(program));
View Full Code Here

                }

                int row = mTable.rowAtPoint(e.getPoint());

                mTable.changeSelection(row, 0, false, false);
                Program p = (Program) mTable.getModel().getValueAt(row, 0);
               
                Plugin.getPluginManager().handleProgramSingleClick(p, ReminderPluginProxy.getInstance());
                mPerformingSingleClick = false;
              } catch (InterruptedException ex) { // ignore
              }
            }
          };
         
          mLeftClickThread.setPriority(Thread.MIN_PRIORITY);
          mLeftClickThread.start();
        }
        else if (SwingUtilities.isLeftMouseButton(e) && (e.getClickCount() == 2) && e.getModifiersEx() == 0) {
          if(!mPerformingSingleClick && mLeftClickThread != null && mLeftClickThread.isAlive()) {
            mLeftClickThread.interrupt();
          }
         
          if(!mPerformingSingleClick) {
            int column = mTable.columnAtPoint(e.getPoint());
 
            if (column == 1) {
              return;
            }
 
            int row = mTable.rowAtPoint(e.getPoint());
 
            mTable.changeSelection(row, 0, false, false);
            Program p = (Program) mTable.getModel().getValueAt(row, 0);
 
            PluginManagerImpl.getInstance().handleProgramDoubleClick(p, ReminderPluginProxy.getInstance());
          }
        }
        else if (SwingUtilities.isMiddleMouseButton(e) && (e.getClickCount() == 1)) {
          mMiddleSingleClickThread = new Thread("Single click") {
            public void run() {
              try {
                mPerformingMiddleSingleClick = false;
                sleep(Plugin.SINGLE_CLICK_WAITING_TIME);
                mPerformingMiddleSingleClick = true;
               
                if (mTable.columnAtPoint(e.getPoint()) == 1) {
                  return;
                }

                int row = mTable.rowAtPoint(e.getPoint());

                mTable.changeSelection(row, 0, false, false);
                Program p = (Program) mTable.getModel().getValueAt(row, 0);
               
                Plugin.getPluginManager().handleProgramMiddleClick(p, ReminderPluginProxy.getInstance());
                mPerformingMiddleSingleClick = false;
              } catch (InterruptedException ex) { // ignore
              }
            }
          };
         
          mMiddleSingleClickThread.setPriority(Thread.MIN_PRIORITY);
          mMiddleSingleClickThread.start();
        }
        else if (SwingUtilities.isMiddleMouseButton(e) && (e.getClickCount() == 2)) {
          if(!mPerformingMiddleSingleClick && mMiddleSingleClickThread != null && mMiddleSingleClickThread.isAlive()) {
            mMiddleSingleClickThread.interrupt();
          }
         
          if(!mPerformingMiddleSingleClick) {
            int column = mTable.columnAtPoint(e.getPoint());
 
            if (column == 1) {
              return;
            }
 
            int row = mTable.rowAtPoint(e.getPoint());
 
            mTable.changeSelection(row, 0, false, false);
            Program p = (Program) mTable.getModel().getValueAt(row, 0);
 
            PluginManagerImpl.getInstance().handleProgramMiddleDoubleClick(p, ReminderPluginProxy.getInstance());
          }
        }
       
View Full Code Here

      Arrays.sort(selected);

      ArrayList<ReminderListItem> itemList = new ArrayList<ReminderListItem>();
     
      for (int element : selected) {
        Program prog = (Program) mTable.getValueAt(element, 0);

        ReminderListItem item = reminderList.removeWithoutChecking(prog);
       
        if(item != null) {
          itemList.add(item);
View Full Code Here

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

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

    Program p = (Program) mTable.getModel().getValueAt(row, 0);

    JPopupMenu menu = PluginManagerImpl.getInstance().createPluginContextMenu(p, ReminderPluginProxy.getInstance());
    menu.show(mTable, e.getX() - 15, e.getY() - 15);
  }
View Full Code Here

    protected void paintRow(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)  {
      if(path.getLastPathComponent() instanceof Node && (tree.getSelectionPath() == null || !tree.getSelectionPath().equals(path))) {
        Node node = (Node)path.getLastPathComponent();

        if(node.getType() == Node.PROGRAM) {
          Program program = ((ProgramItem)node.getUserObject()).getProgram();

          if(UIManager.getLookAndFeel().getClass().getCanonicalName().equals("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel")) {
            bounds.setBounds(bounds.x,bounds.y+1,bounds.width,bounds.height);
          }

          boolean cleaned = false;

          if(program.isOnAir()) {
            if(!cleaned) {
              g.setColor(Color.white);
              g.fillRect(bounds.x, bounds.y+1, bounds.width, bounds.height-2);
            }

            int runTime = IOUtilities.getMinutesAfterMidnight() - program.getStartTime();
            if (runTime < 0) {
              runTime += 24 * 60;
            }
            int progressX = (int)((bounds.width)/(double)program.getLength() * runTime);

            g.setColor(Settings.propProgramTableColorOnAirDark.getColor());
            g.fillRect(bounds.x,bounds.y+1,progressX,bounds.height-2);

            g.setColor(Settings.propProgramTableColorOnAirLight.getColor());
            g.fillRect(bounds.x + progressX,bounds.y+1,bounds.width-progressX,bounds.height-2);
          }

          if(program.isExpired()) {
            g.setColor(UIManager.getColor("ComboBox.disabledForeground"));
          }
          else if(FilterManagerImpl.getInstance().getCurrentFilter().accept(program)) {
            g.setColor(UIManager.getColor("Label.foreground"));
          }
View Full Code Here

    mPrograms = programs;
    mDefaultAction = new AbstractAction() {
      public void actionPerformed(ActionEvent e) {
        Node node = (Node) mPaths[0].getLastPathComponent();
        ProgramItem programItem = (ProgramItem) node.getUserObject();
        final Program program = programItem.getProgram();
        MainFrame.getInstance().scrollToProgram(program, new Runnable() {
          public void run() {
            ProgramTable table = MainFrame.getInstance().getProgramTableScrollPane().getProgramTable();
            table.deSelectItem();
            table.selectProgram(program);
View Full Code Here

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

      if(p != null) {
        p.mark(marker);
      }
    }
  }
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.