From 197bfd1b42143db5bff2cee061183acc68823f2c Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sun, 12 Oct 2008 15:46:45 +0000 Subject: [PATCH] * renamed package "search" to "episodelist" * renamed class "EpisodeListPanel" to "EpisodeListTab" * renamed class "SearchPanel" to "EpisodeListPanel" * renamed panel.search.png to panel.episodelist.png --- build.xml | 2 +- ...panel.search.png => panel.episodelist.png} | Bin ...panel.search.png => panel.episodelist.png} | Bin .../sourceforge/filebot/ui/FileBotWindow.java | 6 +- .../EpisodeListPanel.java} | 25 +++--- .../ui/panel/episodelist/EpisodeListTab.java | 23 ++++++ .../FetchEpisodeListTask.java | 2 +- .../SeasonSpinnerEditor.java | 2 +- .../SeasonSpinnerModel.java | 2 +- .../ui/panel/search/EpisodeListPanel.java | 71 ------------------ 10 files changed, 43 insertions(+), 90 deletions(-) rename fw/{panel.search.png => panel.episodelist.png} (100%) rename source/net/sourceforge/filebot/resources/{panel.search.png => panel.episodelist.png} (100%) rename source/net/sourceforge/filebot/ui/panel/{search/SearchPanel.java => episodelist/EpisodeListPanel.java} (94%) create mode 100644 source/net/sourceforge/filebot/ui/panel/episodelist/EpisodeListTab.java rename source/net/sourceforge/filebot/ui/panel/{search => episodelist}/FetchEpisodeListTask.java (96%) rename source/net/sourceforge/filebot/ui/panel/{search => episodelist}/SeasonSpinnerEditor.java (95%) rename source/net/sourceforge/filebot/ui/panel/{search => episodelist}/SeasonSpinnerModel.java (89%) delete mode 100644 source/net/sourceforge/filebot/ui/panel/search/EpisodeListPanel.java diff --git a/build.xml b/build.xml index 17046373..f28eff96 100644 --- a/build.xml +++ b/build.xml @@ -3,7 +3,7 @@ - + diff --git a/fw/panel.search.png b/fw/panel.episodelist.png similarity index 100% rename from fw/panel.search.png rename to fw/panel.episodelist.png diff --git a/source/net/sourceforge/filebot/resources/panel.search.png b/source/net/sourceforge/filebot/resources/panel.episodelist.png similarity index 100% rename from source/net/sourceforge/filebot/resources/panel.search.png rename to source/net/sourceforge/filebot/resources/panel.episodelist.png diff --git a/source/net/sourceforge/filebot/ui/FileBotWindow.java b/source/net/sourceforge/filebot/ui/FileBotWindow.java index fa42c3cf..aaf98e06 100644 --- a/source/net/sourceforge/filebot/ui/FileBotWindow.java +++ b/source/net/sourceforge/filebot/ui/FileBotWindow.java @@ -22,9 +22,9 @@ import javax.swing.event.ListSelectionListener; import net.sourceforge.filebot.FileBotUtil; import net.sourceforge.filebot.ResourceManager; import net.sourceforge.filebot.ui.panel.analyze.AnalyzePanel; +import net.sourceforge.filebot.ui.panel.episodelist.EpisodeListPanel; import net.sourceforge.filebot.ui.panel.list.ListPanel; import net.sourceforge.filebot.ui.panel.rename.RenamePanel; -import net.sourceforge.filebot.ui.panel.search.SearchPanel; import net.sourceforge.filebot.ui.panel.sfv.SfvPanel; import net.sourceforge.filebot.ui.panel.subtitle.SubtitlePanel; import net.sourceforge.tuned.MessageBus; @@ -61,7 +61,7 @@ public class FileBotWindow extends JFrame implements ListSelectionListener { setSize(760, 615); // restore the panel selection from last time, - // switch to SearchPanel by default (e.g. first start) + // switch to EpisodeListPanel by default (e.g. first start) int selectedPanel = Preferences.userNodeForPackage(getClass()).getInt("selectedPanel", 3); selectionListPanel.setSelectedIndex(selectedPanel); @@ -75,7 +75,7 @@ public class FileBotWindow extends JFrame implements ListSelectionListener { panels.add(new ListPanel()); panels.add(new RenamePanel()); panels.add(new AnalyzePanel()); - panels.add(new SearchPanel()); + panels.add(new EpisodeListPanel()); panels.add(new SubtitlePanel()); panels.add(new SfvPanel()); diff --git a/source/net/sourceforge/filebot/ui/panel/search/SearchPanel.java b/source/net/sourceforge/filebot/ui/panel/episodelist/EpisodeListPanel.java similarity index 94% rename from source/net/sourceforge/filebot/ui/panel/search/SearchPanel.java rename to source/net/sourceforge/filebot/ui/panel/episodelist/EpisodeListPanel.java index 758d9273..1475fa06 100644 --- a/source/net/sourceforge/filebot/ui/panel/search/SearchPanel.java +++ b/source/net/sourceforge/filebot/ui/panel/episodelist/EpisodeListPanel.java @@ -1,5 +1,5 @@ -package net.sourceforge.filebot.ui.panel.search; +package net.sourceforge.filebot.ui.panel.episodelist; import java.awt.BorderLayout; @@ -35,6 +35,7 @@ import javax.swing.border.EmptyBorder; import net.sourceforge.filebot.ResourceManager; import net.sourceforge.filebot.ui.FileBotList; import net.sourceforge.filebot.ui.FileBotPanel; +import net.sourceforge.filebot.ui.FileBotTab; import net.sourceforge.filebot.ui.HistoryPanel; import net.sourceforge.filebot.ui.MessageManager; import net.sourceforge.filebot.ui.SelectDialog; @@ -55,7 +56,7 @@ import net.sourceforge.tuned.ui.SwingWorkerPropertyChangeAdapter; import net.sourceforge.tuned.ui.TunedUtil; -public class SearchPanel extends FileBotPanel { +public class EpisodeListPanel extends FileBotPanel { private JTabbedPane tabbedPane = new JTabbedPane(SwingConstants.TOP, JTabbedPane.SCROLL_TAB_LAYOUT); @@ -66,8 +67,8 @@ public class SearchPanel extends FileBotPanel { private SelectButtonTextField searchField; - public SearchPanel() { - super("Episodes", ResourceManager.getIcon("panel.search")); + public EpisodeListPanel() { + super("Episodes", ResourceManager.getIcon("panel.episodelist")); searchField = new SelectButtonTextField(); @@ -129,9 +130,9 @@ public class SearchPanel extends FileBotPanel { protected List createSearchEngines() { List engines = new ArrayList(3); - engines.add(new TVDotComClient()); - engines.add(new AnidbClient()); engines.add(new TVRageClient()); + engines.add(new AnidbClient()); + engines.add(new TVDotComClient()); return engines; } @@ -249,14 +250,14 @@ public class SearchPanel extends FileBotPanel { private class SearchTaskListener extends SwingWorkerPropertyChangeAdapter { - private EpisodeListPanel episodeList; + private FileBotTab> episodeList; @Override public void started(PropertyChangeEvent evt) { SearchTask task = (SearchTask) evt.getSource(); - episodeList = new EpisodeListPanel(); + episodeList = new EpisodeListTab(); String title = task.query; @@ -304,7 +305,7 @@ public class SearchPanel extends FileBotPanel { selectedResult = searchResults.iterator().next(); } else if (searchResults.size() > 1) { // multiple shows found, let user selected one - Window window = SwingUtilities.getWindowAncestor(SearchPanel.this); + Window window = SwingUtilities.getWindowAncestor(EpisodeListPanel.this); SelectDialog select = new SelectDialog(window, searchResults); @@ -345,10 +346,10 @@ public class SearchPanel extends FileBotPanel { private class FetchEpisodeListTaskListener extends SwingWorkerPropertyChangeAdapter { - private EpisodeListPanel episodeList; + private FileBotTab> episodeList; - public FetchEpisodeListTaskListener(EpisodeListPanel episodeList) { + public FetchEpisodeListTaskListener(FileBotTab> episodeList) { this.episodeList = episodeList; } @@ -374,7 +375,7 @@ public class SearchPanel extends FileBotPanel { tabbedPane.remove(episodeList); else { episodeList.setLoading(false); - episodeList.getModel().addAll(episodes); + episodeList.getComponent().getModel().addAll(episodes); } } catch (Exception e) { tabbedPane.remove(episodeList); diff --git a/source/net/sourceforge/filebot/ui/panel/episodelist/EpisodeListTab.java b/source/net/sourceforge/filebot/ui/panel/episodelist/EpisodeListTab.java new file mode 100644 index 00000000..2e8e0ca6 --- /dev/null +++ b/source/net/sourceforge/filebot/ui/panel/episodelist/EpisodeListTab.java @@ -0,0 +1,23 @@ + +package net.sourceforge.filebot.ui.panel.episodelist; + + +import net.sourceforge.filebot.ui.FileBotList; +import net.sourceforge.filebot.ui.FileBotListExportHandler; +import net.sourceforge.filebot.ui.FileBotTab; +import net.sourceforge.filebot.web.Episode; + + +public class EpisodeListTab extends FileBotTab> { + + public EpisodeListTab() { + super(new FileBotList()); + + // set export handler for episode list + getComponent().setExportHandler(new FileBotListExportHandler(getComponent())); + + // allow removal of episode list entries + getComponent().getRemoveAction().setEnabled(true); + } + +} diff --git a/source/net/sourceforge/filebot/ui/panel/search/FetchEpisodeListTask.java b/source/net/sourceforge/filebot/ui/panel/episodelist/FetchEpisodeListTask.java similarity index 96% rename from source/net/sourceforge/filebot/ui/panel/search/FetchEpisodeListTask.java rename to source/net/sourceforge/filebot/ui/panel/episodelist/FetchEpisodeListTask.java index f81c2d5a..3c590058 100644 --- a/source/net/sourceforge/filebot/ui/panel/search/FetchEpisodeListTask.java +++ b/source/net/sourceforge/filebot/ui/panel/episodelist/FetchEpisodeListTask.java @@ -1,5 +1,5 @@ -package net.sourceforge.filebot.ui.panel.search; +package net.sourceforge.filebot.ui.panel.episodelist; import java.util.ArrayList; diff --git a/source/net/sourceforge/filebot/ui/panel/search/SeasonSpinnerEditor.java b/source/net/sourceforge/filebot/ui/panel/episodelist/SeasonSpinnerEditor.java similarity index 95% rename from source/net/sourceforge/filebot/ui/panel/search/SeasonSpinnerEditor.java rename to source/net/sourceforge/filebot/ui/panel/episodelist/SeasonSpinnerEditor.java index 4a0dc0fb..5567a11b 100644 --- a/source/net/sourceforge/filebot/ui/panel/search/SeasonSpinnerEditor.java +++ b/source/net/sourceforge/filebot/ui/panel/episodelist/SeasonSpinnerEditor.java @@ -1,5 +1,5 @@ -package net.sourceforge.filebot.ui.panel.search; +package net.sourceforge.filebot.ui.panel.episodelist; import java.awt.BorderLayout; diff --git a/source/net/sourceforge/filebot/ui/panel/search/SeasonSpinnerModel.java b/source/net/sourceforge/filebot/ui/panel/episodelist/SeasonSpinnerModel.java similarity index 89% rename from source/net/sourceforge/filebot/ui/panel/search/SeasonSpinnerModel.java rename to source/net/sourceforge/filebot/ui/panel/episodelist/SeasonSpinnerModel.java index ab17ac8d..31c5bae7 100644 --- a/source/net/sourceforge/filebot/ui/panel/search/SeasonSpinnerModel.java +++ b/source/net/sourceforge/filebot/ui/panel/episodelist/SeasonSpinnerModel.java @@ -1,5 +1,5 @@ -package net.sourceforge.filebot.ui.panel.search; +package net.sourceforge.filebot.ui.panel.episodelist; import javax.swing.SpinnerNumberModel; diff --git a/source/net/sourceforge/filebot/ui/panel/search/EpisodeListPanel.java b/source/net/sourceforge/filebot/ui/panel/search/EpisodeListPanel.java deleted file mode 100644 index c06e72be..00000000 --- a/source/net/sourceforge/filebot/ui/panel/search/EpisodeListPanel.java +++ /dev/null @@ -1,71 +0,0 @@ - -package net.sourceforge.filebot.ui.panel.search; - - -import javax.swing.Icon; -import javax.swing.JComponent; - -import net.sourceforge.filebot.ResourceManager; -import net.sourceforge.filebot.ui.FileBotList; -import net.sourceforge.filebot.ui.FileBotListExportHandler; -import net.sourceforge.filebot.ui.FileBotTabComponent; -import net.sourceforge.filebot.web.Episode; - - -public class EpisodeListPanel extends FileBotList { - - private final FileBotTabComponent tabComponent = new FileBotTabComponent(); - - private Icon icon; - - private boolean loading = false; - - - public EpisodeListPanel() { - setExportHandler(new FileBotListExportHandler(this)); - getRemoveAction().setEnabled(true); - - setBorder(null); - listScrollPane.setBorder(null); - } - - - public JComponent getTabComponent() { - return tabComponent; - } - - - @Override - public void setTitle(String title) { - super.setTitle(title); - tabComponent.setText(title); - } - - - public void setIcon(Icon icon) { - synchronized (tabComponent) { - this.icon = icon; - - if (!loading) { - tabComponent.setIcon(icon); - } - } - } - - - public Icon getIcon() { - return icon; - } - - - public void setLoading(boolean loading) { - synchronized (tabComponent) { - if (loading) { - tabComponent.setIcon(ResourceManager.getIcon("tab.loading")); - } else { - tabComponent.setIcon(icon); - } - } - } - -}