Fixed GlazedList @Depricated

This commit is contained in:
Reinhard Pointner 2016-03-10 07:22:41 +00:00
parent 1a0fd86ba5
commit 8333c502c4
3 changed files with 11 additions and 11 deletions

View File

@ -20,13 +20,13 @@ import net.filebot.util.ui.DefaultFancyListCellRenderer;
import net.filebot.util.ui.SwingUI; import net.filebot.util.ui.SwingUI;
import ca.odell.glazedlists.BasicEventList; import ca.odell.glazedlists.BasicEventList;
import ca.odell.glazedlists.EventList; import ca.odell.glazedlists.EventList;
import ca.odell.glazedlists.swing.EventListModel; import ca.odell.glazedlists.swing.DefaultEventListModel;
public class FileBotList<E> extends JComponent { public class FileBotList<E> extends JComponent {
protected EventList<E> model = new BasicEventList<E>(); protected EventList<E> model = new BasicEventList<E>();
protected JList list = new JList(new EventListModel<E>(model)); protected JList list = new JList(new DefaultEventListModel<E>(model));
protected JScrollPane listScrollPane = new JScrollPane(list); protected JScrollPane listScrollPane = new JScrollPane(list);
@ -55,7 +55,7 @@ public class FileBotList<E> extends JComponent {
public void setModel(EventList<E> model) { public void setModel(EventList<E> model) {
this.model = model; this.model = model;
list.setModel(new EventListModel(model)); list.setModel(new DefaultEventListModel(model));
} }
public JList getListComponent() { public JList getListComponent() {

View File

@ -79,7 +79,7 @@ import net.filebot.web.SortOrder;
import net.miginfocom.swing.MigLayout; import net.miginfocom.swing.MigLayout;
import ca.odell.glazedlists.EventList; import ca.odell.glazedlists.EventList;
import ca.odell.glazedlists.ListSelection; import ca.odell.glazedlists.ListSelection;
import ca.odell.glazedlists.swing.EventSelectionModel; import ca.odell.glazedlists.swing.DefaultEventSelectionModel;
import com.cedarsoftware.util.io.JsonReader; import com.cedarsoftware.util.io.JsonReader;
import com.cedarsoftware.util.io.JsonWriter; import com.cedarsoftware.util.io.JsonWriter;
@ -157,7 +157,7 @@ public class RenamePanel extends JComponent {
namesList.getListComponent().setCellRenderer(cellrenderer); namesList.getListComponent().setCellRenderer(cellrenderer);
filesList.getListComponent().setCellRenderer(cellrenderer); filesList.getListComponent().setCellRenderer(cellrenderer);
EventSelectionModel<Match<Object, File>> selectionModel = new EventSelectionModel<Match<Object, File>>(renameModel.matches()); DefaultEventSelectionModel<Match<Object, File>> selectionModel = new DefaultEventSelectionModel<Match<Object, File>>(renameModel.matches());
selectionModel.setSelectionMode(ListSelection.SINGLE_SELECTION); selectionModel.setSelectionMode(ListSelection.SINGLE_SELECTION);
// use the same selection model for both lists to synchronize selection // use the same selection model for both lists to synchronize selection

View File

@ -59,8 +59,8 @@ import ca.odell.glazedlists.ObservableElementList;
import ca.odell.glazedlists.SortedList; import ca.odell.glazedlists.SortedList;
import ca.odell.glazedlists.TextFilterator; import ca.odell.glazedlists.TextFilterator;
import ca.odell.glazedlists.matchers.MatcherEditor; import ca.odell.glazedlists.matchers.MatcherEditor;
import ca.odell.glazedlists.swing.EventListModel; import ca.odell.glazedlists.swing.DefaultEventListModel;
import ca.odell.glazedlists.swing.EventSelectionModel; import ca.odell.glazedlists.swing.DefaultEventSelectionModel;
import ca.odell.glazedlists.swing.TextComponentMatcherEditor; import ca.odell.glazedlists.swing.TextComponentMatcherEditor;
class SubtitleDownloadComponent extends JComponent { class SubtitleDownloadComponent extends JComponent {
@ -79,7 +79,7 @@ class SubtitleDownloadComponent extends JComponent {
packageList.setCellRenderer(renderer); packageList.setCellRenderer(renderer);
// better selection behaviour // better selection behaviour
EventSelectionModel<SubtitlePackage> packageSelection = new EventSelectionModel<SubtitlePackage>(packages); DefaultEventSelectionModel<SubtitlePackage> packageSelection = new DefaultEventSelectionModel<SubtitlePackage>(packages);
packageSelection.setSelectionMode(ListSelection.MULTIPLE_INTERVAL_SELECTION_DEFENSIVE); packageSelection.setSelectionMode(ListSelection.MULTIPLE_INTERVAL_SELECTION_DEFENSIVE);
packageList.setSelectionModel(packageSelection); packageList.setSelectionModel(packageSelection);
@ -105,7 +105,7 @@ class SubtitleDownloadComponent extends JComponent {
}; };
// better selection behaviour // better selection behaviour
EventSelectionModel<MemoryFile> fileSelection = new EventSelectionModel<MemoryFile>(files); DefaultEventSelectionModel<MemoryFile> fileSelection = new DefaultEventSelectionModel<MemoryFile>(files);
fileSelection.setSelectionMode(ListSelection.MULTIPLE_INTERVAL_SELECTION_DEFENSIVE); fileSelection.setSelectionMode(ListSelection.MULTIPLE_INTERVAL_SELECTION_DEFENSIVE);
fileList.setSelectionModel(fileSelection); fileList.setSelectionModel(fileSelection);
@ -170,7 +170,7 @@ class SubtitleDownloadComponent extends JComponent {
source = new ObservableElementList<SubtitlePackage>(source, GlazedLists.beanConnector(SubtitlePackage.class)); source = new ObservableElementList<SubtitlePackage>(source, GlazedLists.beanConnector(SubtitlePackage.class));
// as list model // as list model
return new EventListModel<SubtitlePackage>(source); return new DefaultEventListModel<SubtitlePackage>(source);
} }
protected ListModel createFileListModel() { protected ListModel createFileListModel() {
@ -187,7 +187,7 @@ class SubtitleDownloadComponent extends JComponent {
}); });
// as list model // as list model
return new EventListModel<MemoryFile>(source); return new DefaultEventListModel<MemoryFile>(source);
} }
public void reset() { public void reset() {