* always use system laf (also on linux)

* droping of files in names list works correctly now on linux
This commit is contained in:
Reinhard Pointner 2009-04-26 21:10:38 +00:00
parent 4c926c076e
commit 9e60d2c5dd
2 changed files with 9 additions and 19 deletions

View File

@ -11,7 +11,6 @@ import java.util.logging.Logger;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;
import net.sourceforge.filebot.ui.MainFrame;
import net.sourceforge.filebot.ui.NotificationLoggingHandler;
@ -22,8 +21,6 @@ import net.sourceforge.filebot.ui.panel.sfv.SfvPanelBuilder;
import org.kohsuke.args4j.CmdLineException;
import org.kohsuke.args4j.CmdLineParser;
import com.sun.jna.Platform;
public class Main {
@ -50,17 +47,8 @@ public class Main {
initializeSettings();
try {
if (Platform.isWindows() || Platform.isMac()) {
// use native laf of windows and mac
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} else {
// use nimubs laf on linux, bsd, ...
for (LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels()) {
if (laf.getName().equals("Nimbus")) {
UIManager.setLookAndFeel(laf.getClassName());
}
}
}
// use native laf an all platforms
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
Logger.getLogger(Main.class.getName()).log(Level.WARNING, e.toString(), e);
}

View File

@ -28,15 +28,17 @@ import net.sourceforge.filebot.ui.transfer.FileTransferablePolicy;
import net.sourceforge.filebot.web.Episode;
import net.sourceforge.tuned.FastFile;
import ca.odell.glazedlists.EventList;
class NamesListTransferablePolicy extends FileTransferablePolicy {
private static final DataFlavor episodeArrayFlavor = ArrayTransferable.flavor(Episode.class);
private final List<Object> model;
private final EventList<Object> model;
public NamesListTransferablePolicy(List<Object> model) {
public NamesListTransferablePolicy(EventList<Object> model) {
this.model = model;
}
@ -68,12 +70,12 @@ class NamesListTransferablePolicy extends FileTransferablePolicy {
if (tr.isDataFlavorSupported(episodeArrayFlavor)) {
// episode array transferable
model.addAll(Arrays.asList((Episode[]) tr.getTransferData((episodeArrayFlavor))));
} else if (tr.isDataFlavorSupported(stringFlavor)) {
// string transferable
load((String) tr.getTransferData(stringFlavor));
} else if (super.accept(tr)) {
// file transferable
load(getFilesFromTransferable(tr));
} else if (tr.isDataFlavorSupported(stringFlavor)) {
// string transferable
load((String) tr.getTransferData(stringFlavor));
}
}