org.jgraph.plaf.basic

Class BasicGraphTransferable

public class BasicGraphTransferable extends Object implements Transferable, UIResource, Serializable

Method Summary
protected StringgetHTMLData()
Fetch the data in a text/html format
protected StringgetPlainData()
Fetch the data in a text/plain format.
protected ObjectgetRicherData(DataFlavor flavor)
protected DataFlavor[]getRicherFlavors()
Some subclasses will have flavors that are more descriptive than HTML or plain text.
ObjectgetTransferData(DataFlavor flavor)
Returns an object which represents the data to be transferred.
DataFlavor[]getTransferDataFlavors()
Returns an array of DataFlavor objects indicating the flavors the data can be provided in.
booleanisDataFlavorSupported(DataFlavor flavor)
Returns whether or not the specified data flavor is supported for this object.
protected booleanisHTMLFlavor(DataFlavor flavor)
Returns whether or not the specified data flavor is an HTML flavor that is supported.
protected booleanisHTMLSupported()
Whether the HTML flavors are offered.
protected booleanisPlainFlavor(DataFlavor flavor)
Returns whether or not the specified data flavor is an plain flavor that is supported.
protected booleanisPlainSupported()
Whether the plain text flavors are offered.
protected booleanisRicherFlavor(DataFlavor flavor)
protected booleanisStringFlavor(DataFlavor flavor)
Returns whether or not the specified data flavor is a String flavor that is supported.

Method Detail

getHTMLData

protected String getHTMLData()
Fetch the data in a text/html format

getPlainData

protected String getPlainData()
Fetch the data in a text/plain format.

getRicherData

protected Object getRicherData(DataFlavor flavor)

getRicherFlavors

protected DataFlavor[] getRicherFlavors()
Some subclasses will have flavors that are more descriptive than HTML or plain text. If this method returns a non-null value, it will be placed at the start of the array of supported flavors.

getTransferData

public Object getTransferData(DataFlavor flavor)
Returns an object which represents the data to be transferred. The class of the object returned is defined by the representation class of the flavor.

Parameters: flavor the requested flavor for the data

Throws: IOException if the data is no longer available in the requested flavor. UnsupportedFlavorException if the requested data flavor is not supported.

See Also: DataFlavor#getRepresentationClass

getTransferDataFlavors

public 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).

Returns: an array of data flavors in which this data can be transferred

isDataFlavorSupported

public boolean isDataFlavorSupported(DataFlavor flavor)
Returns whether or not the specified data flavor is supported for this object.

Parameters: flavor the requested flavor for the data

Returns: boolean indicating whether or not the data flavor is supported

isHTMLFlavor

protected boolean isHTMLFlavor(DataFlavor flavor)
Returns whether or not the specified data flavor is an HTML flavor that is supported.

Parameters: flavor the requested flavor for the data

Returns: boolean indicating whether or not the data flavor is supported

isHTMLSupported

protected boolean isHTMLSupported()
Whether the HTML flavors are offered. If so, the method getHTMLData should be implemented to provide something reasonable.

isPlainFlavor

protected boolean isPlainFlavor(DataFlavor flavor)
Returns whether or not the specified data flavor is an plain flavor that is supported.

Parameters: flavor the requested flavor for the data

Returns: boolean indicating whether or not the data flavor is supported

isPlainSupported

protected boolean isPlainSupported()
Whether the plain text flavors are offered. If so, the method getPlainData should be implemented to provide something reasonable.

isRicherFlavor

protected boolean isRicherFlavor(DataFlavor flavor)

isStringFlavor

protected boolean isStringFlavor(DataFlavor flavor)
Returns whether or not the specified data flavor is a String flavor that is supported.

Parameters: flavor the requested flavor for the data

Returns: boolean indicating whether or not the data flavor is supported

Copyright (C) 2001-2009 JGraph Ltd. All rights reserved.