uk.ac.starlink.table.gui
Class TableLoadTransferHandler

java.lang.Object
  extended by javax.swing.TransferHandler
      extended by uk.ac.starlink.table.gui.TableLoadTransferHandler
All Implemented Interfaces:
java.io.Serializable

public abstract class TableLoadTransferHandler
extends javax.swing.TransferHandler

TransferHandler which will load a table if it is dragged onto its owner component.

Concrete implementations of this abstract class must implement the getLoadClient() method to determine how loaded tables will be consumed.

Since:
16 Sep 2010
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.TransferHandler
javax.swing.TransferHandler.DropLocation, javax.swing.TransferHandler.TransferSupport
 
Field Summary
 
Fields inherited from class javax.swing.TransferHandler
COPY, COPY_OR_MOVE, LINK, MOVE, NONE
 
Constructor Summary
TableLoadTransferHandler(StarTableFactory tfact)
          Constructor.
 
Method Summary
 boolean canImport(javax.swing.JComponent comp, java.awt.datatransfer.DataFlavor[] flavors)
           
protected abstract  TableLoadClient getLoadClient()
          Returns a GUI consumer for any tables loaded by this panel.
 int getSourceActions(javax.swing.JComponent comp)
           
 boolean importData(javax.swing.JComponent comp, java.awt.datatransfer.Transferable trans)
           
 
Methods inherited from class javax.swing.TransferHandler
canImport, createTransferable, exportAsDrag, exportDone, exportToClipboard, getCopyAction, getCutAction, getPasteAction, getVisualRepresentation, importData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableLoadTransferHandler

public TableLoadTransferHandler(StarTableFactory tfact)
Constructor.

Parameters:
tfact - factory to handle transferred-in tables
Method Detail

getLoadClient

protected abstract TableLoadClient getLoadClient()
Returns a GUI consumer for any tables loaded by this panel. It will be called once for each load sequence; the returned object may or may not be the same one each time.

Returns:
load client ready to accept tables

canImport

public boolean canImport(javax.swing.JComponent comp,
                         java.awt.datatransfer.DataFlavor[] flavors)
Overrides:
canImport in class javax.swing.TransferHandler

importData

public boolean importData(javax.swing.JComponent comp,
                          java.awt.datatransfer.Transferable trans)
Overrides:
importData in class javax.swing.TransferHandler

getSourceActions

public int getSourceActions(javax.swing.JComponent comp)
Overrides:
getSourceActions in class javax.swing.TransferHandler

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.