Gephi Toolkit Javadoc

org.gephi.preview.spi
Interface ItemBuilder

All Known Implementing Classes:
EdgeBuilder, EdgeLabelBuilder, NodeBuilder, NodeLabelBuilder

public interface ItemBuilder

Builds and returns new Item instances.

Items are the visual elements representing the graph and are built by item builders from the graph object.

An item builder should build only a single type of items. Items are defined by a type Item.getType(), which needs to be the same as the value returned by getType(). In other words if this builder is building Node.Item items, it should return Node.Item as a type.

Item builders are singleton services and implementations need to add the following annotation to be recognized by the system:

@ServiceProvider(service=ItemBuilder.class)

Author:
Yudi Xue, Mathieu Bastian

Field Summary
static java.lang.String EDGE_BUILDER
           
static java.lang.String EDGE_LABEL_BUILDER
           
static java.lang.String NODE_BUILDER
           
static java.lang.String NODE_LABEL_BUILDER
           
 
Method Summary
 Item[] getItems(Graph graph, AttributeModel attributeModel)
          Build items from the graph and attributeModel.
 java.lang.String getType()
          Returns the type of this builder.
 

Field Detail

NODE_BUILDER

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

NODE_LABEL_BUILDER

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

EDGE_BUILDER

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

EDGE_LABEL_BUILDER

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

getItems

Item[] getItems(Graph graph,
                AttributeModel attributeModel)
Build items from the graph and attributeModel.

Parameters:
graph - the graph to build items from
attributeModel - the attribute model associated to the graph
Returns:
an array of new items, from the same type returned by getType()

getType

java.lang.String getType()
Returns the type of this builder.

The type should always match the type of Item the builder is building. For instance if the builder is building Item.Node type, this method should return Item.Node.

Returns:
the builder item type.

Gephi Toolkit Javadoc