Gephi Toolkit Javadoc

org.gephi.preview.api
Interface Item

All Known Implementing Classes:
AbstractItem, EdgeItem, EdgeLabelItem, NodeItem, NodeLabelItem

public interface Item

An item is a visual element built by an ItemBuilder and later used by a Renderer to be displayed.

An item simply stores the reference to the original object (e.g. node, edge) and all the information useful for the Renderer like the color, size or position.

All items can be retrieved from the PreviewModel.

Author:
Yudi Xue, Mathieu Bastian

Field Summary
static java.lang.String EDGE
           
static java.lang.String EDGE_LABEL
           
static java.lang.String NODE
           
static java.lang.String NODE_LABEL
           
 
Method Summary
<D> D
getData(java.lang.String key)
          Returns data associated to this item.
 java.lang.String[] getKeys()
          Returns all the keys.
 java.lang.Object getSource()
          Returns the source of the item.
 java.lang.String getType()
          Returns the type of the item.
 void setData(java.lang.String key, java.lang.Object value)
          Sets data to this item.
 

Field Detail

NODE

static final java.lang.String NODE
See Also:
Constant Field Values

EDGE

static final java.lang.String EDGE
See Also:
Constant Field Values

NODE_LABEL

static final java.lang.String NODE_LABEL
See Also:
Constant Field Values

EDGE_LABEL

static final java.lang.String EDGE_LABEL
See Also:
Constant Field Values
Method Detail

getSource

java.lang.Object getSource()
Returns the source of the item. The source is usually a graph object like a Node or Edge.

Returns:
the item's source object

getType

java.lang.String getType()
Returns the type of the item. Default types are Item.NODE, Item.EDGE, Item.NODE_LABEL and Item.EDGE_LABEL.

Returns:
the item's type

getData

<D> D getData(java.lang.String key)
Returns data associated to this item.

Type Parameters:
D - the type of the data
Parameters:
key - the key
Returns:
the value associated to key, or null if not exist

setData

void setData(java.lang.String key,
             java.lang.Object value)
Sets data to this item.

Parameters:
key - the key
value - the value to be associated with key

getKeys

java.lang.String[] getKeys()
Returns all the keys. That allows to enumerate all data associated with this item.

Returns:
all keys

Gephi Toolkit Javadoc