Package org.gephi.graph.dhns.edge

Examples of org.gephi.graph.dhns.edge.AbstractEdge


        node.setEnabledMutualDegree(0);
    }

    public void computeEdgesCounting(AbstractNode node) {
        for (edgeIterator.setNode(node.getEdgesOutTree()); edgeIterator.hasNext();) {
            AbstractEdge edge = edgeIterator.next();
            AbstractNode target = edge.getTarget(view.getViewId());
            if (target.isEnabled()) {
                target.incEnabledInDegree();
                node.incEnabledOutDegree();
                view.incEdgesCountEnabled(1);
                if (target.getEdgesOutTree().hasNeighbour(node) && target.getId() < node.getId()) {
View Full Code Here


        Node node4 = nodeMap2.get("Node 4");
        Node node5 = nodeMap2.get("Node 5");
        Node node6 = nodeMap2.get("Node 6");
        Node node7 = nodeMap2.get("Node 7");

        AbstractEdge edge1 = factory2.newEdge(node4, node5);
        AbstractEdge edge2 = factory2.newEdge(node5, node6);
        AbstractEdge edge3 = factory2.newEdge(node6, node5);
        AbstractEdge edge4 = factory2.newEdge(node7, node7);
        AbstractEdge edge5 = factory2.newEdge(node4, node4);
        graph2.addEdge(edge1);
        graph2.addEdge(edge2);
        graph2.addEdge(edge3);
        graph2.addEdge(edge4);
        graph2.addEdge(edge5);
View Full Code Here

        if (source == null || target == null) {
            throw new NullPointerException();
        }
        AbstractNode nodeSource = (AbstractNode) source;
        AbstractNode nodeTarget = (AbstractNode) target;
        AbstractEdge edge;
        if (source == target) {
            edge = new SelfLoopImpl(idGen.newEdgeId(), nodeSource);
        } else {
            edge = new ProperEdgeImpl(idGen.newEdgeId(), nodeSource, nodeTarget);
        }
        edge.setAttributes(newEdgeAttributes(edge.getEdgeData()));
        edge.getEdgeData().setTextData(newTextData());
        edge.getEdgeData().setId("" + edge.getId());
        return edge;
    }
View Full Code Here

        int res = structure.getLevelSize(level);
        return res;
    }

    public boolean isSelfLoop(Edge edge) {
        AbstractEdge absEdge = checkEdge(edge);
        return absEdge.getSource(view.getViewId()) == absEdge.getTarget(view.getViewId());
    }
View Full Code Here

        if (source == null || target == null) {
            throw new NullPointerException();
        }
        AbstractNode nodeSource = (AbstractNode) source;
        AbstractNode nodeTarget = (AbstractNode) target;
        AbstractEdge edge;
        if (source == target) {
            edge = new SelfLoopImpl(idGen.newEdgeId(), nodeSource);
        } else {
            edge = new MixedEdgeImpl(idGen.newEdgeId(), nodeSource, nodeTarget, directed);
        }

        edge.setAttributes(newEdgeAttributes(edge.getEdgeData()));
        edge.setWeight(weight);
        edge.getEdgeData().setTextData(newTextData());
        if (id != null) {
            edge.getEdgeData().setId(id);
        } else {
            edge.getEdgeData().setId("" + edge.getId());
        }
        return edge;
    }
View Full Code Here

    public boolean isAdjacent(Edge edge1, Edge edge2) {
        if (edge1 == edge2) {
            throw new IllegalArgumentException("Edges can't be the same");
        }
        AbstractEdge absEdge1 = checkEdge(edge1);
        AbstractEdge absEdge2 = checkEdge(edge2);
        return absEdge1.getSource(view.getViewId()) == absEdge2.getSource(view.getViewId())
                || absEdge1.getSource(view.getViewId()) == absEdge2.getTarget(view.getViewId())
                || absEdge1.getTarget(view.getViewId()) == absEdge2.getSource(view.getViewId())
                || absEdge1.getTarget(view.getViewId()) == absEdge2.getTarget(view.getViewId());
    }
View Full Code Here

                || absEdge1.getTarget(view.getViewId()) == absEdge2.getTarget(view.getViewId());
    }

    public Node getOpposite(Node node, Edge edge) {
        checkNode(node);
        AbstractEdge absEdge = checkEdgeOrMetaEdge(edge);
        if (absEdge.getSource(view.getViewId()) == node) {
            return absEdge.getTarget(view.getViewId());
        } else if (absEdge.getTarget(view.getViewId()) == node) {
            return absEdge.getSource(view.getViewId());
        }
        throw new IllegalArgumentException("Node must be either source or target of the edge.");
    }
View Full Code Here

    protected AbstractEdge checkEdge(Edge edge) {
        if (edge == null) {
            throw new IllegalArgumentException("edge can't be null");
        }
        AbstractEdge abstractEdge = (AbstractEdge) edge;
        if (!abstractEdge.isValid()) {
            throw new IllegalArgumentException("Nodes must be in the graph");

        }
        if (abstractEdge.isMetaEdge()) {
            throw new IllegalArgumentException("Edge can't be a meta edge");
        }
        return abstractEdge;
    }
View Full Code Here

    protected MetaEdgeImpl checkMetaEdge(Edge edge) {
        if (edge == null) {
            throw new IllegalArgumentException("edge can't be null");
        }
        AbstractEdge absEdge = (AbstractEdge) edge;
        if (!absEdge.isMetaEdge()) {
            throw new IllegalArgumentException("edge must be a meta edge");
        }
        if (!absEdge.isValid()) {
            throw new IllegalArgumentException("Nodes must be in the graph");
        }
        return (MetaEdgeImpl) absEdge;
    }
View Full Code Here

    protected AbstractEdge checkEdgeOrMetaEdge(Edge edge) {
        if (edge == null) {
            throw new IllegalArgumentException("edge can't be null");
        }
        AbstractEdge absEdge = (AbstractEdge) edge;
        if (!absEdge.isValid()) {
            throw new IllegalArgumentException("Nodes must be in the graph");
        }
        return absEdge;
    }
View Full Code Here

TOP

Related Classes of org.gephi.graph.dhns.edge.AbstractEdge

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.