Package devplugin

Examples of devplugin.ProgramFilter


      mDayChooser.setSelectedItem(mProgram.getDate().getCalendar().get(
          Calendar.DAY_OF_WEEK));
    } else if (mMode == MODE_EDIT_EXCLUSION) {
      String title = mExclusion.getTitle();
      String topic = mExclusion.getTopic();
      ProgramFilter filter = mExclusion.getFilter();
      Channel channel = mExclusion.getChannel();
      int timeFrom = mExclusion.getTimeLowerBound();
      int timeTo = mExclusion.getTimeUpperBound();
      int dayOfWeek = mExclusion.getDayOfWeek();
      if (title != null) {
View Full Code Here


   * Returns the Default-Filter.
   *
   * @return the Default-Filter
   */
  protected ProgramFilter getDefaultFilter() {
    ProgramFilter allFilter = null;

    String filterId = Settings.propDefaultFilter.getString();
    String filterName = null;

    if (StringUtils.isNotEmpty(filterId)) {
View Full Code Here

    addContextMenuMouseListener(mMenuBar);

    // set program filter
    FilterList filterList = FilterList.getInstance();

    ProgramFilter filter = filterList
        .getFilterByName(Settings.propLastUsedFilter.getString());

    if (filter == null) {
      filter = FilterManagerImpl.getInstance().getDefaultFilter();
    }
View Full Code Here

   */
  public boolean isDefaultFilterActivated() {
    if (mProgramTableModel == null) {
      return true;
    }
    ProgramFilter filter = mProgramTableModel.getProgramFilter();
    return (Settings.propDefaultFilter.getString().equals(filter.getClass().getName() + "###" + filter.getName()));
  }
View Full Code Here

    mChannelChooser.setChannelGroup(channelFilter);
    mMenuBar.updateChannelGroupMenu();
  }

  public void updateFilterPanel() {
    ProgramFilter filter = mProgramTableModel.getProgramFilter();
    boolean filterVisible = !filter.equals(FilterManagerImpl.getInstance().getDefaultFilter()) && mMenuBar.isShowFilterPanelEnabled();
    if (filterVisible) {
      mFilterPanel.setCurrentFilter(filter);
    }
    mFilterPanel.setVisible(filterVisible);
    Settings.propShowFilterBar.setBoolean(mMenuBar.isShowFilterPanelEnabled());
View Full Code Here

  public void storeSettings() {
    mToolBarModel.store();
    mToolBar.storeSettings();
    mRootNode.storeProperties();

    ProgramFilter filter = getProgramFilter();
    if (filter != null) {
      if (!(filter instanceof SearchFilter)) {
        Settings.propLastUsedFilter.setString(mCurrentFilterName);
      } else {
        Settings.propLastUsedFilter.setString(FilterManagerImpl.getInstance().getDefaultFilter().getName());
View Full Code Here

    ButtonGroup group = new ButtonGroup();
    FilterList filterList = FilterList.getInstance();
    ProgramFilter[] filterArr = filterList.getFilterArr();
    JRadioButtonMenuItem[] result = new JRadioButtonMenuItem[filterArr.length];
    for (int i = 0; i < filterArr.length; i++) {
      final ProgramFilter filter = filterArr[i];
      result[i] = new JRadioButtonMenuItem(filter.toString());
      final JRadioButtonMenuItem item = result[i];
      group.add(item);
      result[i].addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
          mMainFrame.setProgramFilter(filter);
View Full Code Here

  private ProgramFilter[] createFilterList() {
    final HashMap<String, ProgramFilter> filterList = new HashMap<String, ProgramFilter>();

    /* Add default filters. The user may not remove them. */

    ProgramFilter showAll = new ShowAllFilter();
    filterList.put(showAll.getName(), showAll);
    ProgramFilter pluginFilter = new PluginFilter();
    filterList.put(pluginFilter.getName(), pluginFilter);
    ProgramFilter subtitleFilter = new SubtitleFilter();
    filterList.put(subtitleFilter.getName(), subtitleFilter);
    ProgramFilter audioDescriptionFilter = new AudioDescriptionFilter();
    filterList.put(audioDescriptionFilter.getName(), audioDescriptionFilter);

    /* Read the available filters from the file system and add them to the array */
    if (mFilterDirectory == null) {
      throw new NullPointerException("directory is null");
    }


    File[] fileList = getFilterFiles();


    if (fileList != null) {
      for (File file : fileList) {
        UserFilter filter = null;
        try {
          filter = new UserFilter(file);
        } catch (ParserException e) {
          mLog.warning("error parsing filter from file " + file + "; exception: " + e);
        }
        if (filter != null) {
          filterList.put(filter.getName(), filter);
        }
      }
    }

    PluginAccess[] plugins = PluginManagerImpl.getInstance().getActivatedPlugins();

    for (PluginAccess plugin : plugins) {
      PluginsProgramFilter[] filters = plugin.getAvailableFilter();

      if (filters != null) {
        for (PluginsProgramFilter filter : filters) {
          filterList.put(filter.getName(), filter);
        }
      }
    }

    final ArrayList<ProgramFilter> filterArr = new ArrayList<ProgramFilter>();

    /* Sort the list*/
    try {
      File filterFile = new File(mFilterDirectory, FILTER_INDEX);
      if (filterFile.canRead()) {
        StreamUtilities.bufferedReader(filterFile,
          new BufferedReaderProcessor() {
            public void process(BufferedReader inxIn) throws IOException {
              String curFilterName = inxIn.readLine();
              while (curFilterName != null) {
                if (curFilterName.equals("[SEPARATOR]")) {
                  filterArr.add(new SeparatorFilter());
                } else {
                  ProgramFilter filter = filterList.get(curFilterName);

                  if (filter != null) {
                    filterArr.add(filter);
                    filterList.remove(curFilterName);
                  }
View Full Code Here

  }

  @Override
  public boolean receivePrograms(Program[] programArr, ProgramReceiveTarget receiveTarget) {
    final List<Program> programs = Arrays.asList(programArr);
    mRecieveFilter = new ProgramFilter() {
      @Override
      public boolean accept(Program prog) {
        return programs.contains(prog);
      }
View Full Code Here

        if (programs != null) {
          for (Program program : programs) {
            programList.add(program);
          }
          if (programs.length > 0) {
            ProgramFilter pluginFilter = new ProgramFilter() {

              public boolean accept(Program prog) {
                return programList.contains(prog);
              }
View Full Code Here

TOP

Related Classes of devplugin.ProgramFilter

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.