[MOBY-guts] biomoby commit
Paul Gordon
gordonp at dev.open-bio.org
Tue Jun 9 19:33:15 UTC 2009
gordonp
Tue Jun 9 15:33:15 EDT 2009
Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui
In directory dev.open-bio.org:/tmp/cvs-serv21341/src/main/ca/ucalgary/seahawk/gui
Modified Files:
FileAndTextTransferHandler.java
Log Message:
Setup callbacks so Daggoo can do data-input unification
moby-live/Java/src/main/ca/ucalgary/seahawk/gui FileAndTextTransferHandler.java,1.8,1.9
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/FileAndTextTransferHandler.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/FileAndTextTransferHandler.java 2007/12/07 20:33:28 1.8
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/FileAndTextTransferHandler.java 2009/06/09 19:33:15 1.9
@@ -20,7 +20,7 @@
/*
* This class allows Seahawk to accept drop events from the native
* windowing system, so dropped files, URLs and string can be loaded into
- * tabs. Dragging from Seahawk tabs is not yet supported.
+ * tabs. Dragging from Seahawk tabs is supported by the SeahawkTransferable class.
*/
public class FileAndTextTransferHandler extends TransferHandler {
private DataFlavor fileFlavor, stringFlavor;
@@ -229,5 +229,27 @@
}
return false;
}
+
+ /** Our components are copy-only */
+ public int getSourceActions(JComponent c){
+ return TransferHandler.COPY;
+ }
+
+ protected Transferable createTransferable(JComponent c) {
+ if(c instanceof MobyContentPane){
+ return new SeahawkTransferable((MobyContentPane) c);
+ }
+ else{
+ return null;
+ }
+ }
+
+ public void exportDone(JComponent c, Transferable t, int action) {
+ if (t instanceof SeahawkTransferable){
+ // Do unification
+ ((SeahawkTransferable) t).exportDone();
+ }
+ }
+
}
More information about the MOBY-guts
mailing list