BioLegato 0.7.5 GDE plugin

org.biolegato.gdesupport.data
Class ClipboardWrapper

java.lang.Object
  extended by org.biolegato.gdesupport.data.ClipboardWrapper
All Implemented Interfaces:
java.awt.datatransfer.Transferable

public final class ClipboardWrapper
extends java.lang.Object
implements java.awt.datatransfer.Transferable

Author:
alvare

Field Summary
static java.awt.datatransfer.DataFlavor sequenceArrayFlavour
          A data flavour representing the raw Cell data type.
 
Constructor Summary
ClipboardWrapper(Seq[] cellArray)
          Creates a new instance of ClipboardWrapper
 
Method Summary
static Seq[] getClipboard()
          Obtains the current contents of the clipboard (null if empty).
 java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor flavour)
          Translates the Dataset to the given format
 java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
          Dictates what formats the Dataset can be converted to.
 boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavour)
          Dictates whether a given format is supported for conversion
static void setClipboard(Seq[] copy)
          Changes the current contents of the clipboard.
 Seq[] toArray()
          Dumps the data contained within the clipboard wrapper
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sequenceArrayFlavour

public static final java.awt.datatransfer.DataFlavor sequenceArrayFlavour
A data flavour representing the raw Cell data type.

Constructor Detail

ClipboardWrapper

public ClipboardWrapper(Seq[] cellArray)
Creates a new instance of ClipboardWrapper

Parameters:
cellArray - the data to store in the wrapper
Method Detail

getClipboard

public static Seq[] getClipboard()
Obtains the current contents of the clipboard (null if empty).

Returns:
the current contents of the clipboard.

setClipboard

public static void setClipboard(Seq[] copy)
Changes the current contents of the clipboard.

Parameters:
copy - the new content for the clipboard.

getTransferDataFlavors

public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
Dictates what formats the Dataset can be converted to.

Specified by:
getTransferDataFlavors in interface java.awt.datatransfer.Transferable
Returns:
an array of supported formats

isDataFlavorSupported

public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavour)
Dictates whether a given format is supported for conversion

Specified by:
isDataFlavorSupported in interface java.awt.datatransfer.Transferable
Parameters:
flavour - the flavour to test for compatability
Returns:
true if the format is supported

getTransferData

public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor flavour)
                                 throws java.awt.datatransfer.UnsupportedFlavorException,
                                        java.io.IOException
Translates the Dataset to the given format

Specified by:
getTransferData in interface java.awt.datatransfer.Transferable
Parameters:
flavour - the data flavour to use for translation
Returns:
the translated object
Throws:
java.awt.datatransfer.UnsupportedFlavorException - if the SeqDatasetnnot be translated into the requested data flavour
java.io.IOException - if there is a problem with I/O during the translation

toArray

public Seq[] toArray()
Dumps the data contained within the clipboard wrapper

Returns:
the data contained within the wrapper

BioLegato 0.7.5 GDE plugin

Copyright © 2008-2011 University of Manitoba.