* Format Source

This commit is contained in:
Reinhard Pointner 2015-07-25 22:47:19 +00:00
parent 38a046bf2d
commit 8299e849aa
194 changed files with 2700 additions and 2622 deletions

View File

@ -35,6 +35,7 @@ public class ApacheVFS implements ArchiveExtractor, Closeable {
this.archive = fsm.createFileSystem(fsm.toFileObject(file)); this.archive = fsm.createFileSystem(fsm.toFileObject(file));
} }
@Override
public List<FileInfo> listFiles() throws Exception { public List<FileInfo> listFiles() throws Exception {
List<FileInfo> paths = new ArrayList<FileInfo>(); List<FileInfo> paths = new ArrayList<FileInfo>();
for (FileObject it : archive.findFiles(ALL_FILES)) { for (FileObject it : archive.findFiles(ALL_FILES)) {
@ -46,10 +47,12 @@ public class ApacheVFS implements ArchiveExtractor, Closeable {
return paths; return paths;
} }
@Override
public void extract(File outputDir) throws Exception { public void extract(File outputDir) throws Exception {
extract(outputDir, null); extract(outputDir, null);
} }
@Override
public void extract(File outputDir, FileFilter filter) throws Exception { public void extract(File outputDir, FileFilter filter) throws Exception {
fsm.toFileObject(outputDir).copyFrom(archive, filter == null ? ALL_FILES : new FileFilterSelector(filter)); fsm.toFileObject(outputDir).copyFrom(archive, filter == null ? ALL_FILES : new FileFilterSelector(filter));
} }

View File

@ -36,6 +36,7 @@ class ArchiveOpenVolumeCallback implements IArchiveOpenVolumeCallback, IArchiveO
* *
* @see IArchiveOpenVolumeCallback#getProperty(PropID) * @see IArchiveOpenVolumeCallback#getProperty(PropID)
*/ */
@Override
public Object getProperty(PropID propID) throws SevenZipException { public Object getProperty(PropID propID) throws SevenZipException {
switch (propID) { switch (propID) {
case NAME: case NAME:
@ -56,6 +57,7 @@ class ArchiveOpenVolumeCallback implements IArchiveOpenVolumeCallback, IArchiveO
* <li>test.part001.rar - first part of a multi-part archive. "00" indicates, that at least 100 volumes must exist.</li> * <li>test.part001.rar - first part of a multi-part archive. "00" indicates, that at least 100 volumes must exist.</li>
* </ul> * </ul>
*/ */
@Override
public IInStream getStream(String filename) throws SevenZipException { public IInStream getStream(String filename) throws SevenZipException {
try { try {
// We use caching of opened streams, so check cache first // We use caching of opened streams, so check cache first
@ -98,6 +100,7 @@ class ArchiveOpenVolumeCallback implements IArchiveOpenVolumeCallback, IArchiveO
/** /**
* Close all opened streams * Close all opened streams
*/ */
@Override
public void close() throws IOException { public void close() throws IOException {
for (RandomAccessFile file : openedRandomAccessFileList.values()) { for (RandomAccessFile file : openedRandomAccessFileList.values()) {
file.close(); file.close();

View File

@ -29,6 +29,7 @@ class ExtractCallback implements IArchiveExtractCallback {
} }
@Override
public ISequentialOutStream getStream(int index, ExtractAskMode extractAskMode) throws SevenZipException { public ISequentialOutStream getStream(int index, ExtractAskMode extractAskMode) throws SevenZipException {
if (extractAskMode != ExtractAskMode.EXTRACT) { if (extractAskMode != ExtractAskMode.EXTRACT) {
return null; return null;
@ -54,10 +55,12 @@ class ExtractCallback implements IArchiveExtractCallback {
} }
@Override
public void prepareOperation(ExtractAskMode extractAskMode) throws SevenZipException { public void prepareOperation(ExtractAskMode extractAskMode) throws SevenZipException {
} }
@Override
public void setOperationResult(ExtractOperationResult extractOperationResult) throws SevenZipException { public void setOperationResult(ExtractOperationResult extractOperationResult) throws SevenZipException {
if (output != null) { if (output != null) {
try { try {
@ -75,10 +78,12 @@ class ExtractCallback implements IArchiveExtractCallback {
} }
@Override
public void setCompleted(long completeValue) throws SevenZipException { public void setCompleted(long completeValue) throws SevenZipException {
} }
@Override
public void setTotal(long total) throws SevenZipException { public void setTotal(long total) throws SevenZipException {
} }

View File

@ -61,6 +61,7 @@ public class SevenZipExecutable implements ArchiveExtractor {
} }
} }
@Override
public List<FileInfo> listFiles() throws IOException { public List<FileInfo> listFiles() throws IOException {
List<FileInfo> paths = new ArrayList<FileInfo>(); List<FileInfo> paths = new ArrayList<FileInfo>();
@ -81,11 +82,13 @@ public class SevenZipExecutable implements ArchiveExtractor {
return paths; return paths;
} }
@Override
public void extract(File outputDir) throws IOException { public void extract(File outputDir) throws IOException {
// e.g. 7z x -y -aos archive.7z // e.g. 7z x -y -aos archive.7z
execute(get7zCommand(), "x", "-y", "-aos", archive.getPath(), "-o" + outputDir.getCanonicalPath()); execute(get7zCommand(), "x", "-y", "-aos", archive.getPath(), "-o" + outputDir.getCanonicalPath());
} }
@Override
public void extract(File outputDir, FileFilter filter) throws IOException { public void extract(File outputDir, FileFilter filter) throws IOException {
// e.g. 7z x -y -aos archive.7z file.txt image.png info.nfo // e.g. 7z x -y -aos archive.7z file.txt image.png info.nfo
Stream<String> command = Stream.of(get7zCommand(), "x", "-y", "-aos", archive.getPath(), "-o" + outputDir.getCanonicalPath()); Stream<String> command = Stream.of(get7zCommand(), "x", "-y", "-aos", archive.getPath(), "-o" + outputDir.getCanonicalPath());

View File

@ -60,6 +60,7 @@ public class SevenZipNativeBindings implements ArchiveExtractor, Closeable {
return item; return item;
} }
@Override
public List<FileInfo> listFiles() throws SevenZipException { public List<FileInfo> listFiles() throws SevenZipException {
List<FileInfo> paths = new ArrayList<FileInfo>(); List<FileInfo> paths = new ArrayList<FileInfo>();

View File

@ -292,6 +292,7 @@ public class GroovyPad extends JFrame {
private class ConsoleOutputStream extends ByteArrayOutputStream { private class ConsoleOutputStream extends ByteArrayOutputStream {
@Override
public void flush() { public void flush() {
try { try {
String message = this.toString("UTF-8"); String message = this.toString("UTF-8");

View File

@ -57,7 +57,7 @@ public class ScriptShellMethods {
} }
public static List<File> listFiles(File self, Closure<?> closure) { public static List<File> listFiles(File self, Closure<?> closure) {
return (List<File>) DefaultGroovyMethods.findAll(FileUtilities.getChildren(self), closure); return DefaultGroovyMethods.findAll(FileUtilities.getChildren(self), closure);
} }
public static boolean isVideo(File self) { public static boolean isVideo(File self) {
@ -121,7 +121,7 @@ public class ScriptShellMethods {
List<File> files = FileUtilities.listFiles(roots); List<File> files = FileUtilities.listFiles(roots);
if (closure != null) { if (closure != null) {
files = (List<File>) DefaultGroovyMethods.findAll(files, closure); files = DefaultGroovyMethods.findAll(files, closure);
} }
return FileUtilities.sortByUniquePath(files); return FileUtilities.sortByUniquePath(files);
@ -144,7 +144,7 @@ public class ScriptShellMethods {
List<File> folders = FileUtilities.listFolders(roots); List<File> folders = FileUtilities.listFolders(roots);
if (closure != null) { if (closure != null) {
folders = (List<File>) DefaultGroovyMethods.findAll(folders, closure); folders = DefaultGroovyMethods.findAll(folders, closure);
} }
return FileUtilities.sortByUniquePath(folders); return FileUtilities.sortByUniquePath(folders);

View File

@ -909,6 +909,7 @@ public class MediaBindingBean {
private AssociativeScriptObject createBindingObject(File file, Object info, Map<File, Object> context) { private AssociativeScriptObject createBindingObject(File file, Object info, Map<File, Object> context) {
MediaBindingBean mediaBindingBean = new MediaBindingBean(info, file, context) { MediaBindingBean mediaBindingBean = new MediaBindingBean(info, file, context) {
@Override
@Define(undefined) @Define(undefined)
public <T> T undefined(String name) { public <T> T undefined(String name) {
return null; // never throw exceptions for empty or null values return null; // never throw exceptions for empty or null values

View File

@ -284,6 +284,7 @@ public class DropToUnlock extends JList<File> {
return true; return true;
} }
@Override
public void handleTransferable(Transferable tr, TransferAction action) throws Exception { public void handleTransferable(Transferable tr, TransferAction action) throws Exception {
List<File> files = FileTransferable.getFilesFromTransferable(tr); List<File> files = FileTransferable.getFilesFromTransferable(tr);
if (files != null) { if (files != null) {
@ -318,6 +319,7 @@ public class DropToUnlock extends JList<File> {
protected static class FileChooserAction extends MouseAdapter { protected static class FileChooserAction extends MouseAdapter {
@Override
public void mouseClicked(MouseEvent evt) { public void mouseClicked(MouseEvent evt) {
DropToUnlock list = (DropToUnlock) evt.getSource(); DropToUnlock list = (DropToUnlock) evt.getSource();
if (evt.getClickCount() > 0) { if (evt.getClickCount() > 0) {

View File

@ -33,6 +33,7 @@ public class SmartSeasonEpisodeMatcher extends SeasonEpisodeMatcher {
return super.match(new File(clean(file.getPath()))); return super.match(new File(clean(file.getPath())));
} }
@Override
public String head(String name) { public String head(String name) {
return super.head(clean(name)); return super.head(clean(name));
} }

View File

@ -88,6 +88,7 @@ public enum SubtitleMetrics implements SimilarityMetric {
return 0; return 0;
} }
@Override
protected float similarity(String match, String s1, String s2) { protected float similarity(String match, String s1, String s2) {
return match.length() > 0 ? 1 : 0; return match.length() > 0 ? 1 : 0;
} }
@ -153,10 +154,12 @@ public enum SubtitleMetrics implements SimilarityMetric {
private final String FPS = "FPS"; private final String FPS = "FPS";
private final String SECONDS = "SECS"; private final String SECONDS = "SECS";
@Override
public float getSimilarity(Object o1, Object o2) { public float getSimilarity(Object o1, Object o2) {
return o1 instanceof SubtitleDescriptor ? super.getSimilarity(o1, o2) : super.getSimilarity(o2, o1); // make sure that SubtitleDescriptor is o1 return o1 instanceof SubtitleDescriptor ? super.getSimilarity(o1, o2) : super.getSimilarity(o2, o1); // make sure that SubtitleDescriptor is o1
}; };
@Override
protected Map<String, Object> getProperties(Object object) { protected Map<String, Object> getProperties(Object object) {
if (object instanceof OpenSubtitlesSubtitleDescriptor) { if (object instanceof OpenSubtitlesSubtitleDescriptor) {
return getSubtitleProperties((OpenSubtitlesSubtitleDescriptor) object); return getSubtitleProperties((OpenSubtitlesSubtitleDescriptor) object);

View File

@ -97,11 +97,13 @@ public class LanguageComboBoxModel extends AbstractListModel implements ComboBox
return data.get(index); return data.get(index);
} }
@Override
public boolean add(Language element) { public boolean add(Language element) {
// add first // add first
return addIfAbsent(0, element); return addIfAbsent(0, element);
} }
@Override
public void add(int index, Language element) { public void add(int index, Language element) {
addIfAbsent(index, element); addIfAbsent(index, element);
} }

View File

@ -125,10 +125,12 @@ public class MainFrame extends JFrame {
GroovyPad pad = new GroovyPad(); GroovyPad pad = new GroovyPad();
pad.addWindowListener(new WindowAdapter() { pad.addWindowListener(new WindowAdapter() {
@Override
public void windowOpened(WindowEvent e) { public void windowOpened(WindowEvent e) {
MainFrame.this.setVisible(false); MainFrame.this.setVisible(false);
}; };
@Override
public void windowClosing(WindowEvent e) { public void windowClosing(WindowEvent e) {
MainFrame.this.setVisible(true); MainFrame.this.setVisible(true);
}; };

View File

@ -37,6 +37,7 @@ public class AnalyzePanel extends JComponent {
private final PropertyChangeListener filetreeListener = new PropertyChangeListener() { private final PropertyChangeListener filetreeListener = new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) { public void propertyChange(PropertyChangeEvent evt) {
// stopped loading, refresh tools // stopped loading, refresh tools
for (int i = 0; i < toolsPanel.getTabCount(); i++) { for (int i = 0; i < toolsPanel.getTabCount(); i++) {

View File

@ -114,6 +114,7 @@ public class FileTree extends JTree {
putValue("files", files); putValue("files", files);
} }
@Override
public void actionPerformed(ActionEvent event) { public void actionPerformed(ActionEvent event) {
UserFiles.revealFiles((Collection<File>) getValue("files")); UserFiles.revealFiles((Collection<File>) getValue("files"));
} }

View File

@ -7,7 +7,6 @@ import static net.filebot.util.FileUtilities.*;
import java.io.File; import java.io.File;
import java.io.FileFilter; import java.io.FileFilter;
import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
@ -15,8 +14,6 @@ import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.SortedMap; import java.util.SortedMap;
import java.util.TreeMap; import java.util.TreeMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;

View File

@ -42,6 +42,7 @@ class MatchAction extends AbstractAction {
putValue(SMALL_ICON, ResourceManager.getIcon(strict ? "action.match.strict" : "action.match")); putValue(SMALL_ICON, ResourceManager.getIcon(strict ? "action.match.strict" : "action.match"));
} }
@Override
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
if (model.names().isEmpty() || model.files().isEmpty()) { if (model.names().isEmpty() || model.files().isEmpty()) {
return; return;

View File

@ -237,6 +237,7 @@ public class PresetEditor extends JDialog {
private final ListCellRenderer<Object> parent = (ListCellRenderer<Object>) combo.getRenderer(); private final ListCellRenderer<Object> parent = (ListCellRenderer<Object>) combo.getRenderer();
@Override
public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) { public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
JLabel label = (JLabel) parent.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); JLabel label = (JLabel) parent.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
@ -278,7 +279,7 @@ public class PresetEditor extends JDialog {
JLabel label = (JLabel) parent.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); JLabel label = (JLabel) parent.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (value instanceof Language) { if (value instanceof Language) {
Language it = (Language) value; Language it = value;
label.setText(it.getName()); label.setText(it.getName());
label.setIcon(ResourceManager.getFlagIcon(it.getCode())); label.setIcon(ResourceManager.getFlagIcon(it.getCode()));
} }

View File

@ -126,6 +126,7 @@ class RenameList<E> extends FileBotList<E> {
private final AbstractAction upAction = new AbstractAction("Align Up", ResourceManager.getIcon("action.up")) { private final AbstractAction upAction = new AbstractAction("Align Up", ResourceManager.getIcon("action.up")) {
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
int index = getListComponent().getSelectedIndex(); int index = getListComponent().getSelectedIndex();
@ -138,6 +139,7 @@ class RenameList<E> extends FileBotList<E> {
private final AbstractAction downAction = new AbstractAction("Align Down", ResourceManager.getIcon("action.down")) { private final AbstractAction downAction = new AbstractAction("Align Down", ResourceManager.getIcon("action.down")) {
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
int index = getListComponent().getSelectedIndex(); int index = getListComponent().getSelectedIndex();

View File

@ -274,7 +274,7 @@ public class RenamePanel extends JComponent {
try { try {
JList list = (JList) evt.getSource(); JList list = (JList) evt.getSource();
if (list.getSelectedIndex() >= 0) { if (list.getSelectedIndex() >= 0) {
UserFiles.revealFiles((List<File>) list.getSelectedValuesList()); UserFiles.revealFiles(list.getSelectedValuesList());
} }
} catch (Exception e) { } catch (Exception e) {
Logger.getLogger(RenamePanel.class.getName()).log(Level.WARNING, e.getMessage()); Logger.getLogger(RenamePanel.class.getName()).log(Level.WARNING, e.getMessage());
@ -702,6 +702,7 @@ public class RenamePanel extends JComponent {
this.preset = preset; this.preset = preset;
} }
@Override
public List<File> getFiles(ActionEvent evt) { public List<File> getFiles(ActionEvent evt) {
List<File> input = new ArrayList<File>(); List<File> input = new ArrayList<File>();
if (preset.getInputFolder() != null) { if (preset.getInputFolder() != null) {
@ -725,10 +726,12 @@ public class RenamePanel extends JComponent {
return input; return input;
} }
@Override
public boolean isStrict(ActionEvent evt) { public boolean isStrict(ActionEvent evt) {
return preset.getMatchMode() != null ? MATCH_MODE_STRICT.equals(preset.getMatchMode()) : super.isStrict(evt); return preset.getMatchMode() != null ? MATCH_MODE_STRICT.equals(preset.getMatchMode()) : super.isStrict(evt);
} }
@Override
public SortOrder getSortOrder(ActionEvent evt) { public SortOrder getSortOrder(ActionEvent evt) {
return preset.getSortOrder() != null ? preset.getSortOrder() : super.getSortOrder(evt); return preset.getSortOrder() != null ? preset.getSortOrder() : super.getSortOrder(evt);
} }

View File

@ -171,6 +171,7 @@ class ChecksumRow {
private final PropertyChangeListener updateStateListener = new PropertyChangeListener() { private final PropertyChangeListener updateStateListener = new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) { public void propertyChange(PropertyChangeEvent evt) {
if ("state".equals(evt.getPropertyName())) { if ("state".equals(evt.getPropertyName())) {
setState(getState(hashes.values())); setState(getState(hashes.values()));

View File

@ -242,6 +242,7 @@ class ChecksumTableModel extends AbstractTableModel {
private final PropertyChangeListener progressListener = new PropertyChangeListener() { private final PropertyChangeListener progressListener = new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) { public void propertyChange(PropertyChangeEvent evt) {
ChecksumCell cell = (ChecksumCell) evt.getSource(); ChecksumCell cell = (ChecksumCell) evt.getSource();

View File

@ -32,6 +32,7 @@ class SwingWorkerCellRenderer extends JPanel implements TableCellRenderer {
} }
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
setBackground(isSelected ? table.getSelectionBackground() : table.getBackground()); setBackground(isSelected ? table.getSelectionBackground() : table.getBackground());

View File

@ -46,6 +46,7 @@ class TotalProgressPanel extends JComponent {
private final DelayedToggle delayed = new DelayedToggle(); private final DelayedToggle delayed = new DelayedToggle();
@Override
public void propertyChange(PropertyChangeEvent evt) { public void propertyChange(PropertyChangeEvent evt) {
final int completedTaskCount = getComputationService(evt).getCompletedTaskCount(); final int completedTaskCount = getComputationService(evt).getCompletedTaskCount();
final int totalTaskCount = getComputationService(evt).getTotalTaskCount(); final int totalTaskCount = getComputationService(evt).getTotalTaskCount();
@ -80,6 +81,7 @@ class TotalProgressPanel extends JComponent {
private final ActionListener visibilityActionHandler = new ActionListener() { private final ActionListener visibilityActionHandler = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
setVisible(e.getActionCommand() == SHOW); setVisible(e.getActionCommand() == SHOW);
} }

View File

@ -216,6 +216,7 @@ abstract class SubtitleDropTarget extends JButton {
return true; return true;
} }
@Override
protected Icon getIcon(DropAction dropAction) { protected Icon getIcon(DropAction dropAction) {
switch (dropAction) { switch (dropAction) {
case Accept: case Accept:
@ -307,6 +308,7 @@ abstract class SubtitleDropTarget extends JButton {
return null; return null;
} }
@Override
protected Icon getIcon(DropAction dropAction) { protected Icon getIcon(DropAction dropAction) {
if (dropAction == DropAction.Accept) if (dropAction == DropAction.Accept)
return ResourceManager.getIcon("subtitle.exact.upload"); return ResourceManager.getIcon("subtitle.exact.upload");

View File

@ -73,6 +73,7 @@ public class SubtitlePanel extends AbstractSearchPanel<SubtitleProvider, Subtitl
private final SubtitleDropTarget uploadDropTarget = new SubtitleDropTarget.Upload() { private final SubtitleDropTarget uploadDropTarget = new SubtitleDropTarget.Upload() {
@Override
public OpenSubtitlesClient getSubtitleService() { public OpenSubtitlesClient getSubtitleService() {
return WebServices.OpenSubtitles; return WebServices.OpenSubtitles;
}; };
@ -114,6 +115,7 @@ public class SubtitlePanel extends AbstractSearchPanel<SubtitleProvider, Subtitl
return WebServices.getSubtitleProviders(); return WebServices.getSubtitleProviders();
} }
@Override
public OpenSubtitlesClient getSubtitleService() { public OpenSubtitlesClient getSubtitleService() {
return WebServices.OpenSubtitles; return WebServices.OpenSubtitles;
}; };
@ -149,6 +151,7 @@ public class SubtitlePanel extends AbstractSearchPanel<SubtitleProvider, Subtitl
} }
}; };
@Override
protected Collection<String> getHistory(SubtitleProvider engine) throws Exception { protected Collection<String> getHistory(SubtitleProvider engine) throws Exception {
List<String> names = new ArrayList<String>(); List<String> names = new ArrayList<String>();
for (SubtitleSearchResult it : MediaDetection.releaseInfo.getOpenSubtitlesIndex()) { for (SubtitleSearchResult it : MediaDetection.releaseInfo.getOpenSubtitlesIndex()) {

View File

@ -61,7 +61,6 @@ import net.filebot.web.Movie;
import net.filebot.web.OpenSubtitlesClient; import net.filebot.web.OpenSubtitlesClient;
import net.filebot.web.SearchResult; import net.filebot.web.SearchResult;
import net.filebot.web.SubtitleSearchResult; import net.filebot.web.SubtitleSearchResult;
import net.filebot.web.TheTVDBSearchResult;
import net.filebot.web.TheTVDBSeriesInfo; import net.filebot.web.TheTVDBSeriesInfo;
import net.filebot.web.VideoHashSubtitleService.CheckResult; import net.filebot.web.VideoHashSubtitleService.CheckResult;
import net.miginfocom.swing.MigLayout; import net.miginfocom.swing.MigLayout;
@ -690,7 +689,7 @@ public class SubtitleUploadDialog extends JDialog {
for (String name : seriesNames) { for (String name : seriesNames) {
List<SearchResult> options = WebServices.TheTVDB.search(name, Locale.ENGLISH); List<SearchResult> options = WebServices.TheTVDB.search(name, Locale.ENGLISH);
for (SearchResult entry : options) { for (SearchResult entry : options) {
TheTVDBSeriesInfo seriesInfo = (TheTVDBSeriesInfo) WebServices.TheTVDB.getSeriesInfo((TheTVDBSearchResult) entry, Locale.ENGLISH); TheTVDBSeriesInfo seriesInfo = (TheTVDBSeriesInfo) WebServices.TheTVDB.getSeriesInfo(entry, Locale.ENGLISH);
if (seriesInfo.getImdbId() != null) { if (seriesInfo.getImdbId() != null) {
int imdbId = grepImdbId(seriesInfo.getImdbId()).iterator().next(); int imdbId = grepImdbId(seriesInfo.getImdbId()).iterator().next();
mapping.setIdentity(WebServices.OpenSubtitles.getMovieDescriptor(new Movie(null, 0, imdbId, -1), Locale.ENGLISH)); mapping.setIdentity(WebServices.OpenSubtitles.getMovieDescriptor(new Movie(null, 0, imdbId, -1), Locale.ENGLISH));

View File

@ -39,6 +39,7 @@ public class LoadAction extends AbstractAction {
return null; return null;
} }
@Override
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
try { try {
// get transferable policy from action properties // get transferable policy from action properties

View File

@ -45,6 +45,7 @@ public class SaveAction extends AbstractAction {
return new File(validateFileName(getExportHandler().getDefaultFileName())); return new File(validateFileName(getExportHandler().getDefaultFileName()));
} }
@Override
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
try { try {
if (canExport()) { if (canExport()) {

View File

@ -14,12 +14,14 @@ import javax.swing.TransferHandler;
public abstract class TextFileExportHandler implements TransferableExportHandler, FileExportHandler { public abstract class TextFileExportHandler implements TransferableExportHandler, FileExportHandler {
@Override
public abstract boolean canExport(); public abstract boolean canExport();
public abstract void export(PrintWriter out); public abstract void export(PrintWriter out);
@Override
public abstract String getDefaultFileName(); public abstract String getDefaultFileName();

View File

@ -36,6 +36,7 @@ public class DefaultThreadFactory implements ThreadFactory {
} }
@Override
public Thread newThread(Runnable r) { public Thread newThread(Runnable r) {
Thread thread = new Thread(group, r, String.format("%s-thread-%d", group.getName(), threadNumber.incrementAndGet())); Thread thread = new Thread(group, r, String.format("%s-thread-%d", group.getName(), threadNumber.incrementAndGet()));

View File

@ -20,6 +20,7 @@ public class ListChangeSynchronizer<E> implements ListEventListener<E> {
} }
@Override
public void listChanged(ListEvent<E> listChanges) { public void listChanged(ListEvent<E> listChanges) {
EventList<E> source = listChanges.getSourceList(); EventList<E> source = listChanges.getSourceList();

View File

@ -58,50 +58,62 @@ public class UnicodeReader extends Reader {
} }
} }
@Override
public int hashCode() { public int hashCode() {
return reader.hashCode(); return reader.hashCode();
} }
@Override
public int read(CharBuffer target) throws IOException { public int read(CharBuffer target) throws IOException {
return reader.read(target); return reader.read(target);
} }
@Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
return reader.equals(obj); return reader.equals(obj);
} }
@Override
public int read(char[] cbuf) throws IOException { public int read(char[] cbuf) throws IOException {
return reader.read(cbuf); return reader.read(cbuf);
} }
@Override
public int read() throws IOException { public int read() throws IOException {
return reader.read(); return reader.read();
} }
@Override
public int read(char[] cbuf, int offset, int length) throws IOException { public int read(char[] cbuf, int offset, int length) throws IOException {
return reader.read(cbuf, offset, length); return reader.read(cbuf, offset, length);
} }
@Override
public long skip(long n) throws IOException { public long skip(long n) throws IOException {
return reader.skip(n); return reader.skip(n);
} }
@Override
public boolean ready() throws IOException { public boolean ready() throws IOException {
return reader.ready(); return reader.ready();
} }
@Override
public void close() throws IOException { public void close() throws IOException {
reader.close(); reader.close();
} }
@Override
public boolean markSupported() { public boolean markSupported() {
return reader.markSupported(); return reader.markSupported();
} }
@Override
public void mark(int readAheadLimit) throws IOException { public void mark(int readAheadLimit) throws IOException {
reader.mark(readAheadLimit); reader.mark(readAheadLimit);
} }
@Override
public void reset() throws IOException { public void reset() throws IOException {
reader.reset(); reader.reset();
} }

View File

@ -26,11 +26,13 @@ public class FilePreferencesFactory implements PreferencesFactory {
public static final String SYSTEM_PROPERTY_FILE = "net.filebot.util.prefs.file"; public static final String SYSTEM_PROPERTY_FILE = "net.filebot.util.prefs.file";
@Override
public Preferences systemRoot() { public Preferences systemRoot() {
return userRoot(); return userRoot();
} }
@Override
public Preferences userRoot() { public Preferences userRoot() {
if (rootPreferences == null) { if (rootPreferences == null) {
rootPreferences = new FilePreferences(null, ""); rootPreferences = new FilePreferences(null, "");

View File

@ -148,6 +148,7 @@ public class ListView extends JList {
private Point origin; private Point origin;
@Override
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
if (SwingUtilities.isLeftMouseButton(e) && !isSelectedIndex(locationToIndex(e.getPoint()))) { if (SwingUtilities.isLeftMouseButton(e) && !isSelectedIndex(locationToIndex(e.getPoint()))) {
origin = e.getPoint(); origin = e.getPoint();

View File

@ -226,6 +226,7 @@ public class SelectButton<T> extends JButton {
this.icon = icon; this.icon = icon;
} }
@Override
public void paintIcon(Component c, Graphics g, int x, int y) { public void paintIcon(Component c, Graphics g, int x, int y) {
Graphics2D g2d = (Graphics2D) g; Graphics2D g2d = (Graphics2D) g;
@ -237,10 +238,12 @@ public class SelectButton<T> extends JButton {
g2d.fill(arrow); g2d.fill(arrow);
} }
@Override
public int getIconWidth() { public int getIconWidth() {
return 30; return 30;
} }
@Override
public int getIconHeight() { public int getIconHeight() {
return 20; return 20;
} }

View File

@ -10,6 +10,7 @@ import javax.swing.SwingWorker.StateValue;
public abstract class SwingWorkerPropertyChangeAdapter implements PropertyChangeListener { public abstract class SwingWorkerPropertyChangeAdapter implements PropertyChangeListener {
@Override
public void propertyChange(PropertyChangeEvent evt) { public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName().equals("progress")) { if (evt.getPropertyName().equals("progress")) {
progress(evt); progress(evt);

View File

@ -80,6 +80,7 @@ public class QueueNotificationLayout implements NotificationLayout {
} }
@Override
public void add(NotificationWindow notification) { public void add(NotificationWindow notification) {
notifications.add(notification); notifications.add(notification);
align(notification.getGraphicsConfiguration()); align(notification.getGraphicsConfiguration());
@ -103,6 +104,7 @@ public class QueueNotificationLayout implements NotificationLayout {
} }
@Override
public void remove(NotificationWindow notification) { public void remove(NotificationWindow notification) {
if (notifications.remove(notification)) { if (notifications.remove(notification)) {
align(notification.getGraphicsConfiguration()); align(notification.getGraphicsConfiguration());

View File

@ -55,6 +55,7 @@ public class SimpleNotificationLayout implements NotificationLayout {
} }
@Override
public void add(NotificationWindow notification) { public void add(NotificationWindow notification) {
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(notification.getGraphicsConfiguration()); Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(notification.getGraphicsConfiguration());
@ -71,6 +72,7 @@ public class SimpleNotificationLayout implements NotificationLayout {
} }
@Override
public void remove(NotificationWindow notification) { public void remove(NotificationWindow notification) {
} }

View File

@ -20,6 +20,7 @@ public class SimpleFileInfo implements FileInfo, Comparable<FileInfo> {
return path; return path;
} }
@Override
public String getName() { public String getName() {
return getNameWithoutExtension(new File(path).getName()); return getNameWithoutExtension(new File(path).getName());
} }
@ -29,6 +30,7 @@ public class SimpleFileInfo implements FileInfo, Comparable<FileInfo> {
return getExtension(path); return getExtension(path);
} }
@Override
public long getLength() { public long getLength() {
return length; return length;
} }

View File

@ -54,6 +54,7 @@ public abstract class AbstractEpisodeListProvider implements EpisodeListProvider
return getSeriesData(searchResult, null, language).getSeriesInfo(); return getSeriesData(searchResult, null, language).getSeriesInfo();
} }
@Override
public SeriesInfo getSeriesInfo(int id, Locale language) throws Exception { public SeriesInfo getSeriesInfo(int id, Locale language) throws Exception {
return getSeriesInfo(createSearchResult(id), language); return getSeriesInfo(createSearchResult(id), language);
} }

View File

@ -131,7 +131,7 @@ public class AcoustIDClient implements MusicIdentificationService {
} }
public AudioTrack parseResult(String json, final int targetDuration) throws IOException { public AudioTrack parseResult(String json, final int targetDuration) throws IOException {
Map<?, ?> data = (Map<?, ?>) JsonReader.jsonToMaps(json); Map<?, ?> data = JsonReader.jsonToMaps(json);
if (!data.get("status").equals("ok")) { if (!data.get("status").equals("ok")) {
throw new IOException("acoustid responded with error: " + data.get("status")); throw new IOException("acoustid responded with error: " + data.get("status"));

View File

@ -371,7 +371,7 @@ public class OpenSubtitlesClient implements SubtitleProvider, VideoHashSubtitleS
// search for movies and series // search for movies and series
List<SubtitleSearchResult> result = getCache().getSearchResult("search", query); List<SubtitleSearchResult> result = getCache().getSearchResult("search", query);
if (result != null) { if (result != null) {
return (List<SubtitleSearchResult>) result; return result;
} }
// require login // require login
@ -469,7 +469,7 @@ public class OpenSubtitlesClient implements SubtitleProvider, VideoHashSubtitleS
@Override @Override
public URI getSubtitleListLink(SubtitleSearchResult searchResult, String languageName) { public URI getSubtitleListLink(SubtitleSearchResult searchResult, String languageName) {
Movie movie = (Movie) searchResult; Movie movie = searchResult;
String sublanguageid = "all"; String sublanguageid = "all";
if (languageName != null) { if (languageName != null) {

View File

@ -334,6 +334,7 @@ public class OpenSubtitlesXmlRpc {
protected Map<?, ?> invoke(String method, Object... arguments) throws XmlRpcFault { protected Map<?, ?> invoke(String method, Object... arguments) throws XmlRpcFault {
try { try {
XmlRpcClient rpc = new XmlRpcClient(getXmlRpcUrl(), false) { XmlRpcClient rpc = new XmlRpcClient(getXmlRpcUrl(), false) {
@Override
public void parse(InputStream input) throws XmlRpcException { public void parse(InputStream input) throws XmlRpcException {
try { try {
super.parse(new GZIPInputStream(input)); super.parse(new GZIPInputStream(input));

View File

@ -9,12 +9,14 @@ import net.filebot.vfs.FileInfo;
public interface SubtitleDescriptor extends FileInfo { public interface SubtitleDescriptor extends FileInfo {
@Override
String getName(); String getName();
String getLanguageName(); String getLanguageName();
@Override
String getType(); String getType();

View File

@ -314,6 +314,7 @@ public class TheTVDBClient extends AbstractEpisodeListProvider {
protected Document getXmlResource(final MirrorType mirrorType, final String path) throws IOException { protected Document getXmlResource(final MirrorType mirrorType, final String path) throws IOException {
CachedXmlResource resource = new CachedXmlResource(path) { CachedXmlResource resource = new CachedXmlResource(path) {
@Override
protected URL getResourceLocation(String path) throws IOException { protected URL getResourceLocation(String path) throws IOException {
return getResourceURL(mirrorType, path); return getResourceURL(mirrorType, path);
}; };