• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java GlazedListsSwing类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中ca.odell.glazedlists.swing.GlazedListsSwing的典型用法代码示例。如果您正苦于以下问题:Java GlazedListsSwing类的具体用法?Java GlazedListsSwing怎么用?Java GlazedListsSwing使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GlazedListsSwing类属于ca.odell.glazedlists.swing包,在下文中一共展示了GlazedListsSwing类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: MediaFilesPanel

import ca.odell.glazedlists.swing.GlazedListsSwing; //导入依赖的package包/类
public MediaFilesPanel(EventList<MediaFile> mediaFiles) {
  this.mediaFileEventList = mediaFiles;
  setLayout(new FormLayout(new ColumnSpec[] { ColumnSpec.decode("default:grow"), }, new RowSpec[] { RowSpec.decode("default:grow"), }));

  mediaFileTableModel = new DefaultEventTableModel<>(GlazedListsSwing.swingThreadProxyList(mediaFileEventList), new MediaTableFormat());
  tableFiles = new ZebraJTable(mediaFileTableModel);
  tableFiles.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);

  LinkListener linkListener = new LinkListener();
  tableFiles.addMouseListener(linkListener);
  tableFiles.addMouseMotionListener(linkListener);

  scrollPaneFiles = ZebraJTable.createStripedJScrollPane(tableFiles);
  add(scrollPaneFiles, "1, 1, fill, fill");

  scrollPaneFiles.setViewportView(tableFiles);

  // align the runtime to the right
  DefaultTableCellRenderer rightRenderer = new DefaultTableCellRenderer();
  rightRenderer.setHorizontalAlignment(SwingConstants.RIGHT);
  tableFiles.getColumnModel().getColumn(6).setCellRenderer(rightRenderer);
}
 
开发者ID:tinyMediaManager,项目名称:tinyMediaManager,代码行数:23,代码来源:MediaFilesPanel.java


示例2: createSwingThreadProxyList

import ca.odell.glazedlists.swing.GlazedListsSwing; //导入依赖的package包/类
public static <E> EventList<E> createSwingThreadProxyList(EventList<E> source) {
	final EventList<E> result;
	source.getReadWriteLock().readLock().lock();
	try {
		result = GlazedListsSwing.swingThreadProxyList(source);
	} finally {
		source.getReadWriteLock().readLock().unlock();
	}
	return result;
}
 
开发者ID:GoldenGnu,项目名称:jeveassets,代码行数:11,代码来源:EventModels.java


示例3: createSwingThreadProxyList

import ca.odell.glazedlists.swing.GlazedListsSwing; //导入依赖的package包/类
private static <E> EventList<E> createSwingThreadProxyList(EventList<E> source) {
	final EventList<E> result;
	source.getReadWriteLock().readLock().lock();
	try {
		result = GlazedListsSwing.swingThreadProxyList(source);
	} finally {
		source.getReadWriteLock().readLock().unlock();
	}
	return result;
}
 
开发者ID:GoldenGnu,项目名称:jwarframe,代码行数:11,代码来源:EventModels.java


示例4: MovieSubtitleChooserDialog

