OSDN Git Service

リストへのDnD機能はやめる
authoryukihane <yukihane.feather@gmail.com>
Tue, 6 Sep 2011 11:39:02 +0000 (20:39 +0900)
committeryukihane <yukihane.feather@gmail.com>
Fri, 9 Sep 2011 11:44:47 +0000 (20:44 +0900)
frontend/src/yukihane/inqubus/gui/MainFrame.java

index 5c50ce4..47ae215 100644 (file)
@@ -536,8 +536,6 @@ public class MainFrame extends JFrame {
         }
 
         initInputPanel();
-        pnlMain.setTransferHandler(new DownloadListTransferHandler());
-        tblDisplay.setTransferHandler(new TableTransferHandler());
     }
 
     public void startWatcher() {
@@ -771,66 +769,6 @@ public class MainFrame extends JFrame {
         return menuBar;
     }
 
-    private class DownloadListTransferHandler extends TransferHandler {
-
-        private static final long serialVersionUID = 1L;
-
-        @Override
-        public boolean canImport(TransferHandler.TransferSupport support) {
-            Transferable transferable = support.getTransferable();
-            if (transferable.isDataFlavorSupported(DataFlavor.javaFileListFlavor)
-                    || transferable.isDataFlavorSupported(DataFlavor.stringFlavor)) {
-                return true;
-            }
-            return false;
-        }
-
-        @Override
-        public boolean importData(TransferHandler.TransferSupport support) {
-//            try {
-//                Transferable transferable = support.getTransferable();
-//                if (transferable.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) {
-//                    @SuppressWarnings("unchecked")
-//                    final List<File> data = (List<File>) transferable.getTransferData(DataFlavor.javaFileListFlavor);
-//                    Collection<Target> targets = Target.from(data);
-//                    targetModel.addTarget(targets);
-//                } else if (transferable.isDataFlavorSupported(DataFlavor.stringFlavor)) {
-//                    String data = (String) transferable.getTransferData(DataFlavor.stringFlavor);
-//                    Matcher matcher = movieIdPattern.matcher(data);
-//                    if (matcher.find()) {
-//                        String movieId = matcher.group(1);
-//                        Target target = Target.fromId(movieId);
-//                        targetModel.addTarget(target);
-//                    } else {
-//                        return false;
-//                    }
-//
-//                }
-//                return false;
-//            } catch (Exception e) {
-//                logger.log(Level.SEVERE, null, e);
-//                return false;
-//            }
-            // TODO 上記実装見直し(Locationは削除された)
-            return false;
-        }
-    }
-
-    private class TableTransferHandler extends DownloadListTransferHandler {
-
-        private static final long serialVersionUID = 1L;
-
-        @Override
-        public boolean canImport(TransferHandler.TransferSupport support) {
-            return super.canImport(support);
-        }
-
-        @Override
-        public boolean importData(TransferHandler.TransferSupport support) {
-            return super.importData(support);
-        }
-    }
-
     private class MainFrameWindowListener extends WindowAdapter {
         @Override
         public void windowClosing(WindowEvent e) {