public Item[] getItems(Graph graph, AttributeModel attributeModel) {
EdgeItem[] items = new EdgeItem[graph.getEdgeCount()];
int i = 0;
for (Edge e : graph.getEdges()) {
EdgeItem item = new EdgeItem(e);
item.setData(EdgeItem.WEIGHT, e.getWeight(graph.getView()));
item.setData(EdgeItem.DIRECTED, e.isDirected());
if (graph.isDirected(e)) {
item.setData(EdgeItem.MUTUAL, ((DirectedGraph) graph).getMutualEdge(e) != null);
}
item.setData(EdgeItem.SELF_LOOP, e.isSelfLoop());
item.setData(EdgeItem.COLOR, e.alpha() == 0 ? null : e.getColor());
items[i++] = item;
}
return items;
}