Package uk.ac.starlink.datanode.tree
Class BasicTransferable
java.lang.Object
uk.ac.starlink.datanode.tree.BasicTransferable
- All Implemented Interfaces:
Transferable
- Direct Known Subclasses:
DataNodeTransferable
A basic implementation of the
Transferable interface used
to implement drag'n'drop operations. It initially supports no
DataFlavors, but they can be added
by using the various add* methods provided. They should
be called in order of priority (most specific first).- Author:
- Mark Taylor (Starlink)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDataSource(uk.ac.starlink.util.DataSource datsrc, String mimeType) Adds streamed data.voidaddLocalObject(Object obj, Class clazz, String type) Adds an object which can be transferred within a single JVM.voidaddSerializableObject(Serializable obj, Class clazz, String type) Adds aSerializableobject which can be serialized and thus passed outside of this JVM.voidAdds a plain text string.voidAdds a URL.getTransferData(DataFlavor flavor) booleanisDataFlavorSupported(DataFlavor flavor)
-
Constructor Details
-
BasicTransferable
public BasicTransferable()
-
-
Method Details
-
addLocalObject
Adds an object which can be transferred within a single JVM.- Parameters:
obj- the objectclazz- the class as which it should be declared in the MIME typetype- a human-readable description of the type
-
addSerializableObject
Adds aSerializableobject which can be serialized and thus passed outside of this JVM.- Parameters:
obj- the serializable objectclazz- the class as which it should be declared in the MIME typetype- a human-readable description of the type
-
addURL
Adds a URL. This is currently installed as both a local and a serializable object.- Parameters:
url- the URL
-
addString
Adds a plain text string.- Parameters:
text- the string
-
addDataSource
Adds streamed data.- Parameters:
datsrc- the DataSource holding the datamimeType- the MIME type with which the data should declare itself
-
getTransferDataFlavors
- Specified by:
getTransferDataFlavorsin interfaceTransferable
-
isDataFlavorSupported
- Specified by:
isDataFlavorSupportedin interfaceTransferable
-
getTransferData
- Specified by:
getTransferDatain interfaceTransferable- Throws:
IOExceptionUnsupportedFlavorException
-