Package org.gephi.preview.api
Interface Item
-
public interface Item
An item is a visual element built by anItemBuilder
and later used by aRenderer
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
Fields Modifier and Type Field Description static String
EDGE
static String
EDGE_LABEL
static String
NODE
static String
NODE_LABEL
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <D> D
getData(String key)
Returns data associated to this item.String[]
getKeys()
Returns all the keys.Object
getSource()
Returns the source of the item.String
getType()
Returns the type of the item.void
setData(String key, Object value)
Sets data to this item.
-
-
-
Field Detail
-
NODE
static final String NODE
- See Also:
- Constant Field Values
-
EDGE
static final String EDGE
- See Also:
- Constant Field Values
-
NODE_LABEL
static final String NODE_LABEL
- See Also:
- Constant Field Values
-
EDGE_LABEL
static final String EDGE_LABEL
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSource
Object getSource()
Returns the source of the item. The source is usually a graph object like aNode
orEdge
.- Returns:
- the item's source object
-
getType
String getType()
Returns the type of the item. Default types areItem.NODE
,Item.EDGE
,Item.NODE_LABEL
andItem.EDGE_LABEL
.- Returns:
- the item's type
-
getData
<D> D getData(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
, ornull
if not exist
-
setData
void setData(String key, Object value)
Sets data to this item.- Parameters:
key
- the keyvalue
- the value to be associated withkey
-
getKeys
String[] getKeys()
Returns all the keys. That allows to enumerate all data associated with this item.- Returns:
- all keys
-
-