X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FDesktop.java;h=b669ebff59572677d0642b67f31b9947a0c14eab;hb=968c3bcde941e502fcf7d497343600f4f58f6c9a;hp=3fa5387b1de357992b16fc66b52e8b15a820b74b;hpb=ea1b74357e517baef19ef6f862bc7775f7a7804e;p=jalview.git diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index 3fa5387..b669ebf 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -20,6 +20,8 @@ */ package jalview.gui; +import static jalview.util.UrlConstants.SEQUENCE_ID; + import jalview.api.AlignViewportI; import jalview.api.AlignmentViewPanel; import jalview.bin.Cache; @@ -28,6 +30,7 @@ import jalview.io.DataSourceType; import jalview.io.FileFormat; import jalview.io.FileFormatException; import jalview.io.FileFormatI; +import jalview.io.FileFormats; import jalview.io.FileLoader; import jalview.io.IdentifyFile; import jalview.io.JalviewFileChooser; @@ -35,11 +38,14 @@ import jalview.io.JalviewFileView; import jalview.jbgui.GSplitFrame; import jalview.jbgui.GStructureViewer; import jalview.structure.StructureSelectionManager; +import jalview.urls.IdOrgSettings; import jalview.util.ImageMaker; import jalview.util.MessageManager; import jalview.util.Platform; +import jalview.util.UrlConstants; import jalview.viewmodel.AlignmentViewport; import jalview.ws.params.ParamManager; +import jalview.ws.utils.UrlDownloadClient; import java.awt.BorderLayout; import java.awt.Color; @@ -67,19 +73,19 @@ import java.awt.event.FocusListener; import java.awt.event.KeyEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; -import java.beans.PropertyVetoException; import java.io.BufferedInputStream; import java.io.File; import java.io.FileOutputStream; +import java.io.IOException; import java.net.URL; import java.util.ArrayList; import java.util.Hashtable; import java.util.List; +import java.util.ListIterator; import java.util.StringTokenizer; import java.util.Vector; import java.util.concurrent.ExecutorService; @@ -87,9 +93,12 @@ import java.util.concurrent.Executors; import java.util.concurrent.Semaphore; import javax.swing.AbstractAction; +import javax.swing.Box; +import javax.swing.BoxLayout; import javax.swing.DefaultDesktopManager; import javax.swing.DesktopManager; import javax.swing.JButton; +import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JComponent; import javax.swing.JDesktopPane; @@ -97,7 +106,6 @@ import javax.swing.JFrame; import javax.swing.JInternalFrame; import javax.swing.JLabel; import javax.swing.JMenuItem; -import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JPopupMenu; import javax.swing.JProgressBar; @@ -105,6 +113,8 @@ import javax.swing.KeyStroke; import javax.swing.SwingUtilities; import javax.swing.event.HyperlinkEvent; import javax.swing.event.HyperlinkEvent.EventType; +import javax.swing.event.InternalFrameAdapter; +import javax.swing.event.InternalFrameEvent; import javax.swing.event.MenuEvent; import javax.swing.event.MenuListener; @@ -119,6 +129,9 @@ public class Desktop extends jalview.jbgui.GDesktop implements DropTargetListener, ClipboardOwner, IProgressIndicator, jalview.api.StructureSelectionManagerProvider { + private static int DEFAULT_MIN_WIDTH = 300; + + private static int DEFAULT_MIN_HEIGHT = 250; private JalviewChangeSupport changeSupport = new JalviewChangeSupport(); @@ -385,6 +398,10 @@ public class Desktop extends jalview.jbgui.GDesktop implements showNews.setVisible(false); + getIdentifiersOrgData(); + + checkURLLinks(); + this.addWindowListener(new WindowAdapter() { @Override @@ -400,7 +417,16 @@ public class Desktop extends jalview.jbgui.GDesktop implements @Override public void mousePressed(MouseEvent evt) { - if (evt.isPopupTrigger()) + if (evt.isPopupTrigger()) // Mac + { + showPasteMenu(evt.getX(), evt.getY()); + } + } + + @Override + public void mouseReleased(MouseEvent evt) + { + if (evt.isPopupTrigger()) // Windows { showPasteMenu(evt.getX(), evt.getY()); } @@ -437,7 +463,6 @@ public class Desktop extends jalview.jbgui.GDesktop implements } }); - // displayed. // Thread off a new instance of the file chooser - this reduces the time it // takes to open it later on. new Thread(new Runnable() @@ -448,9 +473,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements Cache.log.debug("Filechooser init thread started."); String fileFormat = Cache.getProperty("DEFAULT_FILE_FORMAT"); JalviewFileChooser.forRead(Cache.getProperty("LAST_DIRECTORY"), - // jalview.io.AppletFormatAdapter.READABLE_EXTENSIONS, - // jalview.io.AppletFormatAdapter.READABLE_FNAMES, - fileFormat, true); + fileFormat); Cache.log.debug("Filechooser init thread finished."); } }).start(); @@ -510,6 +533,29 @@ public class Desktop extends jalview.jbgui.GDesktop implements }); } + public void getIdentifiersOrgData() + { + // Thread off the identifiers fetcher + addDialogThread(new Runnable() + { + @Override + public void run() + { + Cache.log.debug("Downloading data from identifiers.org"); + UrlDownloadClient client = new UrlDownloadClient(); + try + { + client.download(IdOrgSettings.getUrl(), + IdOrgSettings.getDownloadLocation()); + } catch (IOException e) + { + Cache.log.debug("Exception downloading identifiers.org data" + + e.getMessage()); + } + } + }); + } + @Override protected void showNews_actionPerformed(ActionEvent e) { @@ -699,7 +745,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements public static synchronized void addInternalFrame( final JInternalFrame frame, String title, int w, int h) { - addInternalFrame(frame, title, true, w, h, true); + addInternalFrame(frame, title, true, w, h, true, false); } /** @@ -721,7 +767,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements final JInternalFrame frame, String title, boolean makeVisible, int w, int h) { - addInternalFrame(frame, title, makeVisible, w, h, true); + addInternalFrame(frame, title, makeVisible, w, h, true, false); } /** @@ -742,7 +788,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements final JInternalFrame frame, String title, int w, int h, boolean resizable) { - addInternalFrame(frame, title, true, w, h, resizable); + addInternalFrame(frame, title, true, w, h, resizable, false); } /** @@ -761,10 +807,12 @@ public class Desktop extends jalview.jbgui.GDesktop implements * height * @param resizable * Allow resize + * @param ignoreMinSize + * No minimum size is set for the dialog */ public static synchronized void addInternalFrame( final JInternalFrame frame, String title, boolean makeVisible, - int w, int h, boolean resizable) + int w, int h, boolean resizable, boolean ignoreMinSize) { // TODO: allow callers to determine X and Y position of frame (eg. via @@ -790,6 +838,11 @@ public class Desktop extends jalview.jbgui.GDesktop implements openFrameCount++; + if (!ignoreMinSize) + { + frame.setMinimumSize(new Dimension(DEFAULT_MIN_WIDTH, + DEFAULT_MIN_HEIGHT)); + } frame.setVisible(makeVisible); frame.setClosable(true); frame.setResizable(resizable); @@ -808,32 +861,53 @@ public class Desktop extends jalview.jbgui.GDesktop implements * ((openFrameCount - 1) % 10) + yOffset); } + /* + * add an entry for the new frame in the Window menu + * (and remove it when the frame is closed) + */ final JMenuItem menuItem = new JMenuItem(title); - frame.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter() + frame.addInternalFrameListener(new InternalFrameAdapter() { @Override - public void internalFrameActivated( - javax.swing.event.InternalFrameEvent evt) + public void internalFrameActivated(InternalFrameEvent evt) { JInternalFrame itf = desktop.getSelectedFrame(); if (itf != null) { itf.requestFocus(); } - } @Override - public void internalFrameClosed( - javax.swing.event.InternalFrameEvent evt) + public void internalFrameClosed(InternalFrameEvent evt) { PaintRefresher.RemoveComponent(frame); - openFrameCount--; + + /* + * defensive check to prevent frames being + * added half off the window + */ + if (openFrameCount > 0) + { + openFrameCount--; + } + + /* + * ensure no reference to alignFrame retained by menu item listener + */ + if (menuItem.getActionListeners().length > 0) + { + menuItem.removeActionListener(menuItem.getActionListeners()[0]); + } windowMenu.remove(menuItem); JInternalFrame itf = desktop.getSelectedFrame(); if (itf != null) { itf.requestFocus(); + if (itf instanceof AlignFrame) + { + Jalview.setCurrentAlignFrame((AlignFrame) itf); + } } System.gc(); }; @@ -854,51 +928,11 @@ public class Desktop extends jalview.jbgui.GDesktop implements } } }); - menuItem.addMouseListener(new MouseListener() - { - - @Override - public void mouseReleased(MouseEvent e) - { - } - - @Override - public void mousePressed(MouseEvent e) - { - } - @Override - public void mouseExited(MouseEvent e) - { - try - { - frame.setSelected(false); - } catch (PropertyVetoException e1) - { - } - } - - @Override - public void mouseEntered(MouseEvent e) - { - try - { - frame.setSelected(true); - } catch (PropertyVetoException e1) - { - } - } - - @Override - public void mouseClicked(MouseEvent e) - { - - } - }); + desktop.add(frame); windowMenu.add(menuItem); - desktop.add(frame); frame.toFront(); try { @@ -955,6 +989,9 @@ public class Desktop extends jalview.jbgui.GDesktop implements public void drop(DropTargetDropEvent evt) { boolean success = true; + // JAL-1552 - acceptDrop required before getTransferable call for + // Java's Transferable for native dnd + evt.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE); Transferable t = evt.getTransferable(); List files = new ArrayList(); List protocols = new ArrayList(); @@ -1012,10 +1049,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements { String fileFormat = Cache.getProperty("DEFAULT_FILE_FORMAT"); JalviewFileChooser chooser = JalviewFileChooser.forRead( - Cache.getProperty("LAST_DIRECTORY"), - // AppletFormatAdapter.READABLE_EXTENSIONS, - // AppletFormatAdapter.READABLE_FNAMES, - fileFormat, true); + Cache.getProperty("LAST_DIRECTORY"), fileFormat); chooser.setFileView(new JalviewFileView()); chooser.setDialogTitle(MessageManager @@ -1030,20 +1064,21 @@ public class Desktop extends jalview.jbgui.GDesktop implements Cache.setProperty("LAST_DIRECTORY", chooser .getSelectedFile().getParent()); - FileFormatI format = null; - FileFormatI selectedFormat = chooser.getSelectedFormat(); - if (FileFormat.Jalview.equals(selectedFormat)) - { - format = FileFormat.Jalview; - } - else + FileFormatI format = chooser.getSelectedFormat(); + + /* + * Call IdentifyFile to verify the file contains what its extension implies. + * Skip this step for dynamically added file formats, because + * IdentifyFile does not know how to recognise them. + */ + if (FileFormats.getInstance().isIdentifiable(format)) { try { format = new IdentifyFile().identify(choice, DataSourceType.FILE); } catch (FileFormatException e) { - // format is null + // format = null; //?? } } @@ -1064,11 +1099,9 @@ public class Desktop extends jalview.jbgui.GDesktop implements * * @param e * DOCUMENT ME! - * @throws FileFormatException */ @Override public void inputURLMenuItem_actionPerformed(AlignViewport viewport) - // throws FileFormatException { // This construct allows us to have a wider textfield // for viewing @@ -1097,11 +1130,11 @@ public class Desktop extends jalview.jbgui.GDesktop implements } } - int reply = JOptionPane.showInternalConfirmDialog(desktop, panel, + int reply = JvOptionPane.showInternalConfirmDialog(desktop, panel, MessageManager.getString("label.input_alignment_from_url"), - JOptionPane.OK_CANCEL_OPTION); + JvOptionPane.OK_CANCEL_OPTION); - if (reply != JOptionPane.OK_OPTION) + if (reply != JvOptionPane.OK_OPTION) { return; } @@ -1135,11 +1168,11 @@ public class Desktop extends jalview.jbgui.GDesktop implements if (format == null) { - JOptionPane.showInternalMessageDialog(Desktop.desktop, + JvOptionPane.showInternalMessageDialog(Desktop.desktop, MessageManager.formatMessage("label.couldnt_locate", new Object[] { url }), MessageManager .getString("label.url_not_found"), - JOptionPane.WARNING_MESSAGE); + JvOptionPane.WARNING_MESSAGE); return; } @@ -1235,9 +1268,9 @@ public class Desktop extends jalview.jbgui.GDesktop implements public void aboutMenuItem_actionPerformed(ActionEvent e) { // StringBuffer message = getAboutMessage(false); - // JOptionPane.showInternalMessageDialog(Desktop.desktop, + // JvOptionPane.showInternalMessageDialog(Desktop.desktop, // - // message.toString(), "About Jalview", JOptionPane.INFORMATION_MESSAGE); + // message.toString(), "About Jalview", JvOptionPane.INFORMATION_MESSAGE); new Thread(new Runnable() { @Override @@ -1333,6 +1366,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements @Override public void closeAll_actionPerformed(ActionEvent e) { + // TODO show a progress bar while closing? JInternalFrame[] frames = desktop.getAllFrames(); for (int i = 0; i < frames.length; i++) { @@ -1343,6 +1377,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements { } } + Jalview.setCurrentAlignFrame(null); System.out.println("ALL CLOSED"); if (v_client != null) { @@ -1359,6 +1394,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements { ssm.resetAll(); } + System.gc(); } @Override @@ -1533,8 +1569,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements @Override public void saveState_actionPerformed(ActionEvent e) { - JalviewFileChooser chooser = new JalviewFileChooser( - Cache.getProperty("LAST_DIRECTORY"), "jvp", "Jalview Project", + JalviewFileChooser chooser = new JalviewFileChooser("jvp", "Jalview Project"); chooser.setFileView(new JalviewFileView()); @@ -1573,11 +1608,11 @@ public class Desktop extends jalview.jbgui.GDesktop implements Cache.log.error( "Problems whilst trying to save to " + choice.getName(), ex); - JOptionPane.showMessageDialog(me, MessageManager.formatMessage( + JvOptionPane.showMessageDialog(me, MessageManager.formatMessage( "label.error_whilst_saving_current_state_to", new Object[] { choice.getName() }), MessageManager .getString("label.couldnt_save_project"), - JOptionPane.WARNING_MESSAGE); + JvOptionPane.WARNING_MESSAGE); } setProgressBar(null, choice.hashCode()); } @@ -1639,12 +1674,12 @@ public class Desktop extends jalview.jbgui.GDesktop implements { Cache.log.error("Problems whilst loading project from " + choice, ex); - JOptionPane.showMessageDialog(Desktop.desktop, MessageManager + JvOptionPane.showMessageDialog(Desktop.desktop, MessageManager .formatMessage( "label.error_whilst_loading_project_from", new Object[] { choice }), MessageManager .getString("label.couldnt_load_project"), - JOptionPane.WARNING_MESSAGE); + JvOptionPane.WARNING_MESSAGE); } setProgressBar(null, choice.hashCode()); } @@ -1929,7 +1964,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements String fle = chooser.getSelectedFile().toString(); if (!vamsasImport(chooser.getSelectedFile())) { - JOptionPane + JvOptionPane .showInternalMessageDialog( Desktop.desktop, MessageManager.formatMessage( @@ -1937,7 +1972,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements new Object[] { fle }), MessageManager .getString("label.vamsas_document_import_failed"), - JOptionPane.ERROR_MESSAGE); + JvOptionPane.ERROR_MESSAGE); } } } @@ -2188,9 +2223,9 @@ public class Desktop extends jalview.jbgui.GDesktop implements { if (v_client != null) { - JalviewFileChooser chooser = new JalviewFileChooser( - Cache.getProperty("LAST_DIRECTORY"), "vdj", - "Vamsas Document", "Vamsas Document"); + // TODO: VAMSAS DOCUMENT EXTENSION is VDJ + JalviewFileChooser chooser = new JalviewFileChooser("vdj", + "Vamsas Document"); chooser.setFileView(new JalviewFileView()); chooser.setDialogTitle(MessageManager @@ -2228,9 +2263,9 @@ public class Desktop extends jalview.jbgui.GDesktop implements removeProgressPanel(progpanel); if (warnmsg != null) { - JOptionPane.showInternalMessageDialog(Desktop.desktop, + JvOptionPane.showInternalMessageDialog(Desktop.desktop, - warnmsg, warnttl, JOptionPane.ERROR_MESSAGE); + warnmsg, warnttl, JvOptionPane.ERROR_MESSAGE); } } } @@ -2246,7 +2281,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements */ public void setVamsasUpdate(boolean b) { - jalview.bin.Cache.log.debug("Setting gui for Vamsas update " + Cache.log.debug("Setting gui for Vamsas update " + (b ? "in progress" : "finished")); if (vamUpdate != null) @@ -2281,6 +2316,86 @@ public class Desktop extends jalview.jbgui.GDesktop implements new Thread(jvq).start(); } + public void checkURLLinks() + { + // Thread off the URL link checker + addDialogThread(new Runnable() + { + @Override + public void run() + { + if (Cache.getDefault("CHECKURLLINKS", true)) + { + // check what the actual links are - if it's just the default don't + // bother with the warning + List links = Preferences.sequenceUrlLinks + .getLinksForMenu(); + + // only need to check links if there is one with a + // SEQUENCE_ID which is not the default EMBL_EBI link + ListIterator li = links.listIterator(); + boolean check = false; + List urls = new ArrayList(); + while (li.hasNext()) + { + String link = li.next(); + if (link.contains(SEQUENCE_ID) + && !link.equals(UrlConstants.DEFAULT_STRING)) + { + check = true; + int barPos = link.indexOf("|"); + String urlMsg = barPos == -1 ? link : link.substring(0, + barPos) + ": " + link.substring(barPos + 1); + urls.add(new JLabel(urlMsg)); + } + } + if (!check) + { + return; + } + + // ask user to check in case URL links use old style tokens + // ($SEQUENCE_ID$ for sequence id _or_ accession id) + JPanel msgPanel = new JPanel(); + msgPanel.setLayout(new BoxLayout(msgPanel, BoxLayout.PAGE_AXIS)); + msgPanel.add(Box.createVerticalGlue()); + JLabel msg = new JLabel( + MessageManager + .getString("label.SEQUENCE_ID_for_DB_ACCESSION1")); + JLabel msg2 = new JLabel( + MessageManager + .getString("label.SEQUENCE_ID_for_DB_ACCESSION2")); + msgPanel.add(msg); + for (JLabel url : urls) + { + msgPanel.add(url); + } + msgPanel.add(msg2); + + final JCheckBox jcb = new JCheckBox( + MessageManager.getString("label.do_not_display_again")); + jcb.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent e) + { + // update Cache settings for "don't show this again" + boolean showWarningAgain = !jcb.isSelected(); + Cache.setProperty("CHECKURLLINKS", + Boolean.valueOf(showWarningAgain).toString()); + } + }); + msgPanel.add(jcb); + + JvOptionPane.showMessageDialog(Desktop.desktop, msgPanel, + MessageManager + .getString("label.SEQUENCE_ID_no_longer_used"), + JvOptionPane.WARNING_MESSAGE); + } + } + }); + } + /** * Proxy class for JDesktopPane which optionally displays the current memory * usage and highlights the desktop area with a red bar if free memory runs @@ -2482,11 +2597,11 @@ public class Desktop extends jalview.jbgui.GDesktop implements } catch (Exception ex) { jalview.bin.Cache.log.error("Groovy Shell Creation failed.", ex); - JOptionPane.showInternalMessageDialog(Desktop.desktop, + JvOptionPane.showInternalMessageDialog(Desktop.desktop, MessageManager.getString("label.couldnt_create_groovy_shell"), MessageManager.getString("label.groovy_support_failed"), - JOptionPane.ERROR_MESSAGE); + JvOptionPane.ERROR_MESSAGE); } } @@ -2542,8 +2657,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements { getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put( KeyStroke.getKeyStroke(KeyEvent.VK_Q, Toolkit - .getDefaultToolkit().getMenuShortcutKeyMask()), - "Quit"); + .getDefaultToolkit().getMenuShortcutKeyMask()), "Quit"); getRootPane().getActionMap().put("Quit", new AbstractAction() { @Override @@ -2750,13 +2864,8 @@ public class Desktop extends jalview.jbgui.GDesktop implements if (Cache.getDefault("SHOW_JWS2_SERVICES", true)) { - if (jalview.ws.jws2.Jws2Discoverer.getDiscoverer().isRunning()) - { - jalview.ws.jws2.Jws2Discoverer.getDiscoverer().setAborted(true); - } t2 = jalview.ws.jws2.Jws2Discoverer.getDiscoverer().startDiscoverer( changeSupport); - } Thread t3 = null; { @@ -2828,7 +2937,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements * * jd.waitForInput(); */ - JOptionPane + JvOptionPane .showConfirmDialog( Desktop.desktop, new JLabel( @@ -2840,8 +2949,8 @@ public class Desktop extends jalview.jbgui.GDesktop implements + "

Check the Connections and Web services tab
of the" + " Tools->Preferences dialog box to change them.

"), "Web Service Configuration Problem", - JOptionPane.DEFAULT_OPTION, - JOptionPane.ERROR_MESSAGE); + JvOptionPane.DEFAULT_OPTION, + JvOptionPane.ERROR_MESSAGE); serviceChangedDialog = null; } @@ -2898,11 +3007,11 @@ public class Desktop extends jalview.jbgui.GDesktop implements jalview.util.BrowserLauncher.openURL(url); } catch (Exception ex) { - JOptionPane.showInternalMessageDialog(Desktop.desktop, + JvOptionPane.showInternalMessageDialog(Desktop.desktop, MessageManager .getString("label.web_browser_not_found_unix"), MessageManager.getString("label.web_browser_not_found"), - JOptionPane.WARNING_MESSAGE); + JvOptionPane.WARNING_MESSAGE); ex.printStackTrace(); } @@ -3210,11 +3319,10 @@ public class Desktop extends jalview.jbgui.GDesktop implements { // Works on Windows and MacOSX Cache.log.debug("Drop handled as javaFileListFlavor"); - evt.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE); for (Object file : (List) t .getTransferData(DataFlavor.javaFileListFlavor)) { - files.add(((File)file).toString()); + files.add(((File) file).toString()); protocols.add(DataSourceType.FILE); } } @@ -3227,7 +3335,6 @@ public class Desktop extends jalview.jbgui.GDesktop implements { Cache.log.debug("Drop handled as uriListFlavor"); // This is used by Unix drag system - evt.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE); data = (String) t.getTransferData(uriListFlavor); } if (data == null) @@ -3282,7 +3389,6 @@ public class Desktop extends jalview.jbgui.GDesktop implements { Cache.log.debug("Supported transfer dataflavor: " + fl.toString()); - evt.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE); Object df = t.getTransferData(fl); if (df != null) {