import ca.odell.glazedlists.swing.GlazedListsSwing; //导入依赖的package包/类
public MovieSubtitleChooserDialog(Movie movie, MediaFile mediaFile, boolean inQueue) {
  super(BUNDLE.getString("moviesubtitlechooser.search"), "movieSubtitleChooser"); //$NON-NLS-1$
  setBounds(5, 5, 712, 429);

  this.movieToScrape = movie;
  this.fileToScrape = mediaFile;
  this.inQueue = inQueue;

  subtitleEventList = GlazedLists.threadSafeList(
      new ObservableElementList<>(new BasicEventList<MovieSubtitleChooserModel>(), GlazedLists.beanConnector(MovieSubtitleChooserModel.class)));
  subtitleTableModel = new DefaultEventTableModel<>(GlazedListsSwing.swingThreadProxyList(subtitleEventList), new SubtitleTableFormat());

  initComponents();

  // initializations
  LinkListener linkListener = new LinkListener();
  tableSubs.addMouseListener(linkListener);
  tableSubs.addMouseMotionListener(linkListener);
  tableSubs.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
  TableColumnResizer.adjustColumnPreferredWidths(tableSubs, 7);

  cbScraper.setTextFor(CheckComboBox.NONE, BUNDLE.getString("scraper.selected.none")); //$NON-NLS-1$
  cbScraper.setTextFor(CheckComboBox.MULTIPLE, BUNDLE.getString("scraper.selected.multiple")); //$NON-NLS-1$
  cbScraper.setTextFor(CheckComboBox.ALL, BUNDLE.getString("scraper.selected.all")); //$NON-NLS-1$

  ListCheckModel model = cbScraper.getModel();
  for (MediaScraper scraper : movieList.getAvailableSubtitleScrapers()) {
    model.addElement(scraper);

    if (MovieModuleManager.MOVIE_SETTINGS.getMovieSubtitleScrapers().contains(scraper.getId())) {
      model.addCheck(scraper);
    }
  }

  for (MediaLanguages language : MediaLanguages.values()) {
    cbLanguage.addItem(language);
    if (language == MovieModuleManager.MOVIE_SETTINGS.getSubtitleScraperLanguage()) {
      cbLanguage.setSelectedItem(language);
    }
  }

  // start initial search
  searchSubtitle(fileToScrape.getFileAsPath().toFile(), movieToScrape.getImdbId(), tfSearchQuery.getText());
}
 
开发者ID:tinyMediaManager,项目名称:tinyMediaManager,代码行数:45,代码来源:MovieSubtitleChooserDialog.java


示例5: MovieCrewPanel

import ca.odell.glazedlists.swing.GlazedListsSwing; //导入依赖的package包/类
public MovieCrewPanel(MovieSelectionModel model) {
  selectionModel = model;
  producerEventList = GlazedLists.threadSafeList(
      new ObservableElementList<>(new BasicEventList<MovieProducer>(), GlazedLists.beanConnector(MovieProducer.class)));
  ProducerTableModel = new DefaultEventTableModel<>(GlazedListsSwing.swingThreadProxyList(producerEventList), new ProducerTableFormat());

  setLayout(new FormLayout(
      new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.RELATED_GAP_COLSPEC,
          ColumnSpec.decode("100px:grow"), FormFactory.RELATED_GAP_COLSPEC, },
      new RowSpec[] { FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.NARROW_LINE_GAP_ROWSPEC,
          FormFactory.DEFAULT_ROWSPEC, FormFactory.NARROW_LINE_GAP_ROWSPEC, RowSpec.decode("80px"), RowSpec.decode("default:grow"),
          FormFactory.NARROW_LINE_GAP_ROWSPEC, }));

  lblDirectorT = new JLabel(BUNDLE.getString("metatag.director")); //$NON-NLS-1$
  add(lblDirectorT, "2, 2");

  lblDirector = new JLabel("");
  add(lblDirector, "4, 2");

  lblWriterT = new JLabel(BUNDLE.getString("metatag.writer")); //$NON-NLS-1$
  add(lblWriterT, "2, 4");

  lblWriter = new JLabel("");
  add(lblWriter, "4, 4");

  lblProducer = new JLabel(BUNDLE.getString("metatag.producers")); //$NON-NLS-1$
  add(lblProducer, "2, 6, default, top");

  tableProducer = new ZebraJTable(ProducerTableModel);
  tableProducer.setTableHeader(null);
  JScrollPane scrollPaneMovieCast = ZebraJTable.createStripedJScrollPane(tableProducer);
  lblProducer.setLabelFor(scrollPaneMovieCast);
  add(scrollPaneMovieCast, "4, 6, 1, 2");
  scrollPaneMovieCast.setViewportView(tableProducer);

  initDataBindings();

  // install the propertychangelistener
  PropertyChangeListener propertyChangeListener = new PropertyChangeListener() {
    public void propertyChange(PropertyChangeEvent propertyChangeEvent) {
      String property = propertyChangeEvent.getPropertyName();
      Object source = propertyChangeEvent.getSource();
      // react on selection of a movie and change of a movei
      if ((source.getClass() == MovieSelectionModel.class && "selectedMovie".equals(property))
          || (source.getClass() == Movie.class && PRODUCERS.equals(property))) {
        producerEventList.clear();
        producerEventList.addAll(selectionModel.getSelectedMovie().getProducers());
        if (producerEventList.size() > 0) {
          tableProducer.getSelectionModel().setSelectionInterval(0, 0);
        }
      }
    }
  };

  selectionModel.addPropertyChangeListener(propertyChangeListener);
}
 
