|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.datanode.tree.BasicTransferable
public class BasicTransferable
A basic implementation of the Transferable interface used
to implement drag'n'drop operations. It initially supports no
DataFlavor
s, but they can be added
by using the various add* methods provided. They should
be called in order of priority (most specific first).
Constructor Summary | |
---|---|
BasicTransferable()
|
Method Summary | |
---|---|
void |
addDataSource(DataSource datsrc,
String mimeType)
Adds streamed data. |
void |
addLocalObject(Object obj,
Class clazz,
String type)
Adds an object which can be transferred within a single JVM. |
void |
addSerializableObject(Serializable obj,
Class clazz,
String type)
Adds a Serializable object which can be serialized
and thus passed outside of this JVM. |
void |
addString(String text)
Adds a plain text string. |
void |
addURL(URL url)
Adds a URL. |
Object |
getTransferData(DataFlavor flavor)
|
DataFlavor[] |
getTransferDataFlavors()
|
boolean |
isDataFlavorSupported(DataFlavor flavor)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasicTransferable()
Method Detail |
---|
public void addLocalObject(Object obj, Class clazz, String type)
obj
- the objectclazz
- the class as which it should be declared in the MIME typetype
- a human-readable description of the typepublic void addSerializableObject(Serializable obj, Class clazz, String type)
Serializable
object which can be serialized
and thus passed outside of this JVM.
obj
- the serializable objectclazz
- the class as which it should be declared in the MIME typetype
- a human-readable description of the typepublic void addURL(URL url)
url
- the URLpublic void addString(String text)
text
- the stringpublic void addDataSource(DataSource datsrc, String mimeType)
datsrc
- the DataSource holding the datamimeType
- the MIME type with which the data should declare
itselfpublic DataFlavor[] getTransferDataFlavors()
getTransferDataFlavors
in interface Transferable
public boolean isDataFlavorSupported(DataFlavor flavor)
isDataFlavorSupported
in interface Transferable
public Object getTransferData(DataFlavor flavor) throws IOException, UnsupportedFlavorException
getTransferData
in interface Transferable
IOException
UnsupportedFlavorException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |