Package org.gephi.preview.api
Interface Item
-
public interface ItemAn item is a visual element built by anItemBuilderand later used by aRendererto be displayed.An item simply stores the reference to the original object (e.g. node, edge) and all the information useful for the
Rendererlike 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 StringEDGEstatic StringEDGE_LABELstatic StringNODEstatic StringNODE_LABEL
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <D> DgetData(String key)Returns data associated to this item.String[]getKeys()Returns all the keys.ObjectgetSource()Returns the source of the item.StringgetType()Returns the type of the item.voidsetData(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 aNodeorEdge.- Returns:
- the item's source object
-
getType
String getType()
Returns the type of the item. Default types areItem.NODE,Item.EDGE,Item.NODE_LABELandItem.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, ornullif 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
-
-