/** * Creates a new table model that extracts column data from the given * <code>source</code> using the the given <code>tableFormat</code>. * * <p>The returned table model is <strong>not thread-safe</strong>. Unless otherwise * noted, all methods are only safe to be called from the event dispatch thread. * To do this programmatically, use {@link SwingUtilities#invokeAndWait(Runnable)} and * wrap the source list (or some part of the source list's pipeline) using * {@link GlazedListsSwing#swingThreadProxyList(EventList)}.</p> * * @param source the EventList that provides the row objects * @param tableFormat the object responsible for extracting column data * from the row objects */ public static <E> AdvancedTableModel<E> eventTableModel(EventList<E> source, TableFormat<? super E> tableFormat) { return new DefaultEventTableModel<E>(source, tableFormat); }
/** * Creates a new table model that extracts column data from the given * <code>source</code> using the the given <code>tableFormat</code>. * * <p>The returned table model is <strong>not thread-safe</strong>. Unless otherwise * noted, all methods are only safe to be called from the event dispatch thread. * To do this programmatically, use {@link SwingUtilities#invokeAndWait(Runnable)} and * wrap the source list (or some part of the source list's pipeline) using * GlazedListsSwing#swingThreadProxyList(EventList).</p> * * @param source the EventList that provides the row objects * @param tableFormat the object responsible for extracting column data * from the row objects */ public static <E> AdvancedTableModel<E> eventTableModel(EventList<E> source, TableFormat<? super E> tableFormat) { return new DefaultEventTableModel<E>(source, tableFormat); }
/** * Creates a new table model that extracts column data from the given * <code>source</code> using the the given <code>tableFormat</code>. * * <p>The returned table model is <strong>not thread-safe</strong>. Unless otherwise * noted, all methods are only safe to be called from the event dispatch thread. * To do this programmatically, use {@link SwingUtilities#invokeAndWait(Runnable)} and * wrap the source list (or some part of the source list's pipeline) using * {@link GlazedListsSwing#swingThreadProxyList(EventList)}.</p> * * @param source the EventList that provides the row objects * @param tableFormat the object responsible for extracting column data * from the row objects */ public static <E> AdvancedTableModel<E> eventTableModel(EventList<E> source, TableFormat<? super E> tableFormat) { return new DefaultEventTableModel<E>(source, tableFormat); }
/** * Creates a new table model that extracts column data from the given <code>source</code> * using the the given <code>tableFormat</code>. While holding a read lock, * this method wraps the source list using * {@link GlazedListsSwing#swingThreadProxyList(EventList)}. * <p> * The returned table model is <strong>not thread-safe</strong>. Unless otherwise noted, all * methods are only safe to be called from the event dispatch thread. * </p> * * @param source the EventList that provides the row objects * @param tableFormat the object responsible for extracting column data from the row objects */ public static <E> AdvancedTableModel<E> eventTableModelWithThreadProxyList(EventList<E> source, TableFormat<? super E> tableFormat) { final EventList<E> proxySource = createSwingThreadProxyList(source); return new DefaultEventTableModel<E>(proxySource, true, tableFormat); }
/** * Creates a new table model that extracts column data from the given <code>source</code> * using the the given <code>tableFormat</code>. This method wraps the source list using * GlazedListsSwing#swingThreadProxyList(EventList). * <p> * The returned table model is <strong>not thread-safe</strong>. Unless otherwise noted, all * methods are only safe to be called from the event dispatch thread. * </p> * * @param source the EventList that provides the row objects * @param tableFormat the object responsible for extracting column data from the row objects */ public static <E> AdvancedTableModel<E> eventTableModelWithThreadProxyList(EventList<E> source, TableFormat<? super E> tableFormat) { final EventList<E> proxySource = createSwingThreadProxyList(source); return new DefaultEventTableModel<E>(proxySource, true, tableFormat); }
/** * Creates a new table model that extracts column data from the given <code>source</code> * using the the given <code>tableFormat</code>. While holding a read lock, * this method wraps the source list using * {@link GlazedListsSwing#swingThreadProxyList(EventList)}. * <p> * The returned table model is <strong>not thread-safe</strong>. Unless otherwise noted, all * methods are only safe to be called from the event dispatch thread. * </p> * * @param source the EventList that provides the row objects * @param tableFormat the object responsible for extracting column data from the row objects */ public static <E> AdvancedTableModel<E> eventTableModelWithThreadProxyList(EventList<E> source, TableFormat<? super E> tableFormat) { final EventList<E> proxySource = createSwingThreadProxyList(source); return new DefaultEventTableModel<E>(proxySource, true, tableFormat); }
/** * Creates a new table model that extracts column data from the given * <code>source</code> using the the given <code>tableFormat</code>. * * <p>The <code>eventAdapterFactory</code> is used to create a {@link TableModelEventAdapter}, * which is then used by the created table model to convert list events to table model events.</p> * * <p>The returned table model is <strong>not thread-safe</strong>. Unless otherwise * noted, all methods are only safe to be called from the event dispatch thread. * To do this programmatically, use {@link SwingUtilities#invokeAndWait(Runnable)} and * wrap the source list (or some part of the source list's pipeline) using * {@link GlazedListsSwing#swingThreadProxyList(EventList)}.</p> * * @param source the EventList that provides the row objects * @param tableFormat the object responsible for extracting column data * from the row objects * @param eventAdapterFactory factory for creating a {@link TableModelEventAdapter} */ public static <E> AdvancedTableModel<E> eventTableModel(EventList<E> source, TableFormat<? super E> tableFormat, TableModelEventAdapter.Factory<E> eventAdapterFactory) { final DefaultEventTableModel<E> result = new DefaultEventTableModel<E>(source, tableFormat); final TableModelEventAdapter<E> eventAdapter = eventAdapterFactory.create(result); result.setEventAdapter(eventAdapter); return result; }
public MediaIdTable(EventList<MediaId> ids, ScraperType type) { this.idMap = null; this.editable = true; this.idList = ids; setModel(new DefaultEventTableModel<>(idList, new MediaIdTableFormat())); setTableHeader(null); putClientProperty("terminateEditOnFocusLost", Boolean.TRUE); TableColumn column = getColumnModel().getColumn(0); Set<String> providerIds = new HashSet<>(); for (MediaId id : ids) { providerIds.add(id.key); } for (MediaScraper scraper : MediaScraper.getMediaScrapers(type)) { providerIds.add(scraper.getId()); } JComboBox<String> comboBox = new JComboBox<>(providerIds.toArray(new String[0])); column.setCellEditor(new DefaultCellEditor(comboBox)); }
/** * Creates a new table model that extracts column data from the given <code>source</code> * using the the given <code>tableFormat</code>. * * <p>While holding a read lock, this method wraps the source list using * {@link GlazedListsSwing#swingThreadProxyList(EventList)}.</p> * * <p>The <code>eventAdapterFactory</code> is used to create a {@link TableModelEventAdapter}, * which is then used by the created table model to convert list events to table model events.</p> * * <p> * The returned table model is <strong>not thread-safe</strong>. Unless otherwise noted, all * methods are only safe to be called from the event dispatch thread. * </p> * * @param source the EventList that provides the row objects * @param tableFormat the object responsible for extracting column data from the row objects * @param eventAdapterFactory factory for creating a {@link TableModelEventAdapter} */ public static <E> AdvancedTableModel<E> eventTableModelWithThreadProxyList(EventList<E> source, TableFormat<? super E> tableFormat, TableModelEventAdapter.Factory<E> eventAdapterFactory) { final EventList<E> proxySource = createSwingThreadProxyList(source); final DefaultEventTableModel<E> result = new DefaultEventTableModel<E>(proxySource, true, tableFormat); final TableModelEventAdapter<E> eventAdapter = eventAdapterFactory.create(result); result.setEventAdapter(eventAdapter); return result; }
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); }
/** * this constructor is used to display the ids * * @param ids * a map containing the ids */ public MediaIdTable(Map<String, Object> ids) { this.idMap = ids; this.editable = false; this.idList = convertIdMapToEventList(idMap); setModel(new DefaultEventTableModel<>(idList, new MediaIdTableFormat())); setTableHeader(null); putClientProperty("terminateEditOnFocusLost", Boolean.TRUE); }
DefaultEventTableModel<TvShowRenamerExample> exampleTableModel = new DefaultEventTableModel<>( GlazedListsSwing.swingThreadProxyList(exampleEventList), new TvShowRenamerExampleTableFormat());
new RowSpec[] { FormFactory.LINE_GAP_ROWSPEC, RowSpec.decode("203px:grow"), })); movieTableModel = new DefaultEventTableModel<>(GlazedListsSwing.swingThreadProxyList(movieEventList), new MovieInMovieSetTableFormat());
producerEventList = GlazedLists.threadSafeList( new ObservableElementList<>(new BasicEventList<MovieProducer>(), GlazedLists.beanConnector(MovieProducer.class))); ProducerTableModel = new DefaultEventTableModel<>(GlazedListsSwing.swingThreadProxyList(producerEventList), new ProducerTableFormat());
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); } } // start initial search searchSubtitle(fileToScrape.getFileAsPath().toFile(), movieToScrape.getImdbId(), tfSearchQuery.getText()); }
actorEventList = GlazedLists .threadSafeList(new ObservableElementList<>(new BasicEventList<TvShowActor>(), GlazedLists.beanConnector(TvShowActor.class))); actorTableModel = new DefaultEventTableModel<>(GlazedListsSwing.swingThreadProxyList(actorEventList), new ActorTableFormat());
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); } } // start initial search searchSubtitle(fileToScrape.getFileAsPath().toFile(), episodeToScrape.getTvShow().getImdbId(), episodeToScrape.getSeason(), episodeToScrape.getEpisode()); }
actorEventList = GlazedLists .threadSafeList(new ObservableElementList<>(new BasicEventList<TvShowActor>(), GlazedLists.beanConnector(TvShowActor.class))); actorTableModel = new DefaultEventTableModel<>(GlazedListsSwing.swingThreadProxyList(actorEventList), new ActorTableFormat());
actorEventList = GlazedLists .threadSafeList(new ObservableElementList<>(new BasicEventList<MovieActor>(), GlazedLists.beanConnector(MovieActor.class))); actorTableModel = new DefaultEventTableModel<>(GlazedListsSwing.swingThreadProxyList(actorEventList), new ActorTableFormat());
trailerTableModel = new DefaultEventTableModel<>(GlazedListsSwing.swingThreadProxyList(trailerEventList), new TrailerTableFormat());