org.jgraph.plaf.basic

Class BasicGraphTransferable

Implemented Interfaces:
Serializable, Transferable, UIResource
Known Direct Subclasses:
GraphTransferable

public class BasicGraphTransferable
extends java.lang.Object
implements Transferable, UIResource, Serializable

Method Summary

protected String
getHTMLData()
Fetch the data in a text/html format
protected String
getPlainData()
Fetch the data in a text/plain format.
protected Object
getRicherData(DataFlavor flavor)
protected DataFlavor[]
getRicherFlavors()
Some subclasses will have flavors that are more descriptive than HTML or plain text.
Object
getTransferData(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.
boolean
isDataFlavorSupported(DataFlavor flavor)
Returns whether or not the specified data flavor is supported for this object.
protected boolean
isHTMLFlavor(DataFlavor flavor)
Returns whether or not the specified data flavor is an HTML flavor that is supported.
protected boolean
isHTMLSupported()
Whether the HTML flavors are offered.
protected boolean
isPlainFlavor(DataFlavor flavor)
Returns whether or not the specified data flavor is an plain flavor that is supported.
protected boolean
isPlainSupported()
Whether the plain text flavors are offered.
protected boolean
isRicherFlavor(DataFlavor flavor)
protected boolean
isStringFlavor(DataFlavor flavor)
Returns whether or not the specified data flavor is a String flavor that is supported.

Method Details

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)
            throws UnsupportedFlavorException

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)
            throws UnsupportedFlavorException,
                   IOException
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
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-2008 Gaudenz Alder. All rights reserved.