From a8b3e13339ff4c5efbad78e74cdd18dd3af9aec6 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sat, 16 May 2009 16:27:11 +0000 Subject: [PATCH] * cleanup --- source/net/sourceforge/filebot/ResourceManager.java | 4 ++-- source/net/sourceforge/filebot/torrent/BDecoder.java | 10 +++++----- .../sourceforge/filebot/ui/panel/analyze/FileTree.java | 8 +------- .../ui/panel/rename/AutoFetchEpisodeListMatcher.java | 4 ++-- .../filebot/ui/panel/rename/RenameModel.java | 2 +- .../filebot/ui/panel/rename/RenamePanel.java | 9 ++++++--- .../ui/panel/sfv/ChecksumComputationService.java | 3 +-- .../ui/panel/sfv/HighlightPatternCellRenderer.java | 4 ++-- .../ui/panel/subtitle/SubtitlePackagePanel.java | 3 +-- .../net/sourceforge/tuned/ui/ColorTintImageFilter.java | 2 +- .../sourceforge/tuned/ui/FancyTreeCellRenderer.java | 2 +- source/net/sourceforge/tuned/ui/ShadowBorder.java | 5 ++++- .../net/sourceforge/tuned/ui/SimpleLabelProvider.java | 4 ++-- .../tuned/ui/notification/MessageNotification.java | 1 - .../tuned/ui/notification/NotificationLayout.java | 1 - .../tuned/ui/notification/NotificationManager.java | 1 - .../tuned/ui/notification/NotificationWindow.java | 1 - .../tuned/ui/notification/QueueNotificationLayout.java | 1 - .../ui/notification/SimpleNotificationLayout.java | 1 - 19 files changed, 29 insertions(+), 37 deletions(-) diff --git a/source/net/sourceforge/filebot/ResourceManager.java b/source/net/sourceforge/filebot/ResourceManager.java index 7ac4ccd0..f2bf5807 100644 --- a/source/net/sourceforge/filebot/ResourceManager.java +++ b/source/net/sourceforge/filebot/ResourceManager.java @@ -60,8 +60,8 @@ public final class ResourceManager { /** - * Get the URL of an image resource in this jar. Image must be located in - * resources/ and the file type is assumed to be png. + * Get the URL of an image resource in this jar. Image must be located in resources/ and the file type + * is assumed to be png. * * @param name simple name of the resource (without extension) * @return URL of the resource or null if resource does not exist diff --git a/source/net/sourceforge/filebot/torrent/BDecoder.java b/source/net/sourceforge/filebot/torrent/BDecoder.java index 3b7904e2..1e4b167e 100644 --- a/source/net/sourceforge/filebot/torrent/BDecoder.java +++ b/source/net/sourceforge/filebot/torrent/BDecoder.java @@ -1,21 +1,21 @@ /* * BeDecoder.java - * + * * Created on May 30, 2003, 2:44 PM * Copyright (C) 2003, 2004, 2005, 2006 Aelitis, All Rights Reserved. - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * * AELITIS, SAS au capital de 46,603.30 euros * 8 Allee Lenotre, La Grille Royale, 78600 Le Mesnil le Roi, France. */ diff --git a/source/net/sourceforge/filebot/ui/panel/analyze/FileTree.java b/source/net/sourceforge/filebot/ui/panel/analyze/FileTree.java index 3f234f4f..fc2cff9c 100644 --- a/source/net/sourceforge/filebot/ui/panel/analyze/FileTree.java +++ b/source/net/sourceforge/filebot/ui/panel/analyze/FileTree.java @@ -9,7 +9,6 @@ import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.io.File; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Enumeration; @@ -142,11 +141,6 @@ public class FileTree extends JTree { private class OpenAction extends AbstractAction { - public OpenAction(String text, File... files) { - this(text, Arrays.asList(files)); - } - - public OpenAction(String text, Collection files) { super(text); putValue("files", files); @@ -263,7 +257,7 @@ public class FileTree extends JTree { @Override public boolean isLeaf() { - // if we have no children, tell the UI we are a leaf, + // if we have no children, tell the UI we are a leaf, // so that it won't display any good-for-nothing expand buttons return getChildCount() == 0; } diff --git a/source/net/sourceforge/filebot/ui/panel/rename/AutoFetchEpisodeListMatcher.java b/source/net/sourceforge/filebot/ui/panel/rename/AutoFetchEpisodeListMatcher.java index 5b56d8e0..a1917435 100644 --- a/source/net/sourceforge/filebot/ui/panel/rename/AutoFetchEpisodeListMatcher.java +++ b/source/net/sourceforge/filebot/ui/panel/rename/AutoFetchEpisodeListMatcher.java @@ -64,7 +64,7 @@ class AutoFetchEpisodeListMatcher extends SwingWorker> } - protected SearchResult selectSearchResult(String query, Collection searchResults) throws Exception { + protected SearchResult selectSearchResult(String query, List searchResults) throws Exception { // select first by default return searchResults.iterator().next(); } @@ -79,7 +79,7 @@ class AutoFetchEpisodeListMatcher extends SwingWorker> @Override public Collection call() throws Exception { - Collection results = provider.search(seriesName); + List results = provider.search(seriesName); if (results.isEmpty()) { throw new RuntimeException(String.format("'%s' has not been found.", seriesName)); diff --git a/source/net/sourceforge/filebot/ui/panel/rename/RenameModel.java b/source/net/sourceforge/filebot/ui/panel/rename/RenameModel.java index 9ce01043..0ec03b81 100644 --- a/source/net/sourceforge/filebot/ui/panel/rename/RenameModel.java +++ b/source/net/sourceforge/filebot/ui/panel/rename/RenameModel.java @@ -214,7 +214,7 @@ public class RenameModel extends MatchModel { cancel(obsolete); - // Don't update view immediately, to avoid irritating flickering, + // Don't update view immediately, to avoid irritating flickering, // caused by a rapid succession of change events. // The worker may only need a couple of milliseconds to complete, // so the view will be notified of the change soon enough. diff --git a/source/net/sourceforge/filebot/ui/panel/rename/RenamePanel.java b/source/net/sourceforge/filebot/ui/panel/rename/RenamePanel.java index c0769fd1..5b7d4177 100644 --- a/source/net/sourceforge/filebot/ui/panel/rename/RenamePanel.java +++ b/source/net/sourceforge/filebot/ui/panel/rename/RenamePanel.java @@ -3,6 +3,7 @@ package net.sourceforge.filebot.ui.panel.rename; import static net.sourceforge.tuned.ui.LoadingOverlayPane.LOADING_PROPERTY; +import static net.sourceforge.tuned.ui.TunedUtilities.getWindow; import java.awt.Insets; import java.awt.event.ActionEvent; @@ -10,7 +11,6 @@ import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.io.File; import java.util.ArrayList; -import java.util.Collection; import java.util.LinkedList; import java.util.List; import java.util.concurrent.Callable; @@ -297,7 +297,7 @@ public class RenamePanel extends JComponent { @Override - protected SearchResult selectSearchResult(final String query, final Collection searchResults) throws Exception { + protected SearchResult selectSearchResult(final String query, final List searchResults) throws Exception { if (searchResults.size() == 1) { return searchResults.iterator().next(); } @@ -323,8 +323,11 @@ public class RenamePanel extends JComponent { @Override public SearchResult call() throws Exception { + // display only probable matches if any + List selection = probableMatches.isEmpty() ? searchResults : probableMatches; + // multiple results have been found, user must select one - SelectDialog selectDialog = new SelectDialog(SwingUtilities.getWindowAncestor(RenamePanel.this), probableMatches.isEmpty() ? searchResults : probableMatches); + SelectDialog selectDialog = new SelectDialog(getWindow(RenamePanel.this), selection); selectDialog.getHeaderLabel().setText(String.format("Shows matching \"%s\":", query)); diff --git a/source/net/sourceforge/filebot/ui/panel/sfv/ChecksumComputationService.java b/source/net/sourceforge/filebot/ui/panel/sfv/ChecksumComputationService.java index 38b9d473..67b1ccc7 100644 --- a/source/net/sourceforge/filebot/ui/panel/sfv/ChecksumComputationService.java +++ b/source/net/sourceforge/filebot/ui/panel/sfv/ChecksumComputationService.java @@ -56,8 +56,7 @@ class ChecksumComputationService { /** - * Get the number of active executors that are associated with this - * {@link ChecksumComputationService}. + * Get the number of active executors that are associated with this {@link ChecksumComputationService}. * * @return number of active executors * @see {@link #newExecutor()} diff --git a/source/net/sourceforge/filebot/ui/panel/sfv/HighlightPatternCellRenderer.java b/source/net/sourceforge/filebot/ui/panel/sfv/HighlightPatternCellRenderer.java index d79f8fa3..d6024b0a 100644 --- a/source/net/sourceforge/filebot/ui/panel/sfv/HighlightPatternCellRenderer.java +++ b/source/net/sourceforge/filebot/ui/panel/sfv/HighlightPatternCellRenderer.java @@ -29,7 +29,7 @@ class HighlightPatternCellRenderer extends DefaultTableCellRenderer { @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { super.getTableCellRendererComponent(table, value, isSelected, false, row, column); - + // check for error or warning boolean isError = (EnumSet.of(State.ERROR, State.WARNING).contains(table.getValueAt(row, 0))); @@ -71,7 +71,7 @@ class HighlightPatternCellRenderer extends DefaultTableCellRenderer { if (cssFontWeight != null) { replacement.append("font-weight:").append(cssFontWeight).append(';'); - } + } return replacement.append("'>$0").toString(); } diff --git a/source/net/sourceforge/filebot/ui/panel/subtitle/SubtitlePackagePanel.java b/source/net/sourceforge/filebot/ui/panel/subtitle/SubtitlePackagePanel.java index ff9a92d3..d3a512ab 100644 --- a/source/net/sourceforge/filebot/ui/panel/subtitle/SubtitlePackagePanel.java +++ b/source/net/sourceforge/filebot/ui/panel/subtitle/SubtitlePackagePanel.java @@ -76,8 +76,7 @@ public class SubtitlePackagePanel extends JComponent { private static class SubtitlePackageConnector implements ObservableElementList.Connector { /** - * The list which contains the elements being observed via this - * {@link ObservableElementList.Connector}. + * The list which contains the elements being observed via this {@link ObservableElementList.Connector}. */ private ObservableElementList list = null; diff --git a/source/net/sourceforge/tuned/ui/ColorTintImageFilter.java b/source/net/sourceforge/tuned/ui/ColorTintImageFilter.java index 91684985..10ff9dc7 100644 --- a/source/net/sourceforge/tuned/ui/ColorTintImageFilter.java +++ b/source/net/sourceforge/tuned/ui/ColorTintImageFilter.java @@ -30,5 +30,5 @@ public class ColorTintImageFilter extends RGBImageFilter { return new Color(red, green, blue, c.getAlpha()).getRGB(); } - + } diff --git a/source/net/sourceforge/tuned/ui/FancyTreeCellRenderer.java b/source/net/sourceforge/tuned/ui/FancyTreeCellRenderer.java index c3ce173d..713f2eee 100644 --- a/source/net/sourceforge/tuned/ui/FancyTreeCellRenderer.java +++ b/source/net/sourceforge/tuned/ui/FancyTreeCellRenderer.java @@ -44,7 +44,7 @@ public class FancyTreeCellRenderer extends DefaultTreeCellRenderer { super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, false); setIconTextGap(5); - + if (selected) { setPaintGradient(true); setGradientBeginColor(backgroundSelectionColor.brighter()); diff --git a/source/net/sourceforge/tuned/ui/ShadowBorder.java b/source/net/sourceforge/tuned/ui/ShadowBorder.java index d032f9f6..c330e733 100644 --- a/source/net/sourceforge/tuned/ui/ShadowBorder.java +++ b/source/net/sourceforge/tuned/ui/ShadowBorder.java @@ -101,7 +101,10 @@ public class ShadowBorder extends AbstractBorder { private static enum CornerGradientStyle { - TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT; + TOP_LEFT, + TOP_RIGHT, + BOTTOM_LEFT, + BOTTOM_RIGHT; public RadialGradientPaint getGradientPaint(RectangularShape shape, float radius, Color gradientBeginColor, Color gradientEndColor) { Point2D center = null; diff --git a/source/net/sourceforge/tuned/ui/SimpleLabelProvider.java b/source/net/sourceforge/tuned/ui/SimpleLabelProvider.java index ceb19cec..76e78640 100644 --- a/source/net/sourceforge/tuned/ui/SimpleLabelProvider.java +++ b/source/net/sourceforge/tuned/ui/SimpleLabelProvider.java @@ -30,8 +30,8 @@ public class SimpleLabelProvider implements LabelProvider { /** - * Create a new LabelProvider which will use the getText, getName - * or toString method for text and the getIcon method for the + * Create a new LabelProvider which will use the getText, getName or toString + * method for text and the getIcon method for the * icon. * * @param type a class that has one of the text methods and the icon method diff --git a/source/net/sourceforge/tuned/ui/notification/MessageNotification.java b/source/net/sourceforge/tuned/ui/notification/MessageNotification.java index 71b0bd05..d17aee17 100644 --- a/source/net/sourceforge/tuned/ui/notification/MessageNotification.java +++ b/source/net/sourceforge/tuned/ui/notification/MessageNotification.java @@ -1,6 +1,5 @@ /* * Created on 16.03.2005 - * */ package net.sourceforge.tuned.ui.notification; diff --git a/source/net/sourceforge/tuned/ui/notification/NotificationLayout.java b/source/net/sourceforge/tuned/ui/notification/NotificationLayout.java index 1a517115..df030cbc 100644 --- a/source/net/sourceforge/tuned/ui/notification/NotificationLayout.java +++ b/source/net/sourceforge/tuned/ui/notification/NotificationLayout.java @@ -1,6 +1,5 @@ /* * Created on 19.03.2005 - * */ package net.sourceforge.tuned.ui.notification; diff --git a/source/net/sourceforge/tuned/ui/notification/NotificationManager.java b/source/net/sourceforge/tuned/ui/notification/NotificationManager.java index f064adb9..9dc288f1 100644 --- a/source/net/sourceforge/tuned/ui/notification/NotificationManager.java +++ b/source/net/sourceforge/tuned/ui/notification/NotificationManager.java @@ -1,6 +1,5 @@ /* * Created on 19.03.2005 - * */ package net.sourceforge.tuned.ui.notification; diff --git a/source/net/sourceforge/tuned/ui/notification/NotificationWindow.java b/source/net/sourceforge/tuned/ui/notification/NotificationWindow.java index 445c59f3..f49de903 100644 --- a/source/net/sourceforge/tuned/ui/notification/NotificationWindow.java +++ b/source/net/sourceforge/tuned/ui/notification/NotificationWindow.java @@ -1,6 +1,5 @@ /* * Created on 19.03.2005 - * */ package net.sourceforge.tuned.ui.notification; diff --git a/source/net/sourceforge/tuned/ui/notification/QueueNotificationLayout.java b/source/net/sourceforge/tuned/ui/notification/QueueNotificationLayout.java index 66640bfd..3bac7841 100644 --- a/source/net/sourceforge/tuned/ui/notification/QueueNotificationLayout.java +++ b/source/net/sourceforge/tuned/ui/notification/QueueNotificationLayout.java @@ -1,6 +1,5 @@ /* * Created on 19.03.2005 - * */ package net.sourceforge.tuned.ui.notification; diff --git a/source/net/sourceforge/tuned/ui/notification/SimpleNotificationLayout.java b/source/net/sourceforge/tuned/ui/notification/SimpleNotificationLayout.java index 1067c621..b6c0e7d2 100644 --- a/source/net/sourceforge/tuned/ui/notification/SimpleNotificationLayout.java +++ b/source/net/sourceforge/tuned/ui/notification/SimpleNotificationLayout.java @@ -1,6 +1,5 @@ /* * Created on 20.03.2005 - * */ package net.sourceforge.tuned.ui.notification;