Package org.jgraph.graph
Class GraphTransferable
java.lang.Object
org.jgraph.plaf.basic.BasicGraphTransferable
org.jgraph.graph.GraphTransferable
- All Implemented Interfaces:
ClipboardOwner
,Transferable
,Serializable
,UIResource
public class GraphTransferable
extends BasicGraphTransferable
implements Serializable, ClipboardOwner
An object that represents the clipboard contents for a graph selection.
The object has three representations:
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.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map
(Cell, Map) entries that hold the view attributes for the cells.protected Rectangle2D
Rectangle that defines the former bounds of the views.protected Object[]
Selected cells.protected ConnectionSet
Object that describes the connection between cells.static DataFlavor
Local Machine Reference Data Flavor.protected ParentMap
Object that describes the group structure between cells. -
Constructor Summary
ConstructorsConstructorDescriptionGraphTransferable
(Object[] cells, Map attrMap, Rectangle2D bounds, ConnectionSet cs, ParentMap pm) Constructs a new transferable selection forcells
,cs
andattrMap
. -
Method Summary
Modifier and TypeMethodDescriptionReturns a map of (GraphCell, Map)-pairs that represent the view attributes for the respecive cells.Object[]
getCells()
Returns thecells
that represent the selection.Returns the connections betweencells
(and possibly other, unselected cells).Fetch the data in a text/html format.Fetch the data in a text/plain format.getRicherData
(DataFlavor flavor) Fetch the data in a jvm-localreference format.Returns the jvm-localreference flavors of the transferable.boolean
Returns true if the transferable support a text/html format.boolean
Returns true if the transferable support a text/plain format.void
lostOwnership
(Clipboard clip, Transferable contents) Methods inherited from class org.jgraph.plaf.basic.BasicGraphTransferable
getTransferData, getTransferDataFlavors, isDataFlavorSupported, isHTMLFlavor, isPlainFlavor, isRicherFlavor, isStringFlavor
-
Field Details
-
dataFlavor
Local Machine Reference Data Flavor. -
cells
Selected cells. -
cs
Object that describes the connection between cells. -
pm
Object that describes the group structure between cells. -
attributeMap
(Cell, Map) entries that hold the view attributes for the cells. -
bounds
Rectangle that defines the former bounds of the views.
-
-
Constructor Details
-
GraphTransferable
public GraphTransferable(Object[] cells, Map attrMap, Rectangle2D bounds, ConnectionSet cs, ParentMap pm) Constructs a new transferable selection forcells
,cs
andattrMap
.
-
-
Method Details
-
getCells
Returns thecells
that represent the selection. -
getConnectionSet
Returns the connections betweencells
(and possibly other, unselected cells). -
getParentMap
-
getAttributeMap
Returns a map of (GraphCell, Map)-pairs that represent the view attributes for the respecive cells. -
getBounds
-
lostOwnership
- Specified by:
lostOwnership
in interfaceClipboardOwner
-
getRicherFlavors
Returns the jvm-localreference flavors of the transferable.- Overrides:
getRicherFlavors
in classBasicGraphTransferable
-
getRicherData
Fetch the data in a jvm-localreference format.- Overrides:
getRicherData
in classBasicGraphTransferable
- Throws:
UnsupportedFlavorException
-
isPlainSupported
public boolean isPlainSupported()Returns true if the transferable support a text/plain format.- Overrides:
isPlainSupported
in classBasicGraphTransferable
-
getPlainData
Fetch the data in a text/plain format.- Overrides:
getPlainData
in classBasicGraphTransferable
-
isHTMLSupported
public boolean isHTMLSupported()Returns true if the transferable support a text/html format.- Overrides:
isHTMLSupported
in classBasicGraphTransferable
-
getHTMLData
Fetch the data in a text/html format.- Overrides:
getHTMLData
in classBasicGraphTransferable
-