Examples of EdgeItem


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

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

    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

Examples of prefuse.visual.EdgeItem

                calcRepulsion(g, n);
            }

            // Calculate attraction
            for (Iterator iter = g.edges(); iter.hasNext();) {
                EdgeItem e = (EdgeItem) iter.next();
                calcAttraction(e);
            }

            for (Iterator iter = g.nodes(); iter.hasNext();) {
                NodeItem n = (NodeItem)iter.next();
View Full Code Here

Examples of prefuse.visual.EdgeItem

            fsim.addItem(fitem);
        }
        if ( m_edgeGroup != null ) {
            iter = m_vis.visibleItems(m_edgeGroup);
            while ( iter.hasNext() ) {
                EdgeItem  e  = (EdgeItem)iter.next();
                NodeItem  n1 = e.getSourceItem();
                ForceItem f1 = (ForceItem)n1.get(FORCEITEM);
                NodeItem  n2 = e.getTargetItem();
                ForceItem f2 = (ForceItem)n2.get(FORCEITEM);
                float coeff = getSpringCoefficient(e);
                float slen = getSpringLength(e);
                fsim.addSpring(f1, f2, (coeff>=0?coeff:-1.f), (slen>=0?slen:-1.f));
            }
View Full Code Here

Examples of prefuse.visual.EdgeItem

     * @param state the highlighting state to apply to neighbors
     */
    protected void setNeighborHighlight(NodeItem n, boolean state) {
        Iterator iter = n.edges();
        while ( iter.hasNext() ) {
            EdgeItem eitem = (EdgeItem)iter.next();
            NodeItem nitem = eitem.getAdjacentItem(n);
            if (eitem.isVisible() || highlightWithInvisibleEdge) {
                eitem.setHighlighted(state);
                nitem.setHighlighted(state);
            }
        }
        if ( activity != null )
            n.getVisualization().run(activity);
View Full Code Here

Examples of prefuse.visual.EdgeItem

   
    /**
     * @see prefuse.render.AbstractShapeRenderer#getRawShape(prefuse.visual.VisualItem)
     */
    protected Shape getRawShape(VisualItem item) {
        EdgeItem   edge = (EdgeItem)item;
        VisualItem item1 = edge.getSourceItem();
        VisualItem item2 = edge.getTargetItem();
       
        int type = m_edgeType;
       
        getAlignedPoint(m_tmpPoints[0], item1.getBounds(),
                        m_xAlign1, m_yAlign1);
        getAlignedPoint(m_tmpPoints[1], item2.getBounds(),
                        m_xAlign2, m_yAlign2);
        m_curWidth = (float)(m_width * getLineWidth(item));
       
        // create the arrow head, if needed
        EdgeItem e = (EdgeItem)item;
        if ( e.isDirected() && m_edgeArrow != Constants.EDGE_ARROW_NONE ) {
            // get starting and ending edge endpoints
            boolean forward = (m_edgeArrow == Constants.EDGE_ARROW_FORWARD);
            Point2D start = null, end = null;
            start = m_tmpPoints[forward?0:1];
            end   = m_tmpPoints[forward?1:0];
           
            // compute the intersection with the target bounding box
            VisualItem dest = forward ? e.getTargetItem() : e.getSourceItem();
            int i = GraphicsLib.intersectLineRectangle(start, end,
                    dest.getBounds(), m_isctPoints);
            if ( i > 0 ) end = m_isctPoints[0];
           
            // create the arrow head shape
View Full Code Here

Examples of prefuse.visual.EdgeItem

        PrefuseLib.updateVisible(n, true);
        double localDOI = -ldist / Math.min(1000.0, m_divisor);
        n.setDOI(doi+localDOI);
       
        if ( c != null ) {
            EdgeItem e = (EdgeItem)c.getParentEdge();
            e.setDOI(c.getDOI());
            PrefuseLib.updateVisible(e, true);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.