public class GraphTransferable extends BasicGraphTransferable implements Serializable, ClipboardOwner
1. Richer: The cells, view attributes and connections for this selection are stored as separate datastructures, which can be inserted using the GraphModel.insert() method. 2. HTML: If one cell is selected, the userObject is returned as HTML. 3. Plain: The userObject of the selected cell is returned as plain text.
Modifier and Type | Field and Description |
---|---|
protected Map |
attributeMap
(Cell, Map) entries that hold the view attributes for the cells.
|
protected Rectangle2D |
bounds
Rectangle that defines the former bounds of the views.
|
protected Object[] |
cells
Selected cells.
|
protected ConnectionSet |
cs
Object that describes the connection between cells.
|
static DataFlavor |
dataFlavor
Local Machine Reference Data Flavor.
|
protected ParentMap |
pm
Object that describes the group structure between cells.
|
Constructor and Description |
---|
GraphTransferable(Object[] cells,
Map attrMap,
Rectangle2D bounds,
ConnectionSet cs,
ParentMap pm)
Constructs a new transferable selection for
cells ,
cs and attrMap . |
Modifier and Type | Method and Description |
---|---|
Map |
getAttributeMap()
Returns a map of (GraphCell, Map)-pairs that represent the
view attributes for the respecive cells.
|
Rectangle2D |
getBounds() |
Object[] |
getCells()
Returns the
cells that represent the selection. |
ConnectionSet |
getConnectionSet()
Returns the connections between
cells (and possibly
other, unselected cells). |
String |
getHTMLData()
Fetch the data in a text/html format.
|
ParentMap |
getParentMap() |
String |
getPlainData()
Fetch the data in a text/plain format.
|
Object |
getRicherData(DataFlavor flavor)
Fetch the data in a jvm-localreference format.
|
DataFlavor[] |
getRicherFlavors()
Returns the jvm-localreference flavors of the transferable.
|
boolean |
isHTMLSupported()
Returns true if the transferable support a text/html format.
|
boolean |
isPlainSupported()
Returns true if the transferable support a text/plain format.
|
void |
lostOwnership(Clipboard clip,
Transferable contents) |
getTransferData, getTransferDataFlavors, isDataFlavorSupported, isHTMLFlavor, isPlainFlavor, isRicherFlavor, isStringFlavor
public static DataFlavor dataFlavor
protected Object[] cells
protected ConnectionSet cs
protected ParentMap pm
protected Map attributeMap
protected Rectangle2D bounds
public GraphTransferable(Object[] cells, Map attrMap, Rectangle2D bounds, ConnectionSet cs, ParentMap pm)
cells
,
cs
and attrMap
.public Object[] getCells()
cells
that represent the selection.public ConnectionSet getConnectionSet()
cells
(and possibly
other, unselected cells).public ParentMap getParentMap()
public Map getAttributeMap()
public Rectangle2D getBounds()
public void lostOwnership(Clipboard clip, Transferable contents)
lostOwnership
in interface ClipboardOwner
public DataFlavor[] getRicherFlavors()
getRicherFlavors
in class BasicGraphTransferable
public Object getRicherData(DataFlavor flavor) throws UnsupportedFlavorException
getRicherData
in class BasicGraphTransferable
UnsupportedFlavorException
public boolean isPlainSupported()
isPlainSupported
in class BasicGraphTransferable
public String getPlainData()
getPlainData
in class BasicGraphTransferable
public boolean isHTMLSupported()
isHTMLSupported
in class BasicGraphTransferable
public String getHTMLData()
getHTMLData
in class BasicGraphTransferable
Copyright (C) 2001-2009 JGraph Ltd. All rights reserved.