开发者ID:tinyMediaManager,项目名称:tinyMediaManager,代码行数:57,代码来源:MovieCrewPanel.java


示例6: MovieTrailerPanel

import ca.odell.glazedlists.swing.GlazedListsSwing; //导入依赖的package包/类
/**
 * Instantiates a new movie details panel.
 * 
 * @param model
 *          the model
 */
public MovieTrailerPanel(MovieSelectionModel model) {
  this.movieSelectionModel = model;
  setLayout(new FormLayout(new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"), },
      new RowSpec[] { FormFactory.RELATED_GAP_ROWSPEC, RowSpec.decode("default:grow"), }));

  trailerEventList = new SortedList<>(
      GlazedLists.threadSafeList(new ObservableElementList<>(new BasicEventList<MovieTrailer>(), GlazedLists.beanConnector(MovieTrailer.class))));
  trailerTableModel = new DefaultEventTableModel<>(GlazedListsSwing.swingThreadProxyList(trailerEventList), new TrailerTableFormat());

  table = new ZebraJTable(trailerTableModel);
  table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
  table.setSelectionModel(new NullSelectionModel());
  TableComparatorChooser.install(table, trailerEventList, TableComparatorChooser.SINGLE_COLUMN);

  JScrollPane scrollPane = ZebraJTable.createStripedJScrollPane(table);
  add(scrollPane, "2, 2, fill, fill");
  scrollPane.setViewportView(table);

  LinkListener linkListener = new LinkListener();
  table.addMouseListener(linkListener);
  table.addMouseMotionListener(linkListener);

  // install the propertychangelistener
  PropertyChangeListener propertyChangeListener = new PropertyChangeListener() {
    public void propertyChange(PropertyChangeEvent propertyChangeEvent) {
      String property = propertyChangeEvent.getPropertyName();
      Object source = propertyChangeEvent.getSource();
      // react on selection of a movie and change of a trailer
      if ((source.getClass() == MovieSelectionModel.class && "selectedMovie".equals(property))
          || (source.getClass() == Movie.class && "trailer".equals(property))) {
        trailerEventList.clear();
        trailerEventList.addAll(movieSelectionModel.getSelectedMovie().getTrailer());
        try {
          TableColumnResizer.adjustColumnPreferredWidths(table, 7);
        }
        catch (Exception e) {
        }
      }
    }
  };

  movieSelectionModel.addPropertyChangeListener(propertyChangeListener);

}
 
开发者ID:tinyMediaManager,项目名称:tinyMediaManager,代码行数:51,代码来源:MovieTrailerPanel.java


示例7: MovieActorPanel

