* renamed package "search" to "episodelist"

* renamed class "EpisodeListPanel" to "EpisodeListTab"
* renamed class "SearchPanel" to "EpisodeListPanel"
* renamed panel.search.png to panel.episodelist.png
This commit is contained in:
Reinhard Pointner 2008-10-12 15:46:45 +00:00
parent a0a43b0e03
commit 197bfd1b42
10 changed files with 43 additions and 90 deletions

View File

@ -3,7 +3,7 @@
<project name="FileBot" default="fatjar">
<property name="title" value="${ant.project.name}" />
<property name="version" value="1.9" />
<property name="version" value="1.9.0" />
<property name="dir.source" location="${basedir}/source" />

View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -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());

View File

@ -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<EpisodeListClient> searchField;
public SearchPanel() {
super("Episodes", ResourceManager.getIcon("panel.search"));
public EpisodeListPanel() {
super("Episodes", ResourceManager.getIcon("panel.episodelist"));
searchField = new SelectButtonTextField<EpisodeListClient>();
@ -129,9 +130,9 @@ public class SearchPanel extends FileBotPanel {
protected List<EpisodeListClient> createSearchEngines() {
List<EpisodeListClient> engines = new ArrayList<EpisodeListClient>(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<FileBotList<Episode>> 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<SearchResult> select = new SelectDialog<SearchResult>(window, searchResults);
@ -345,10 +346,10 @@ public class SearchPanel extends FileBotPanel {
private class FetchEpisodeListTaskListener extends SwingWorkerPropertyChangeAdapter {
private EpisodeListPanel episodeList;
private FileBotTab<FileBotList<Episode>> episodeList;
public FetchEpisodeListTaskListener(EpisodeListPanel episodeList) {
public FetchEpisodeListTaskListener(FileBotTab<FileBotList<Episode>> 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);

View File

@ -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<FileBotList<Episode>> {
public EpisodeListTab() {
super(new FileBotList<Episode>());
// set export handler for episode list
getComponent().setExportHandler(new FileBotListExportHandler(getComponent()));
// allow removal of episode list entries
getComponent().getRemoveAction().setEnabled(true);
}
}

View File

@ -1,5 +1,5 @@
package net.sourceforge.filebot.ui.panel.search;
package net.sourceforge.filebot.ui.panel.episodelist;
import java.util.ArrayList;

View File

@ -1,5 +1,5 @@
package net.sourceforge.filebot.ui.panel.search;
package net.sourceforge.filebot.ui.panel.episodelist;
import java.awt.BorderLayout;

View File

@ -1,5 +1,5 @@
package net.sourceforge.filebot.ui.panel.search;
package net.sourceforge.filebot.ui.panel.episodelist;
import javax.swing.SpinnerNumberModel;

View File

@ -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<Episode> {
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);
}
}
}
}