From b5bee237d6938b50084f563e105f45cc11f94aff Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sun, 27 Apr 2008 17:36:27 +0000 Subject: [PATCH] * refactored matching * added ProgressDialog for long-running matching * added delayed invokeLater to TunedUtil * removed generics from ListEntry (only subclasses where used anyway) * minor cleanup in notification package --- source/net/sourceforge/filebot/Settings.java | 6 +- .../filebot/ui/FileBotPanelSelectionList.java | 36 ++--- .../filebot/ui/MessageManager.java | 3 +- .../sourceforge/filebot/ui/SelectDialog.java | 8 +- .../ui/panel/rename/FilesRenameList.java | 23 --- .../filebot/ui/panel/rename/MatchAction.java | 146 +++++++++++++----- .../rename/NamesListTransferablePolicy.java | 16 +- .../ui/panel/rename/NamesRenameList.java | 23 --- .../filebot/ui/panel/rename/RenameAction.java | 16 +- .../filebot/ui/panel/rename/RenameList.java | 10 +- .../filebot/ui/panel/rename/RenamePanel.java | 11 +- .../ui/panel/rename/SimilarityPanel.java | 10 +- .../ui/panel/rename/ValidateNamesDialog.java | 6 +- .../panel/rename/entry/AbstractFileEntry.java | 6 +- .../ui/panel/rename/entry/FileEntry.java | 12 +- .../ui/panel/rename/entry/ListEntry.java | 11 +- .../ui/panel/rename/entry/StringEntry.java | 4 +- .../ui/panel/rename/entry/TorrentEntry.java | 14 +- .../filebot/ui/panel/rename/match/Match.java | 10 +- .../ui/panel/rename/match/Matcher.java | 114 ++++++++++---- .../rename/similarity/LengthEqualsMetric.java | 8 +- .../similarity/MultiSimilarityMetric.java | 2 +- .../rename/similarity/SimilarityMetric.java | 2 +- .../rename/similarity/StringEqualsMetric.java | 2 +- .../similarity/StringSimilarityMetric.java | 3 +- .../ui/panel/sfv/TotalProgressPanel.java | 33 ++-- .../tuned/ui/LoadingOverlayPane.java | 31 ++-- .../net/sourceforge/tuned/ui/TunedUtil.java | 21 +++ .../ui/notification/MessageNotification.java | 4 - .../ui/notification/NotificationLayout.java | 4 - .../ui/notification/NotificationManager.java | 21 ++- .../ui/notification/NotificationWindow.java | 66 ++++---- .../notification/QueueNotificationLayout.java | 4 - .../SimpleNotificationLayout.java | 5 - 34 files changed, 376 insertions(+), 315 deletions(-) delete mode 100644 source/net/sourceforge/filebot/ui/panel/rename/FilesRenameList.java delete mode 100644 source/net/sourceforge/filebot/ui/panel/rename/NamesRenameList.java diff --git a/source/net/sourceforge/filebot/Settings.java b/source/net/sourceforge/filebot/Settings.java index 14552516..07faf743 100644 --- a/source/net/sourceforge/filebot/Settings.java +++ b/source/net/sourceforge/filebot/Settings.java @@ -16,18 +16,18 @@ import java.util.prefs.Preferences; public class Settings { - private static Settings settings = new Settings(); - public static final String NAME = "FileBot"; public static final String VERSION = "2.0"; - public static final String ROOT = "filebot"; + public static final String ROOT = NAME.toLowerCase(); public static final String SELECTED_PANEL = "panel"; public static final String SEARCH_HISTORY = "history/search"; public static final String SUBTITLE_HISTORY = "history/subtitle"; public static final String LANGUAGE_HISTORY = "history/language"; + private static Settings settings = new Settings(); + public static Settings getSettings() { return settings; diff --git a/source/net/sourceforge/filebot/ui/FileBotPanelSelectionList.java b/source/net/sourceforge/filebot/ui/FileBotPanelSelectionList.java index 2c486a02..5c823108 100644 --- a/source/net/sourceforge/filebot/ui/FileBotPanelSelectionList.java +++ b/source/net/sourceforge/filebot/ui/FileBotPanelSelectionList.java @@ -9,8 +9,6 @@ import java.awt.dnd.DropTargetAdapter; import java.awt.dnd.DropTargetDragEvent; import java.awt.dnd.DropTargetDropEvent; import java.awt.dnd.DropTargetEvent; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import javax.swing.JList; import javax.swing.ListSelectionModel; @@ -21,6 +19,7 @@ import javax.swing.border.EmptyBorder; import net.sourceforge.tuned.ui.DefaultFancyListCellRenderer; import net.sourceforge.tuned.ui.SimpleListModel; +import net.sourceforge.tuned.ui.TunedUtil; class FileBotPanelSelectionList extends JList { @@ -70,26 +69,13 @@ class FileBotPanelSelectionList extends JList { } - private class DragDropListener extends DropTargetAdapter implements ActionListener { + private class DragDropListener extends DropTargetAdapter { private boolean selectEnabled = false; - private Timer timer = new Timer(SELECTDELAY_ON_DRAG_OVER, this); + private Timer dragEnterTimer; - public DragDropListener() { - timer.setRepeats(false); - } - - - public void actionPerformed(ActionEvent e) { - selectEnabled = true; - - // bring window to front when on dnd - SwingUtilities.getWindowAncestor(FileBotPanelSelectionList.this).toFront(); - } - - @Override public void dragOver(DropTargetDragEvent dtde) { if (selectEnabled) { @@ -101,14 +87,26 @@ class FileBotPanelSelectionList extends JList { @Override public void dragEnter(DropTargetDragEvent dtde) { - timer.start(); + dragEnterTimer = TunedUtil.invokeLater(SELECTDELAY_ON_DRAG_OVER, new Runnable() { + + @Override + public void run() { + selectEnabled = true; + + // bring window to front when on dnd + SwingUtilities.getWindowAncestor(FileBotPanelSelectionList.this).toFront(); + } + }); } @Override public void dragExit(DropTargetEvent dte) { - timer.stop(); selectEnabled = false; + + if (dragEnterTimer != null) { + dragEnterTimer.stop(); + } } diff --git a/source/net/sourceforge/filebot/ui/MessageManager.java b/source/net/sourceforge/filebot/ui/MessageManager.java index 44c8dd5c..195cf903 100644 --- a/source/net/sourceforge/filebot/ui/MessageManager.java +++ b/source/net/sourceforge/filebot/ui/MessageManager.java @@ -5,6 +5,7 @@ package net.sourceforge.filebot.ui; import javax.swing.Icon; import javax.swing.SwingConstants; +import net.sourceforge.filebot.Settings; import net.sourceforge.filebot.resources.ResourceManager; import net.sourceforge.tuned.ui.notification.MessageNotification; import net.sourceforge.tuned.ui.notification.NotificationManager; @@ -28,7 +29,7 @@ public class MessageManager { private static void show(String message, Icon icon, int timeout) { - manager.show(new MessageNotification("FileBot", message, icon, timeout)); + manager.show(new MessageNotification(Settings.NAME, message, icon, timeout)); } } diff --git a/source/net/sourceforge/filebot/ui/SelectDialog.java b/source/net/sourceforge/filebot/ui/SelectDialog.java index 68104656..185b8aff 100644 --- a/source/net/sourceforge/filebot/ui/SelectDialog.java +++ b/source/net/sourceforge/filebot/ui/SelectDialog.java @@ -82,14 +82,10 @@ public class SelectDialog extends JDialog { list.setSelectedIndex(0); // Shortcut Enter - Integer actionMapKey = new Integer(selectAction.hashCode()); - list.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("released ENTER"), actionMapKey); - list.getActionMap().put(actionMapKey, selectAction); + TunedUtil.registerActionForKeystroke(list, KeyStroke.getKeyStroke("released ENTER"), selectAction); // Shortcut Escape - actionMapKey = new Integer(cancelAction.hashCode()); - list.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("released ESCAPE"), actionMapKey); - list.getActionMap().put(actionMapKey, cancelAction); + TunedUtil.registerActionForKeystroke(list, KeyStroke.getKeyStroke("released ESCAPE"), cancelAction); } diff --git a/source/net/sourceforge/filebot/ui/panel/rename/FilesRenameList.java b/source/net/sourceforge/filebot/ui/panel/rename/FilesRenameList.java deleted file mode 100644 index c9a0c4d1..00000000 --- a/source/net/sourceforge/filebot/ui/panel/rename/FilesRenameList.java +++ /dev/null @@ -1,23 +0,0 @@ - -package net.sourceforge.filebot.ui.panel.rename; - - -import java.util.List; - -import net.sourceforge.filebot.ui.panel.rename.entry.FileEntry; - - -class FilesRenameList extends RenameList { - - public FilesRenameList() { - setTitle("Files"); - setTransferablePolicy(new FilesListTransferablePolicy(getModel())); - } - - - @SuppressWarnings("unchecked") - public List getListEntries() { - return (List) getModel().getCopy(); - } - -} diff --git a/source/net/sourceforge/filebot/ui/panel/rename/MatchAction.java b/source/net/sourceforge/filebot/ui/panel/rename/MatchAction.java index 2f6af91d..f5da443a 100644 --- a/source/net/sourceforge/filebot/ui/panel/rename/MatchAction.java +++ b/source/net/sourceforge/filebot/ui/panel/rename/MatchAction.java @@ -6,9 +6,15 @@ import java.awt.Cursor; import java.awt.event.ActionEvent; import java.util.ArrayList; import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.swing.AbstractAction; +import javax.swing.Icon; import javax.swing.SwingUtilities; +import javax.swing.SwingWorker; import net.sourceforge.filebot.resources.ResourceManager; import net.sourceforge.filebot.ui.panel.rename.entry.ListEntry; @@ -16,18 +22,18 @@ import net.sourceforge.filebot.ui.panel.rename.match.Match; import net.sourceforge.filebot.ui.panel.rename.match.Matcher; import net.sourceforge.filebot.ui.panel.rename.similarity.LengthEqualsMetric; import net.sourceforge.filebot.ui.panel.rename.similarity.MultiSimilarityMetric; +import net.sourceforge.filebot.ui.panel.rename.similarity.SimilarityMetric; import net.sourceforge.filebot.ui.panel.rename.similarity.StringEqualsMetric; import net.sourceforge.filebot.ui.panel.rename.similarity.StringSimilarityMetric; +import net.sourceforge.tuned.ui.ProgressDialog; class MatchAction extends AbstractAction { - private NamesRenameList namesList; - private FilesRenameList filesList; - private MultiSimilarityMetric metrics; - private Matcher matcher = new Matcher(); + private final RenameList namesList; + private final RenameList filesList; private boolean matchName2File; @@ -35,7 +41,7 @@ class MatchAction extends AbstractAction { public static final String MATCH_FILES_2_NAMES_DESCRIPTION = "Match files to names"; - public MatchAction(NamesRenameList namesList, FilesRenameList filesList) { + public MatchAction(RenameList namesList, RenameList filesList) { super("Match"); this.namesList = namesList; @@ -71,45 +77,107 @@ class MatchAction extends AbstractAction { } - public void actionPerformed(ActionEvent e) { + public void actionPerformed(ActionEvent evt) { SwingUtilities.getRoot(namesList).setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - List> listA, listB; + RenameList primaryList = matchName2File ? namesList : filesList; + RenameList secondaryList = matchName2File ? filesList : namesList; - if (matchName2File) { - listA = namesList.getListEntries(); - listB = filesList.getListEntries(); - } else { - listB = namesList.getListEntries(); - listA = filesList.getListEntries(); + BackgroundMatcher backgroundMatcher = new BackgroundMatcher(primaryList, secondaryList, metrics); + SwingWorkerProgressMonitor monitor = new SwingWorkerProgressMonitor(SwingUtilities.getWindowAncestor(namesList), backgroundMatcher); + + ProgressDialog progressDialog = monitor.getProgressDialog(); + progressDialog.setTitle("Matching ..."); + progressDialog.setHeader("Matching ..."); + progressDialog.setIcon((Icon) getValue(SMALL_ICON)); + + backgroundMatcher.execute(); + + try { + // wait a for little while (matcher might finish within a few seconds) + backgroundMatcher.get(monitor.getMillisToPopup(), TimeUnit.MILLISECONDS); + } catch (TimeoutException ex) { + // matcher will take longer, stop blocking EDT + progressDialog.setVisible(true); + } catch (Exception e) { + Logger.getLogger(Logger.GLOBAL_LOGGER_NAME).log(Level.SEVERE, e.toString(), e); } - List matches = matcher.match(listA, listB, metrics); - - List> names = new ArrayList>(); - List> files = new ArrayList>(); - - for (Match match : matches) { - ListEntry a, b; - - if (matchName2File) { - a = match.getA(); - b = match.getB(); - } else { - b = match.getA(); - a = match.getB(); - } - - if (a != null) - names.add(a); - - if (b != null) - files.add(b); - } - - namesList.getModel().set(names); - filesList.getModel().set(files); - SwingUtilities.getRoot(namesList).setCursor(Cursor.getDefaultCursor()); } + + + private class BackgroundMatcher extends SwingWorker, Object> { + + private final RenameList primaryList; + private final RenameList secondaryList; + + private final Matcher matcher; + + + public BackgroundMatcher(RenameList primaryList, RenameList secondaryList, SimilarityMetric similarityMetric) { + this.primaryList = primaryList; + this.secondaryList = secondaryList; + + matcher = new Matcher(primaryList.getEntries(), secondaryList.getEntries(), similarityMetric); + } + + + @Override + protected List doInBackground() throws Exception { + int total = matcher.remaining(); + + List matches = new ArrayList(total); + + while (matcher.hasNext() && !isCancelled()) { + firePropertyChange(SwingWorkerProgressMonitor.PROPERTY_NOTE, null, getNote()); + + matches.add(matcher.next()); + + setProgress((matches.size() * 100) / total); + firePropertyChange(SwingWorkerProgressMonitor.PROPERTY_PROGRESS_STRING, null, String.format("%d / %d", matches.size(), total)); + } + + return matches; + } + + + private String getNote() { + ListEntry current = matcher.getFirstPrimaryEntry(); + + if (current == null) + current = matcher.getFirstSecondaryEntry(); + + if (current == null) + return ""; + + return current.getName(); + } + + + @Override + protected void done() { + if (isCancelled()) + return; + + try { + List matches = get(); + + primaryList.getModel().clear(); + secondaryList.getModel().clear(); + + for (Match match : matches) { + if (match.getA() != null) + primaryList.getModel().add(match.getA()); + + if (match.getB() != null) + secondaryList.getModel().add(match.getB()); + } + } catch (Exception e) { + Logger.getLogger(Logger.GLOBAL_LOGGER_NAME).log(Level.SEVERE, e.toString(), e); + } + } + + } + } diff --git a/source/net/sourceforge/filebot/ui/panel/rename/NamesListTransferablePolicy.java b/source/net/sourceforge/filebot/ui/panel/rename/NamesListTransferablePolicy.java index 7f5140a6..2b1ffb8d 100644 --- a/source/net/sourceforge/filebot/ui/panel/rename/NamesListTransferablePolicy.java +++ b/source/net/sourceforge/filebot/ui/panel/rename/NamesListTransferablePolicy.java @@ -25,10 +25,10 @@ import net.sourceforge.filebot.ui.transferablepolicies.TextTransferablePolicy; class NamesListTransferablePolicy extends MultiTransferablePolicy { - private final NamesRenameList list; + private final RenameList list; - public NamesListTransferablePolicy(NamesRenameList list) { + public NamesListTransferablePolicy(RenameList list) { this.list = list; addPolicy(new FilePolicy()); @@ -36,10 +36,10 @@ class NamesListTransferablePolicy extends MultiTransferablePolicy { } - private void submit(List> entries) { - List> invalidEntries = new ArrayList>(); + private void submit(List entries) { + List invalidEntries = new ArrayList(); - for (ListEntry entry : entries) { + for (ListEntry entry : entries) { if (FileBotUtil.isInvalidFileName(entry.getName())) invalidEntries.add(entry); } @@ -90,7 +90,7 @@ class NamesListTransferablePolicy extends MultiTransferablePolicy { private void loadListFiles(List files) { try { - List> entries = new ArrayList>(); + List entries = new ArrayList(); for (File file : files) { BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file))); @@ -115,7 +115,7 @@ class NamesListTransferablePolicy extends MultiTransferablePolicy { private void loadTorrentFiles(List files) { try { - List> entries = new ArrayList>(); + List entries = new ArrayList(); for (File file : files) { Torrent torrent = new Torrent(file); @@ -144,7 +144,7 @@ class NamesListTransferablePolicy extends MultiTransferablePolicy { @Override protected void load(String text) { - List> entries = new ArrayList>(); + List entries = new ArrayList(); String[] lines = text.split("\n"); diff --git a/source/net/sourceforge/filebot/ui/panel/rename/NamesRenameList.java b/source/net/sourceforge/filebot/ui/panel/rename/NamesRenameList.java deleted file mode 100644 index f6978bed..00000000 --- a/source/net/sourceforge/filebot/ui/panel/rename/NamesRenameList.java +++ /dev/null @@ -1,23 +0,0 @@ - -package net.sourceforge.filebot.ui.panel.rename; - - -import java.util.List; - -import net.sourceforge.filebot.ui.panel.rename.entry.ListEntry; - - -class NamesRenameList extends RenameList { - - public NamesRenameList() { - setTitle("Names"); - setTransferablePolicy(new NamesListTransferablePolicy(this)); - } - - - @SuppressWarnings("unchecked") - public List> getListEntries() { - return (List>) getModel().getCopy(); - } - -} diff --git a/source/net/sourceforge/filebot/ui/panel/rename/RenameAction.java b/source/net/sourceforge/filebot/ui/panel/rename/RenameAction.java index a655d87a..7c1deebb 100644 --- a/source/net/sourceforge/filebot/ui/panel/rename/RenameAction.java +++ b/source/net/sourceforge/filebot/ui/panel/rename/RenameAction.java @@ -18,12 +18,11 @@ import net.sourceforge.filebot.ui.panel.rename.entry.ListEntry; public class RenameAction extends AbstractAction { - private NamesRenameList namesList; - - private FilesRenameList filesList; + private final RenameList namesList; + private final RenameList filesList; - public RenameAction(NamesRenameList namesList, FilesRenameList filesList) { + public RenameAction(RenameList namesList, RenameList filesList) { super("Rename", ResourceManager.getIcon("action.rename")); this.namesList = namesList; this.filesList = filesList; @@ -33,8 +32,8 @@ public class RenameAction extends AbstractAction { public void actionPerformed(ActionEvent e) { - List> nameEntries = namesList.getListEntries(); - List fileEntries = filesList.getListEntries(); + List nameEntries = namesList.getEntries(); + List fileEntries = filesList.getEntries(); int minLength = Math.min(nameEntries.size(), fileEntries.size()); @@ -42,8 +41,8 @@ public class RenameAction extends AbstractAction { int errors = 0; for (i = 0; i < minLength; i++) { - FileEntry fileEntry = fileEntries.get(i); - File f = fileEntry.getValue(); + FileEntry fileEntry = (FileEntry) fileEntries.get(i); + File f = fileEntry.getFile(); String newName = nameEntries.get(i).toString() + FileFormat.getExtension(f, true); @@ -64,5 +63,4 @@ public class RenameAction extends AbstractAction { namesList.repaint(); filesList.repaint(); } - } diff --git a/source/net/sourceforge/filebot/ui/panel/rename/RenameList.java b/source/net/sourceforge/filebot/ui/panel/rename/RenameList.java index b44cbed7..e8c018d7 100644 --- a/source/net/sourceforge/filebot/ui/panel/rename/RenameList.java +++ b/source/net/sourceforge/filebot/ui/panel/rename/RenameList.java @@ -6,6 +6,7 @@ import java.awt.BorderLayout; import java.awt.event.ActionEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import java.util.List; import javax.swing.AbstractAction; import javax.swing.Box; @@ -17,10 +18,11 @@ import javax.swing.border.EmptyBorder; import net.sourceforge.filebot.resources.ResourceManager; import net.sourceforge.filebot.ui.FileBotList; +import net.sourceforge.filebot.ui.panel.rename.entry.ListEntry; import net.sourceforge.filebot.ui.transfer.LoadAction; -abstract class RenameList extends FileBotList { +class RenameList extends FileBotList { public RenameList() { super(true, false, true); @@ -46,6 +48,12 @@ abstract class RenameList extends FileBotList { viewport.setBackground(list.getBackground()); } + + @SuppressWarnings("unchecked") + public List getEntries() { + return (List) getModel().getCopy(); + } + private final AbstractAction upAction = new AbstractAction(null, ResourceManager.getIcon("action.up")) { public void actionPerformed(ActionEvent e) { diff --git a/source/net/sourceforge/filebot/ui/panel/rename/RenamePanel.java b/source/net/sourceforge/filebot/ui/panel/rename/RenamePanel.java index bed48ac3..ea9caa31 100644 --- a/source/net/sourceforge/filebot/ui/panel/rename/RenamePanel.java +++ b/source/net/sourceforge/filebot/ui/panel/rename/RenamePanel.java @@ -31,9 +31,8 @@ import net.sourceforge.filebot.ui.FileBotPanel; public class RenamePanel extends FileBotPanel { - private NamesRenameList namesList = new NamesRenameList(); - - private FilesRenameList filesList = new FilesRenameList(); + private RenameList namesList = new RenameList(); + private RenameList filesList = new RenameList(); private MatchAction matchAction = new MatchAction(namesList, filesList); @@ -47,6 +46,12 @@ public class RenamePanel extends FileBotPanel { public RenamePanel() { super("Rename", ResourceManager.getIcon("panel.rename")); + namesList.setTitle("Names"); + namesList.setTransferablePolicy(new NamesListTransferablePolicy(namesList)); + + filesList.setTitle("Files"); + filesList.setTransferablePolicy(new FilesListTransferablePolicy(filesList.getModel())); + RenameListCellRenderer cellrenderer = new RenameListCellRenderer(namesList.getModel(), filesList.getModel()); namesList.getListComponent().setCellRenderer(cellrenderer); diff --git a/source/net/sourceforge/filebot/ui/panel/rename/SimilarityPanel.java b/source/net/sourceforge/filebot/ui/panel/rename/SimilarityPanel.java index 0e054eb3..31f1f574 100644 --- a/source/net/sourceforge/filebot/ui/panel/rename/SimilarityPanel.java +++ b/source/net/sourceforge/filebot/ui/panel/rename/SimilarityPanel.java @@ -118,14 +118,14 @@ class SimilarityPanel extends Box { fileList.removeListSelectionListener(updateMetricsListener); } - private ListEntry lastListEntryA = null; + private ListEntry lastListEntryA = null; - private ListEntry lastListEntryB = null; + private ListEntry lastListEntryB = null; public void updateMetrics() { - ListEntry a = (ListEntry) nameList.getSelectedValue(); - ListEntry b = (ListEntry) fileList.getSelectedValue(); + ListEntry a = (ListEntry) nameList.getSelectedValue(); + ListEntry b = (ListEntry) fileList.getSelectedValue(); if ((a == lastListEntryA) && (b == lastListEntryB)) return; @@ -170,7 +170,7 @@ class SimilarityPanel extends Box { } - public void update(ListEntry a, ListEntry b) { + public void update(ListEntry a, ListEntry b) { value.setText(numberFormat.format(metric.getSimilarity(a, b))); } diff --git a/source/net/sourceforge/filebot/ui/panel/rename/ValidateNamesDialog.java b/source/net/sourceforge/filebot/ui/panel/rename/ValidateNamesDialog.java index daa591ef..52c7a4de 100644 --- a/source/net/sourceforge/filebot/ui/panel/rename/ValidateNamesDialog.java +++ b/source/net/sourceforge/filebot/ui/panel/rename/ValidateNamesDialog.java @@ -35,7 +35,7 @@ import net.sourceforge.tuned.ui.TunedUtil; public class ValidateNamesDialog extends JDialog { - private final List> entries; + private final List entries; private boolean cancelled = true; @@ -44,7 +44,7 @@ public class ValidateNamesDialog extends JDialog { private final CancelAction cancelAction = new CancelAction(); - public ValidateNamesDialog(Window owner, List> entries) { + public ValidateNamesDialog(Window owner, List entries) { super(owner, "Invalid Names", ModalityType.DOCUMENT_MODAL); this.entries = entries; @@ -116,7 +116,7 @@ public class ValidateNamesDialog extends JDialog { @Override public void actionPerformed(ActionEvent e) { - for (ListEntry entry : entries) { + for (ListEntry entry : entries) { String validatedName = FileBotUtil.validateFileName(entry.getName()); entry.setName(validatedName); } diff --git a/source/net/sourceforge/filebot/ui/panel/rename/entry/AbstractFileEntry.java b/source/net/sourceforge/filebot/ui/panel/rename/entry/AbstractFileEntry.java index b1125794..0ae8bb5c 100644 --- a/source/net/sourceforge/filebot/ui/panel/rename/entry/AbstractFileEntry.java +++ b/source/net/sourceforge/filebot/ui/panel/rename/entry/AbstractFileEntry.java @@ -2,10 +2,10 @@ package net.sourceforge.filebot.ui.panel.rename.entry; -public abstract class AbstractFileEntry extends ListEntry { +public abstract class AbstractFileEntry extends ListEntry { - public AbstractFileEntry(String name, T value) { - super(name, value); + public AbstractFileEntry(String name) { + super(name); } diff --git a/source/net/sourceforge/filebot/ui/panel/rename/entry/FileEntry.java b/source/net/sourceforge/filebot/ui/panel/rename/entry/FileEntry.java index 6f551030..79df0f8c 100644 --- a/source/net/sourceforge/filebot/ui/panel/rename/entry/FileEntry.java +++ b/source/net/sourceforge/filebot/ui/panel/rename/entry/FileEntry.java @@ -7,15 +7,18 @@ import java.io.File; import net.sourceforge.filebot.FileFormat; -public class FileEntry extends AbstractFileEntry { +public class FileEntry extends AbstractFileEntry { + + private final File file; private final long length; private final String type; public FileEntry(File file) { - super(FileFormat.getFileName(file), file); + super(FileFormat.getFileName(file)); + this.file = file; this.length = file.length(); this.type = FileFormat.getFileType(file); } @@ -30,4 +33,9 @@ public class FileEntry extends AbstractFileEntry { public String getType() { return type; } + + + public File getFile() { + return file; + } } diff --git a/source/net/sourceforge/filebot/ui/panel/rename/entry/ListEntry.java b/source/net/sourceforge/filebot/ui/panel/rename/entry/ListEntry.java index 095f7086..532c86a5 100644 --- a/source/net/sourceforge/filebot/ui/panel/rename/entry/ListEntry.java +++ b/source/net/sourceforge/filebot/ui/panel/rename/entry/ListEntry.java @@ -2,15 +2,13 @@ package net.sourceforge.filebot.ui.panel.rename.entry; -public class ListEntry { +public class ListEntry { private String name; - private T value; - public ListEntry(String name, T value) { + public ListEntry(String name) { this.name = name; - this.value = value; } @@ -24,11 +22,6 @@ public class ListEntry { } - public T getValue() { - return value; - } - - @Override public String toString() { return getName(); diff --git a/source/net/sourceforge/filebot/ui/panel/rename/entry/StringEntry.java b/source/net/sourceforge/filebot/ui/panel/rename/entry/StringEntry.java index e8d6ea4c..5ed4418d 100644 --- a/source/net/sourceforge/filebot/ui/panel/rename/entry/StringEntry.java +++ b/source/net/sourceforge/filebot/ui/panel/rename/entry/StringEntry.java @@ -2,10 +2,10 @@ package net.sourceforge.filebot.ui.panel.rename.entry; -public class StringEntry extends ListEntry { +public class StringEntry extends ListEntry { public StringEntry(String string) { - super(string, string); + super(string); } } diff --git a/source/net/sourceforge/filebot/ui/panel/rename/entry/TorrentEntry.java b/source/net/sourceforge/filebot/ui/panel/rename/entry/TorrentEntry.java index d1496f8f..ad761eba 100644 --- a/source/net/sourceforge/filebot/ui/panel/rename/entry/TorrentEntry.java +++ b/source/net/sourceforge/filebot/ui/panel/rename/entry/TorrentEntry.java @@ -3,20 +3,24 @@ package net.sourceforge.filebot.ui.panel.rename.entry; import net.sourceforge.filebot.FileFormat; -import net.sourceforge.filebot.torrent.Torrent; import net.sourceforge.filebot.torrent.Torrent.Entry; -public class TorrentEntry extends AbstractFileEntry { +public class TorrentEntry extends AbstractFileEntry { - public TorrentEntry(Entry value) { - super(FileFormat.getNameWithoutExtension(value.getName()), value); + private final Entry entry; + + + public TorrentEntry(Entry entry) { + super(FileFormat.getNameWithoutExtension(entry.getName())); + + this.entry = entry; } @Override public long getLength() { - return getValue().getLength(); + return entry.getLength(); } } diff --git a/source/net/sourceforge/filebot/ui/panel/rename/match/Match.java b/source/net/sourceforge/filebot/ui/panel/rename/match/Match.java index 49e4b519..aa6495c5 100644 --- a/source/net/sourceforge/filebot/ui/panel/rename/match/Match.java +++ b/source/net/sourceforge/filebot/ui/panel/rename/match/Match.java @@ -7,22 +7,22 @@ import net.sourceforge.filebot.ui.panel.rename.entry.ListEntry; public class Match { - private ListEntry a; - private ListEntry b; + private final ListEntry a; + private final ListEntry b; - public Match(ListEntry a, ListEntry b) { + public Match(ListEntry a, ListEntry b) { this.a = a; this.b = b; } - public ListEntry getA() { + public ListEntry getA() { return a; } - public ListEntry getB() { + public ListEntry getB() { return b; } diff --git a/source/net/sourceforge/filebot/ui/panel/rename/match/Matcher.java b/source/net/sourceforge/filebot/ui/panel/rename/match/Matcher.java index dbfc4610..0580cdf7 100644 --- a/source/net/sourceforge/filebot/ui/panel/rename/match/Matcher.java +++ b/source/net/sourceforge/filebot/ui/panel/rename/match/Matcher.java @@ -2,43 +2,97 @@ package net.sourceforge.filebot.ui.panel.rename.match; -import java.util.ArrayList; +import java.util.Iterator; +import java.util.LinkedList; import java.util.List; import net.sourceforge.filebot.ui.panel.rename.entry.ListEntry; import net.sourceforge.filebot.ui.panel.rename.similarity.SimilarityMetric; -public class Matcher { +public class Matcher implements Iterable, Iterator { - public List match(List> listA, List> listB, SimilarityMetric similarityMetric) { - List matches = new ArrayList(); - - for (ListEntry entryA : listA) { - float maxSimilarity = -1; - ListEntry mostSimilarEntry = null; - - for (ListEntry entryB : listB) { - float similarity = similarityMetric.getSimilarity(entryA, entryB); - - if (similarity > maxSimilarity) { - maxSimilarity = similarity; - mostSimilarEntry = entryB; - } - } - - if (mostSimilarEntry != null) { - listB.remove(mostSimilarEntry); - } - - matches.add(new Match(entryA, mostSimilarEntry)); - } - - for (ListEntry entryB : listB) { - matches.add(new Match(null, entryB)); - } - - return matches; + private final LinkedList primaryList; + private final LinkedList secondaryList; + private final SimilarityMetric similarityMetric; + + + public Matcher(List primaryList, List secondaryList, SimilarityMetric similarityMetric) { + this.primaryList = new LinkedList(primaryList); + this.secondaryList = new LinkedList(secondaryList); + this.similarityMetric = similarityMetric; } + + @Override + public Iterator iterator() { + return this; + } + + + @Override + public boolean hasNext() { + return !primaryList.isEmpty() || !secondaryList.isEmpty(); + } + + + @Override + public Match next() { + if (primaryList.isEmpty()) { + return new Match(null, secondaryList.removeFirst()); + } + + ListEntry primaryEntry = primaryList.removeFirst(); + + float maxSimilarity = -1; + ListEntry mostSimilarSecondaryEntry = null; + + for (ListEntry secondaryEntry : secondaryList) { + float similarity = similarityMetric.getSimilarity(primaryEntry, secondaryEntry); + + if (similarity > maxSimilarity) { + maxSimilarity = similarity; + mostSimilarSecondaryEntry = secondaryEntry; + } + } + + if (mostSimilarSecondaryEntry != null) { + secondaryList.remove(mostSimilarSecondaryEntry); + } + + return new Match(primaryEntry, mostSimilarSecondaryEntry); + } + + + public ListEntry getFirstPrimaryEntry() { + if (primaryList.isEmpty()) + return null; + + return primaryList.getFirst(); + } + + + public ListEntry getFirstSecondaryEntry() { + if (secondaryList.isEmpty()) + return null; + + return secondaryList.getFirst(); + } + + + public int remaining() { + return Math.max(primaryList.size(), secondaryList.size()); + } + + + /** + * The remove operation is not supported by this implementation of Iterator. + * + * @throws UnsupportedOperationException if this method is invoked. + * @see java.util.Iterator + */ + @Override + public void remove() { + throw new UnsupportedOperationException(); + } } diff --git a/source/net/sourceforge/filebot/ui/panel/rename/similarity/LengthEqualsMetric.java b/source/net/sourceforge/filebot/ui/panel/rename/similarity/LengthEqualsMetric.java index 450664a3..4f889dfb 100644 --- a/source/net/sourceforge/filebot/ui/panel/rename/similarity/LengthEqualsMetric.java +++ b/source/net/sourceforge/filebot/ui/panel/rename/similarity/LengthEqualsMetric.java @@ -9,10 +9,10 @@ import net.sourceforge.filebot.ui.panel.rename.entry.ListEntry; public class LengthEqualsMetric extends SimilarityMetric { @Override - public float getSimilarity(ListEntry a, ListEntry b) { - if (a instanceof AbstractFileEntry && b instanceof AbstractFileEntry) { - long lengthA = ((AbstractFileEntry) a).getLength(); - long lengthB = ((AbstractFileEntry) b).getLength(); + public float getSimilarity(ListEntry a, ListEntry b) { + if ((a instanceof AbstractFileEntry) && (b instanceof AbstractFileEntry)) { + long lengthA = ((AbstractFileEntry) a).getLength(); + long lengthB = ((AbstractFileEntry) b).getLength(); if (lengthA == lengthB) return 1; diff --git a/source/net/sourceforge/filebot/ui/panel/rename/similarity/MultiSimilarityMetric.java b/source/net/sourceforge/filebot/ui/panel/rename/similarity/MultiSimilarityMetric.java index cb12acf6..1503c0cc 100644 --- a/source/net/sourceforge/filebot/ui/panel/rename/similarity/MultiSimilarityMetric.java +++ b/source/net/sourceforge/filebot/ui/panel/rename/similarity/MultiSimilarityMetric.java @@ -20,7 +20,7 @@ public class MultiSimilarityMetric extends SimilarityMetric implements Iterable< @Override - public float getSimilarity(ListEntry a, ListEntry b) { + public float getSimilarity(ListEntry a, ListEntry b) { float similarity = 0; for (SimilarityMetric metric : similarityMetrics) { diff --git a/source/net/sourceforge/filebot/ui/panel/rename/similarity/SimilarityMetric.java b/source/net/sourceforge/filebot/ui/panel/rename/similarity/SimilarityMetric.java index b3e6213d..44a1303c 100644 --- a/source/net/sourceforge/filebot/ui/panel/rename/similarity/SimilarityMetric.java +++ b/source/net/sourceforge/filebot/ui/panel/rename/similarity/SimilarityMetric.java @@ -7,7 +7,7 @@ import net.sourceforge.filebot.ui.panel.rename.entry.ListEntry; public abstract class SimilarityMetric { - public abstract float getSimilarity(ListEntry a, ListEntry b); + public abstract float getSimilarity(ListEntry a, ListEntry b); public abstract String getDescription(); diff --git a/source/net/sourceforge/filebot/ui/panel/rename/similarity/StringEqualsMetric.java b/source/net/sourceforge/filebot/ui/panel/rename/similarity/StringEqualsMetric.java index 7f2455e7..36293c3f 100644 --- a/source/net/sourceforge/filebot/ui/panel/rename/similarity/StringEqualsMetric.java +++ b/source/net/sourceforge/filebot/ui/panel/rename/similarity/StringEqualsMetric.java @@ -8,7 +8,7 @@ import net.sourceforge.filebot.ui.panel.rename.entry.ListEntry; public class StringEqualsMetric extends SimilarityMetric { @Override - public float getSimilarity(ListEntry a, ListEntry b) { + public float getSimilarity(ListEntry a, ListEntry b) { if (a.getName().equalsIgnoreCase(b.getName())) { return 1; } diff --git a/source/net/sourceforge/filebot/ui/panel/rename/similarity/StringSimilarityMetric.java b/source/net/sourceforge/filebot/ui/panel/rename/similarity/StringSimilarityMetric.java index 576d0bdf..1025aea9 100644 --- a/source/net/sourceforge/filebot/ui/panel/rename/similarity/StringSimilarityMetric.java +++ b/source/net/sourceforge/filebot/ui/panel/rename/similarity/StringSimilarityMetric.java @@ -3,7 +3,6 @@ package net.sourceforge.filebot.ui.panel.rename.similarity; import net.sourceforge.filebot.ui.panel.rename.entry.ListEntry; - import uk.ac.shef.wit.simmetrics.similaritymetrics.AbstractStringMetric; import uk.ac.shef.wit.simmetrics.similaritymetrics.MongeElkan; @@ -24,7 +23,7 @@ public class StringSimilarityMetric extends SimilarityMetric { @Override - public float getSimilarity(ListEntry a, ListEntry b) { + public float getSimilarity(ListEntry a, ListEntry b) { return metric.getSimilarity(a.getName(), b.getName()); } diff --git a/source/net/sourceforge/filebot/ui/panel/sfv/TotalProgressPanel.java b/source/net/sourceforge/filebot/ui/panel/sfv/TotalProgressPanel.java index 058bd871..be364d3e 100644 --- a/source/net/sourceforge/filebot/ui/panel/sfv/TotalProgressPanel.java +++ b/source/net/sourceforge/filebot/ui/panel/sfv/TotalProgressPanel.java @@ -2,8 +2,6 @@ package net.sourceforge.filebot.ui.panel.sfv; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; @@ -11,12 +9,15 @@ import javax.swing.BorderFactory; import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.JProgressBar; -import javax.swing.Timer; import javax.swing.border.Border; +import net.sourceforge.tuned.ui.TunedUtil; + class TotalProgressPanel extends Box { + private int millisToSetVisible = 200; + private JProgressBar progressBar = new JProgressBar(0, 0); @@ -49,7 +50,13 @@ class TotalProgressPanel extends Box { Boolean active = (Boolean) evt.getNewValue(); if (active) { - new SetVisibleTimer().start(); + TunedUtil.invokeLater(millisToSetVisible, new Runnable() { + + @Override + public void run() { + setVisible(ChecksumComputationService.getService().isActive()); + } + }); } } else if (property == ChecksumComputationService.REMAINING_TASK_COUNT_PROPERTY) { @@ -68,22 +75,4 @@ class TotalProgressPanel extends Box { } }; - - private class SetVisibleTimer extends Timer implements ActionListener { - - private static final int millisToSetVisible = 200; - - - public SetVisibleTimer() { - super(millisToSetVisible, null); - addActionListener(this); - setRepeats(false); - } - - - public void actionPerformed(ActionEvent e) { - setVisible(ChecksumComputationService.getService().isActive()); - } - } - } diff --git a/source/net/sourceforge/tuned/ui/LoadingOverlayPane.java b/source/net/sourceforge/tuned/ui/LoadingOverlayPane.java index 7092fe00..b40b7f60 100644 --- a/source/net/sourceforge/tuned/ui/LoadingOverlayPane.java +++ b/source/net/sourceforge/tuned/ui/LoadingOverlayPane.java @@ -2,8 +2,6 @@ package net.sourceforge.tuned.ui; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; @@ -13,7 +11,6 @@ import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.JScrollPane; import javax.swing.OverlayLayout; -import javax.swing.Timer; public class LoadingOverlayPane extends JComponent { @@ -77,29 +74,21 @@ public class LoadingOverlayPane extends JComponent { overlayEnabled = b; if (overlayEnabled) { - new OverlayTimer().start(); + TunedUtil.invokeLater(millisToOverlay, new Runnable() { + + @Override + public void run() { + if (overlayEnabled) { + loadingLabel.setVisible(true); + } + } + + }); } else { loadingLabel.setVisible(false); } } - - private class OverlayTimer extends Timer implements ActionListener { - - public OverlayTimer() { - super(millisToOverlay, null); - addActionListener(this); - setRepeats(false); - } - - - public void actionPerformed(ActionEvent e) { - if (overlayEnabled) { - loadingLabel.setVisible(true); - } - } - } - private final PropertyChangeListener loadingListener = new PropertyChangeListener() { @Override diff --git a/source/net/sourceforge/tuned/ui/TunedUtil.java b/source/net/sourceforge/tuned/ui/TunedUtil.java index 462feef3..f82e90a3 100644 --- a/source/net/sourceforge/tuned/ui/TunedUtil.java +++ b/source/net/sourceforge/tuned/ui/TunedUtil.java @@ -5,11 +5,14 @@ package net.sourceforge.tuned.ui; import java.awt.Dimension; import java.awt.Point; import java.awt.Window; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import javax.swing.Action; import javax.swing.JComponent; import javax.swing.JDialog; import javax.swing.KeyStroke; +import javax.swing.Timer; public class TunedUtil { @@ -32,4 +35,22 @@ public class TunedUtil { return new Point(p.x + d.width / 4, p.y + d.height / 7); } + + + public static Timer invokeLater(int delay, final Runnable runnable) { + Timer timer = new Timer(delay, new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + runnable.run(); + } + + }); + + timer.setRepeats(false); + timer.start(); + + return timer; + } + } diff --git a/source/net/sourceforge/tuned/ui/notification/MessageNotification.java b/source/net/sourceforge/tuned/ui/notification/MessageNotification.java index 30dd22b8..71b0bd05 100644 --- a/source/net/sourceforge/tuned/ui/notification/MessageNotification.java +++ b/source/net/sourceforge/tuned/ui/notification/MessageNotification.java @@ -21,10 +21,6 @@ import javax.swing.SwingConstants; import javax.swing.border.Border; -/** - * @author Reinhard - * - */ public class MessageNotification extends NotificationWindow { public MessageNotification(String head, String text, Icon icon, int timeout) { diff --git a/source/net/sourceforge/tuned/ui/notification/NotificationLayout.java b/source/net/sourceforge/tuned/ui/notification/NotificationLayout.java index 4f430e21..1a517115 100644 --- a/source/net/sourceforge/tuned/ui/notification/NotificationLayout.java +++ b/source/net/sourceforge/tuned/ui/notification/NotificationLayout.java @@ -6,10 +6,6 @@ package net.sourceforge.tuned.ui.notification; -/** - * @author Reinhard - * - */ public interface NotificationLayout { public void add(NotificationWindow notification); diff --git a/source/net/sourceforge/tuned/ui/notification/NotificationManager.java b/source/net/sourceforge/tuned/ui/notification/NotificationManager.java index 3fdc747e..e3a49428 100644 --- a/source/net/sourceforge/tuned/ui/notification/NotificationManager.java +++ b/source/net/sourceforge/tuned/ui/notification/NotificationManager.java @@ -6,14 +6,10 @@ package net.sourceforge.tuned.ui.notification; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; -/** - * @author Reinhard - * - */ public class NotificationManager { private NotificationLayout layout; @@ -43,13 +39,13 @@ public class NotificationManager { if (layout == null) return; - notification.addWindowListener(new RemoveListener(layout)); + notification.addComponentListener(new RemoveListener(layout)); layout.add(notification); notification.setVisible(true); } - private static class RemoveListener extends WindowAdapter { + private static class RemoveListener extends ComponentAdapter { private NotificationLayout layout; @@ -59,10 +55,11 @@ public class NotificationManager { } - public void windowClosing(WindowEvent e) { - NotificationWindow n = (NotificationWindow) e.getSource(); - layout.remove(n); - n.dispose(); + @Override + public void componentHidden(ComponentEvent e) { + NotificationWindow window = (NotificationWindow) e.getSource(); + layout.remove(window); + window.dispose(); } } diff --git a/source/net/sourceforge/tuned/ui/notification/NotificationWindow.java b/source/net/sourceforge/tuned/ui/notification/NotificationWindow.java index d363dbcc..b0039b6e 100644 --- a/source/net/sourceforge/tuned/ui/notification/NotificationWindow.java +++ b/source/net/sourceforge/tuned/ui/notification/NotificationWindow.java @@ -7,25 +7,21 @@ package net.sourceforge.tuned.ui.notification; import java.awt.Window; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; +import java.awt.event.ComponentListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; import javax.swing.JWindow; -import javax.swing.SwingUtilities; import javax.swing.Timer; +import net.sourceforge.tuned.ui.TunedUtil; + -/** - * @author Reinhard - * - */ public class NotificationWindow extends JWindow { - private Timer timer; + private int timeout; public NotificationWindow(Window owner, int timeout) { @@ -35,6 +31,8 @@ public class NotificationWindow extends JWindow { public NotificationWindow(Window owner, int timeout, boolean closeOnClick) { super(owner); + this.timeout = timeout; + setAlwaysOnTop(true); if (closeOnClick) @@ -42,19 +40,7 @@ public class NotificationWindow extends JWindow { getGlassPane().setVisible(true); - if (timeout >= 0) { - ActionListener doClose = new ActionListener() { - - public void actionPerformed(ActionEvent e) { - close(); - } - }; - - timer = new Timer(timeout, doClose); - timer.setRepeats(false); - - addWindowListener(windowListener); - } + addComponentListener(visibleListener); } @@ -74,33 +60,43 @@ public class NotificationWindow extends JWindow { public final void close() { - processWindowEvent(new WindowEvent(this, WindowEvent.WINDOW_CLOSING)); + setVisible(false); - SwingUtilities.invokeLater(new Runnable() { - - public void run() { - dispose(); - } - }); + // component hidden is not fired automatically + processComponentEvent(new ComponentEvent(this, ComponentEvent.COMPONENT_HIDDEN)); } - private WindowAdapter windowListener = new WindowAdapter() { + private ComponentListener visibleListener = new ComponentAdapter() { + + private Timer timer; + @Override - public void windowOpened(WindowEvent e) { - timer.start(); + public void componentShown(ComponentEvent e) { + if (timeout >= 0) { + timer = TunedUtil.invokeLater(timeout, new Runnable() { + + @Override + public void run() { + close(); + } + }); + } } @Override - public void windowClosing(WindowEvent e) { - if (timer != null) + public void componentHidden(ComponentEvent e) { + if (timer != null) { timer.stop(); + } } + }; private MouseAdapter clickListener = new MouseAdapter() { + @Override public void mouseClicked(MouseEvent e) { close(); } diff --git a/source/net/sourceforge/tuned/ui/notification/QueueNotificationLayout.java b/source/net/sourceforge/tuned/ui/notification/QueueNotificationLayout.java index 02f24794..ba1ea22a 100644 --- a/source/net/sourceforge/tuned/ui/notification/QueueNotificationLayout.java +++ b/source/net/sourceforge/tuned/ui/notification/QueueNotificationLayout.java @@ -17,10 +17,6 @@ import java.util.ListIterator; import javax.swing.SwingConstants; -/** - * @author Reinhard - * - */ public class QueueNotificationLayout implements NotificationLayout, SwingConstants { private ArrayList notificationList = new ArrayList(); diff --git a/source/net/sourceforge/tuned/ui/notification/SimpleNotificationLayout.java b/source/net/sourceforge/tuned/ui/notification/SimpleNotificationLayout.java index 9cc983d0..c7d5b6ef 100644 --- a/source/net/sourceforge/tuned/ui/notification/SimpleNotificationLayout.java +++ b/source/net/sourceforge/tuned/ui/notification/SimpleNotificationLayout.java @@ -13,11 +13,6 @@ import java.awt.Toolkit; import javax.swing.SwingConstants; - -/** - * @author Reinhard - * - */ public class SimpleNotificationLayout implements NotificationLayout, SwingConstants { private NotificationWindow currentNotification;