import ca.odell.glazedlists.swing.GlazedListsSwing; //导入依赖的package包/类
public MovieActorPanel(MovieSelectionModel model) {
  selectionModel = model;
  actorEventList = GlazedLists
      .threadSafeList(new ObservableElementList<>(new BasicEventList<MovieActor>(), GlazedLists.beanConnector(MovieActor.class)));
  actorTableModel = new DefaultEventTableModel<>(GlazedListsSwing.swingThreadProxyList(actorEventList), new ActorTableFormat());

  setLayout(new FormLayout(
      new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("100px:grow"), FormFactory.RELATED_GAP_COLSPEC,
          ColumnSpec.decode("125px"), FormFactory.RELATED_GAP_COLSPEC, },
      new RowSpec[] { FormFactory.RELATED_GAP_ROWSPEC, RowSpec.decode("fill:80px:grow"), FormFactory.NARROW_LINE_GAP_ROWSPEC, }));

  tableCast = new ZebraJTable(actorTableModel);
  JScrollPane scrollPaneMovieCast = ZebraJTable.createStripedJScrollPane(tableCast);
  add(scrollPaneMovieCast, "2, 2, 1, 1");
  scrollPaneMovieCast.setViewportView(tableCast);

  lblActorThumb = new ActorImageLabel();
  add(lblActorThumb, "4, 2, fill, fill");

  initDataBindings();

  // install the propertychangelistener
  PropertyChangeListener propertyChangeListener = new PropertyChangeListener() {
    public void propertyChange(PropertyChangeEvent propertyChangeEvent) {
      String property = propertyChangeEvent.getPropertyName();
      Object source = propertyChangeEvent.getSource();
      // react on selection of a movie and change of a movei
      if ((source.getClass() == MovieSelectionModel.class && "selectedMovie".equals(property))
          || (source.getClass() == Movie.class && ACTORS.equals(property))) {
        actorEventList.clear();
        actorEventList.addAll(selectionModel.getSelectedMovie().getActors());
        if (actorEventList.size() > 0) {
          tableCast.getSelectionModel().setSelectionInterval(0, 0);
        }
      }
    }
  };

  selectionModel.addPropertyChangeListener(propertyChangeListener);

  // selectionlistener for the selected actor
  tableCast.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
    @Override
    public void valueChanged(ListSelectionEvent arg0) {
      if (!arg0.getValueIsAdjusting()) {
        int selectedRow = tableCast.convertRowIndexToModel(tableCast.getSelectedRow());
        if (selectedRow >= 0 && selectedRow < actorEventList.size()) {
          MovieActor actor = actorEventList.get(selectedRow);
          lblActorThumb.setActor(actor);
        }
        else {
          lblActorThumb.setImageUrl("");
        }
      }
    }
  });
}
 
开发者ID:tinyMediaManager,项目名称:tinyMediaManager,代码行数:58,代码来源:MovieActorPanel.java


示例8: TvShowCastPanel

import ca.odell.glazedlists.swing.GlazedListsSwing; //导入依赖的package包/类
/**
 * Instantiates a new tv show cast panel.
 * 
 * @param model
 *          the selection model
 */
public TvShowCastPanel(TvShowSelectionModel model) {
  selectionModel = model;
  actorEventList = GlazedLists
      .threadSafeList(new ObservableElementList<>(new BasicEventList<TvShowActor>(), GlazedLists.beanConnector(TvShowActor.class)));
  actorTableModel = new DefaultEventTableModel<>(GlazedListsSwing.swingThreadProxyList(actorEventList), new ActorTableFormat());

  setLayout(
      new FormLayout(
          new ColumnSpec[] { FormFactory.LABEL_COMPONENT_GAP_COLSPEC, ColumnSpec.decode("default:grow"), FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
              ColumnSpec.decode("125px"), },
          new RowSpec[] { FormFactory.NARROW_LINE_GAP_ROWSPEC, RowSpec.decode("fill:max(125px;default):grow"), }));

  lblActorImage = new ImageLabel();
  lblActorImage.setAlternativeText(BUNDLE.getString("image.notfound.thumb")); //$NON-NLS-1$
  add(lblActorImage, "4, 2");

  tableActors = new ZebraJTable(actorTableModel);

  JScrollPane scrollPaneActors = ZebraJTable.createStripedJScrollPane(tableActors);
  scrollPaneActors.setViewportView(tableActors);
  add(scrollPaneActors, "2, 2, fill, fill");

  // install the propertychangelistener
  PropertyChangeListener propertyChangeListener = new PropertyChangeListener() {
    public void propertyChange(PropertyChangeEvent propertyChangeEvent) {
      String property = propertyChangeEvent.getPropertyName();
      Object source = propertyChangeEvent.getSource();
      // react on selection of a movie and change of a tv show
      if ((source.getClass() == TvShowSelectionModel.class && "selectedTvShow".equals(property))
          || (source.getClass() == TvShow.class && ACTORS.equals(property))) {
        actorEventList.clear();
        actorEventList.addAll(selectionModel.getSelectedTvShow().getActors());
        if (actorEventList.size() > 0) {
          tableActors.getSelectionModel().setSelectionInterval(0, 0);
        }
        else {
          lblActorImage.setImageUrl("");
        }
      }
    }
  };

  selectionModel.addPropertyChangeListener(propertyChangeListener);

  // selectionlistener for the selected actor
  tableActors.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
    @Override
    public void valueChanged(ListSelectionEvent arg0) {
      if (!arg0.getValueIsAdjusting()) {
        int selectedRow = tableActors.convertRowIndexToModel(tableActors.getSelectedRow());
        if (selectedRow >= 0 && selectedRow < actorEventList.size()) {
          TvShowActor actor = actorEventList.get(selectedRow);
          Path p = ImageCache.getCachedFile(actor.getThumbUrl());
          if (p == null) {
            lblActorImage.setImageUrl(actor.getThumbUrl());
          }
          else {
            lblActorImage.setImagePath(p.toAbsolutePath().toString());
          }
        }
      }
    }
  });
}
 
