Package org.gephi.preview.plugin.items

Examples of org.gephi.preview.plugin.items.EdgeItem


            // As this renderer is called after the EdgeRenderer (which has a position=100,
            // and this renderer has no specific position) we know these edge
            // items are well defined and already posses a color
            Item[] edgeItems = previewModel.getItems(Item.EDGE);
            for (Item item : edgeItems) {
                EdgeItem edgeItem = (EdgeItem) item;
                Boolean mutual = edgeItem.getData(EdgeItem.MUTUAL);
                if (mutual) {
                    //If mutual edge, change the color
                    edgeItem.setData(EdgeItem.COLOR, color);
                }
            }
        }
    }
View Full Code Here


    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;
    }
View Full Code Here

TOP

Related Classes of org.gephi.preview.plugin.items.EdgeItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.