Package y.base

Examples of y.base.Edge


        Node planetClassNode = graph.getNode(planetClass);
        Node galaxyClassNode = graph.getNode(galaxyClass);
        Node galaxyConstructorNode = graph.getNode(galaxyContstructor);
        Assert.assertEquals("Parent node of " + galaxyConstructorNode + " has to be " + galaxyClassNode, galaxyClassNode, graph.getHierarchyManager().getParentNode(galaxyConstructorNode));

        Edge invocation = galaxyClassNode.getEdge(planetClassNode);
        Assert.assertNotNull("There should be an edge between " + galaxyClassNode + " and " + planetClassNode, invocation);
    }
View Full Code Here


    @Override
    public void initSelection() {
        Set<Node> nodesToSelect = new HashSet<Node>();
        for (Object selected : fSelection) {
            if (selected instanceof Edge) {
                Edge edge = (Edge) selected;
                nodesToSelect.add(edge.source());
                nodesToSelect.add(edge.target());
            } else if (selected instanceof Node) {
                Node node = (Node) selected;
                for (EdgeCursor ec = node.edges(); ec.ok(); ec.next()) {
                    Edge edge = ec.edge();
                    if (edge.source() != node) {
                        nodesToSelect.add(edge.source());
                    } else if (edge.target() != node) {
                        nodesToSelect.add(edge.target());
                    }
                }
            }
        }
View Full Code Here

        AbstractFamixEntity entity = getGraphLoader().getGraph().getFamixEntity(getSelectedNode());
        List<AbstractFamixEntity> descendants = getGraphLoader().getSnapshotAnalyzer().getDescendants(entity);

        List<? extends FamixAssociation> associationsToOtherEntities = getGraphLoader().getSnapshotAnalyzer().queryAssociationsOfEntities(descendants, getAssociationType(), "from");
        for (FamixAssociation association : associationsToOtherEntities) {
            Edge edge = getGraphLoader().getGraph().getEdge(association);
            if (edge != null) {
                if (!dependentEntities.contains(association.getTo())) {
                    dependentEntities.add(association.getTo());
                }
            }
View Full Code Here

     * @return The list of added associations.
     */
    public List<FamixAssociation> addAssociations(List<? extends FamixAssociation> associations) {
        List<FamixAssociation> addedAssociations = new ArrayList<FamixAssociation>();
        for (FamixAssociation association : associations) {
            Edge edge = getGraph().createEdge(association);
            if (edge != null) {
                addedAssociations.add(association);
            }
        }

View Full Code Here

     * @param association The FAMIX association to create an edge for.
     *
     * @return The created yFiles edge.
     */
    public Edge createEdge(FamixAssociation association) {
        Edge edge = null;

        Node nodeFrom = this.getNode(association.getFrom());
        Node nodeTo = this.getNode(association.getTo());
        if (nodeFrom != null && nodeTo != null) {
            if (!nodeFrom.equals(nodeTo)) {
View Full Code Here

     * @return True if the association/edge has been removed otherwise false.
     */
    public boolean removeAssociation(FamixAssociation association) {
        boolean isRemoved = false;

        Edge edge = this.getEdge(association);
        if (edge != null) {
            this.getFamixToEdgeMap().remove(association);
            this.getEdgeToFamixMap().set(edge, null);
            Graph graph = edge.getGraph();
            if (graph != null) { // graph is null for edges contained by a collapsed node
                graph.removeEdge(edge);
            }
            isRemoved = true;
        }
View Full Code Here

     * @param lowLevelEdge The edge to reinsert into the graph.
     *
     * @return The reinserted edge (if it has been successfully reinserted and replaced the old one).
     */
    public Edge reinsertLowLevelEdge(Edge lowLevelEdge) {
        Edge reinsertedEdge = null;

        FamixAssociation association = this.getAssociation(lowLevelEdge);
        if (association != null) {
            Node from = this.getNode(association.getFrom());
            Node to = this.getNode(association.getTo());
View Full Code Here

     * @return The FAMIX association type.
     *
     * @throws EvolizerRuntimeException the evolizer runtime exception
     */
    public java.lang.Class<? extends FamixAssociation> getEdgeType(Edge edge) throws EvolizerRuntimeException {
        Edge edgeToCheck = null;
        List<Edge> lowLevelEdges = this.getLowLevelEdges(edge);
        if (lowLevelEdges != null && lowLevelEdges.size() > 0) {
            edgeToCheck = lowLevelEdges.get(0);
        } else {
            edgeToCheck = edge;
View Full Code Here

        HierarchyManager hierarchyManager = getRootGraph().getHierarchyManager();
        Graph rootGraph = hierarchyManager.getRootGraph();
        for (NodeCursor nc = rootGraph.nodes(); nc.ok(); nc.next()) {
            Node v = nc.node();
            for (EdgeCursor ec = v.outEdges(); ec.ok(); ec.next()) {
                Edge e = ec.edge();
                allEdges.add(e);
            }
        }
        group(allEdges);
    }
View Full Code Here

        List<Edge> inOutEdges = getInOutEdges(node);
        for (Edge edge : inOutEdges) {
            List<Edge> lowLevelEdges = fGraph.getLowLevelEdges(edge);
            if (lowLevelEdges != null && lowLevelEdges.size() > 0) {
                for (Edge lowLevelEdge : lowLevelEdges) {
                    Edge reinsertedEdge = fGraph.reinsertLowLevelEdge(lowLevelEdge);
                    if (reinsertedEdge != null) {
                        reinsertedLowEdges.add(reinsertedEdge);
                    } else {
                        sLogger.error("Could not get association of low level edge " + lowLevelEdge);
                    }
View Full Code Here

TOP

Related Classes of y.base.Edge

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.