org.jhotdraw.xml
Class XMLTransferable
- java.lang.Object
-
- org.jhotdraw.xml.XMLTransferable
-
- All Implemented Interfaces:
- java.awt.datatransfer.ClipboardOwner, java.awt.datatransfer.Transferable
public class XMLTransferable extends java.lang.Object implements java.awt.datatransfer.Transferable, java.awt.datatransfer.ClipboardOwnerXMLTransferable for transfering XML documents over the clipboard and with drag and drop.
-
-
Constructor Summary
Constructors Constructor and Description XMLTransferable(byte[] data, java.lang.String mimeType, java.lang.String humanPresentableName)Creates new XMLTransferable
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.ObjectgetTransferData(java.awt.datatransfer.DataFlavor flavor)Returns an object which represents the data to be transferred.java.awt.datatransfer.DataFlavor[]getTransferDataFlavors()Returns an array of DataFlavor objects indicating the flavors the data can be provided in.booleanisDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)Returns whether or not the specified data flavor is supported for this object.voidlostOwnership(java.awt.datatransfer.Clipboard clipboard, java.awt.datatransfer.Transferable contents)Notifies this object that it is no longer the owner of the contents of the clipboard.
-
-
-
Constructor Detail
-
XMLTransferable
public XMLTransferable(byte[] data, java.lang.String mimeType, java.lang.String humanPresentableName)Creates new XMLTransferable
-
-
Method Detail
-
lostOwnership
public void lostOwnership(java.awt.datatransfer.Clipboard clipboard, java.awt.datatransfer.Transferable contents)Notifies this object that it is no longer the owner of the contents of the clipboard.- Specified by:
lostOwnershipin interfacejava.awt.datatransfer.ClipboardOwner- Parameters:
clipboard- the clipboard that is no longer ownedcontents- the contents which this owner had placed on the clipboard
-
getTransferData
public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor flavor) throws java.awt.datatransfer.UnsupportedFlavorException, java.io.IOExceptionReturns an object which represents the data to be transferred. The class of the object returned is defined by the representation class of the flavor.- Specified by:
getTransferDatain interfacejava.awt.datatransfer.Transferable- Parameters:
flavor- the requested flavor for the data- Throws:
java.io.IOException- if the data is no longer available in the requested flavor.java.awt.datatransfer.UnsupportedFlavorException- if the requested data flavor is not supported.- See Also:
DataFlavor.getRepresentationClass()
-
getTransferDataFlavors
public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
Returns an array of DataFlavor objects indicating the flavors the data can be provided in. The array should be ordered according to preference for providing the data (from most richly descriptive to least descriptive).- Specified by:
getTransferDataFlavorsin interfacejava.awt.datatransfer.Transferable- Returns:
- an array of data flavors in which this data can be transferred
-
isDataFlavorSupported
public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
Returns whether or not the specified data flavor is supported for this object.- Specified by:
isDataFlavorSupportedin interfacejava.awt.datatransfer.Transferable- Parameters:
flavor- the requested flavor for the data- Returns:
- boolean indicating wjether or not the data flavor is supported
-
-
DataMelt 3.0 © DataMelt by jWork.ORG