开发者ID:tinyMediaManager,项目名称:tinyMediaManager,代码行数:71,代码来源:TvShowCastPanel.java


示例9: TvShowSubtitleChooserDialog

import ca.odell.glazedlists.swing.GlazedListsSwing; //导入依赖的package包/类
public TvShowSubtitleChooserDialog(TvShowEpisode episode, MediaFile mediaFile, boolean inQueue) {
  super(BUNDLE.getString("tvshowepisodesubtitlechooser.search"), "episodeSubtitleChooser"); //$NON-NLS-1$
  setBounds(5, 5, 712, 429);

  this.episodeToScrape = episode;
  this.fileToScrape = mediaFile;
  this.inQueue = inQueue;

  subtitleEventList = GlazedLists.threadSafeList(
      new ObservableElementList<>(new BasicEventList<TvShowSubtitleChooserModel>(), GlazedLists.beanConnector(TvShowSubtitleChooserModel.class)));
  subtitleTableModel = new DefaultEventTableModel<>(GlazedListsSwing.swingThreadProxyList(subtitleEventList), new SubtitleTableFormat());

  initComponents();

  // initializations
  LinkListener linkListener = new LinkListener();
  tableSubs.addMouseListener(linkListener);
  tableSubs.addMouseMotionListener(linkListener);
  tableSubs.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
  TableColumnResizer.adjustColumnPreferredWidths(tableSubs, 7);

  cbScraper.setTextFor(CheckComboBox.NONE, BUNDLE.getString("scraper.selected.none")); //$NON-NLS-1$
  cbScraper.setTextFor(CheckComboBox.MULTIPLE, BUNDLE.getString("scraper.selected.multiple")); //$NON-NLS-1$
  cbScraper.setTextFor(CheckComboBox.ALL, BUNDLE.getString("scraper.selected.all")); //$NON-NLS-1$

  ListCheckModel model = cbScraper.getModel();
  for (MediaScraper scraper : tvShowList.getAvailableSubtitleScrapers()) {
    model.addElement(scraper);

    if (TvShowModuleManager.SETTINGS.getTvShowSubtitleScrapers().contains(scraper.getId())) {
      model.addCheck(scraper);
    }
  }

  for (MediaLanguages language : MediaLanguages.values()) {
    cbLanguage.addItem(language);
    if (language == TvShowModuleManager.SETTINGS.getSubtitleScraperLanguage()) {
      cbLanguage.setSelectedItem(language);
    }
  }

  // start initial search
  searchSubtitle(fileToScrape.getFileAsPath().toFile(), episodeToScrape.getTvShow().getImdbId(), episodeToScrape.getSeason(),
      episodeToScrape.getEpisode());
}
 
开发者ID:tinyMediaManager,项目名称:tinyMediaManager,代码行数:46,代码来源:TvShowSubtitleChooserDialog.java



注:本文中的ca.odell.glazedlists.swing.GlazedListsSwing类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Flatten类代码示例发布时间:2022-05-23
下一篇:
Java TrackOutput类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap