GraphTransferable (JGraph v5.12.4.2 API Specification)
Keywords: org.jgraph.graph.GraphTransferable class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| JGraph v5.12.4.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jgraph.graph
Class GraphTransferable

    java.lang.Object
      org.jgraph.plaf.basic.BasicGraphTransferable
          org.jgraph.graph.GraphTransferable

All Implemented Interfaces:
  ClipboardOwner, Serializable, Transferable, 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:
  Serialized Form

Field Summary
`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 Summary
`GraphTransferable(Object[] cells, Map attrMap, Rectangle2D bounds, ConnectionSet cs, ParentMap pm)` Constructs a new transferable selection for `cells`, `cs`and `attrMap`.

Method Summary
`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)`

Methods inherited from class org.jgraph.plaf.basic.BasicGraphTransferable
`getTransferData, getTransferDataFlavors, isDataFlavorSupported, isHTMLFlavor, isPlainFlavor, isRicherFlavor, isStringFlavor`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### dataFlavor

    public static DataFlavor dataFlavor

  Local Machine Reference Data Flavor.

### cells

    protected Object[] cells

  Selected cells.

### cs

    protected ConnectionSet cs

  Object that describes the connection between cells.

### pm

    protected ParentMap pm

  Object that describes the group structure between cells.

### attributeMap

    protected Map attributeMap

  (Cell, Map) entries that hold the view attributes for the cells.

### bounds

    protected Rectangle2D bounds

  Rectangle that defines the former bounds of the views.

Constructor Detail

### GraphTransferable

    public GraphTransferable(Object[] cells,
                             Map attrMap,
                             Rectangle2D bounds,
                             ConnectionSet cs,
                             ParentMap pm)

  Constructs a new transferable selection for `cells`, `cs`and `attrMap`.

Method Detail

### getCells

    public Object[] getCells()

  Returns the `cells` that represent the selection.

### getConnectionSet

    public ConnectionSet getConnectionSet()

  Returns the connections between `cells` (and possibly other, unselected cells).

### getParentMap

    public ParentMap getParentMap()

### getAttributeMap

    public Map getAttributeMap()

  Returns a map of (GraphCell, Map)-pairs that represent the view attributes for the respecive cells.

### getBounds

    public Rectangle2D getBounds()

### lostOwnership

    public void lostOwnership(Clipboard clip,
                              Transferable contents)

  Specified by:
    `lostOwnership` in interface `ClipboardOwner`

### getRicherFlavors

    public DataFlavor[] getRicherFlavors()

  Returns the jvm-localreference flavors of the transferable.

  Overrides:
    `getRicherFlavors` in class `BasicGraphTransferable`

### getRicherData

    public Object getRicherData(DataFlavor flavor)
                         throws UnsupportedFlavorException

  Fetch the data in a jvm-localreference format.

  Overrides:
    `getRicherData` in class `BasicGraphTransferable`
  Throws:
    `UnsupportedFlavorException`

### isPlainSupported

    public boolean isPlainSupported()

  Returns true if the transferable support a text/plain format.

  Overrides:
    `isPlainSupported` in class `BasicGraphTransferable`

### getPlainData

    public String getPlainData()

  Fetch the data in a text/plain format.

  Overrides:
    `getPlainData` in class `BasicGraphTransferable`

### isHTMLSupported

    public boolean isHTMLSupported()

  Returns true if the transferable support a text/html format.

  Overrides:
    `isHTMLSupported` in class `BasicGraphTransferable`

### getHTMLData

    public String getHTMLData()

  Fetch the data in a text/html format.

  Overrides:
    `getHTMLData` in class `BasicGraphTransferable`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| JGraph v5.12.4.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (C) 2001-2008 Gaudenz Alder. All rights reserved.