Package y.base

Examples of y.base.Node


        Assert.assertTrue("Command should add entities", command.getEditedEntities().size() > 0);
        Assert.assertTrue("Command should add associations", command.getEditedAssociations().size() > 0);
        Assert.assertTrue("Command should add class " + galaxyClass, command.getEditedEntities().contains(galaxyClass));
        Assert.assertTrue("Command should add method " + galaxyContstructor, command.getEditedEntities().contains(galaxyContstructor));

        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


        org.evolizer.famix.model.entities.FamixClass planetClass = new org.evolizer.famix.model.entities.FamixClass("thebigvoid.Planet", null);
        Assert.assertTrue("Graph must contain FAMIX entity " + planetClass.getUniqueName(), graph.contains(planetClass));
        org.evolizer.famix.model.entities.FamixMethod planetContstructor = new org.evolizer.famix.model.entities.FamixMethod("thebigvoid.Planet.<init>(java.lang.String,java.awt.Color)", null);
        Assert.assertTrue("Graph must contain FAMIX entity " + planetContstructor.getUniqueName(), graph.contains(planetContstructor));

        Node thebigvoidPackageNode = graph.getNode(thebigvoidPackage);
        Node planetClassNode = graph.getNode(planetClass);
        //    Node planetConstructorNode = graph.getNode(planetContstructor);
        Assert.assertEquals(thebigvoidPackageNode + " node should have 1 child nodes before adding the associations", 1, graph.getHierarchyManager().getChildren(thebigvoidPackageNode).size());

        AbstractGraphEditCommand command = new AddEntitiesViaInDependenciesCommand(
                planetClassNode,
                fGraphPanel.getGraphLoader(),
                fGraphPanel.getEdgeGrouper(),
                org.evolizer.famix.model.entities.FamixInvocation.class);
        command.execute();

        org.evolizer.famix.model.entities.FamixClass galaxyClass = new org.evolizer.famix.model.entities.FamixClass("thebigvoid.Galaxy", null);
        Assert.assertTrue("Graph must contain FAMIX entity " + galaxyClass.getUniqueName(), graph.contains(galaxyClass));
        org.evolizer.famix.model.entities.FamixMethod galaxyContstructor = new org.evolizer.famix.model.entities.FamixMethod("thebigvoid.Galaxy.<init>(java.lang.String)", null);
        Assert.assertTrue("Graph must contain FAMIX entity " + galaxyContstructor.getUniqueName(), graph.contains(galaxyContstructor));
        Node galaxyClassNode = graph.getNode(galaxyClass);
        Node galaxyConstructorNode = graph.getNode(galaxyContstructor);

        //    fGraphPanel.getHierarchicEdgeGrouper().handleOpenFolder(planetClassNode);
        //    fGraphPanel.getHierarchicEdgeGrouper().handleOpenFolder(galaxyClassNode);

        Assert.assertEquals("Parent node of " + galaxyClassNode + " has to be " + thebigvoidPackageNode, thebigvoidPackageNode, graph.getHierarchyManager().getParentNode(galaxyClassNode));
View Full Code Here

        org.evolizer.famix.model.entities.FamixClass planetClass = new org.evolizer.famix.model.entities.FamixClass("thebigvoid.Planet", null);
        Assert.assertTrue("Graph must contain FAMIX entity " + planetClass.getUniqueName(), graph.contains(planetClass));
        org.evolizer.famix.model.entities.FamixMethod planetContstructor = new org.evolizer.famix.model.entities.FamixMethod("thebigvoid.Planet.<init>(java.lang.String,java.awt.Color)", null);
        Assert.assertTrue("Graph must contain FAMIX entity " + planetContstructor.getUniqueName(), graph.contains(planetContstructor));

        Node thebigvoidPackageNode = graph.getNode(thebigvoidPackage);
        Node planetClassNode = graph.getNode(planetClass);
        //    Node planetConstructorNode = graph.getNode(planetContstructor);
        Assert.assertEquals(thebigvoidPackageNode + " node should have 1 child nodes before adding the associations", 1, graph.getHierarchyManager().getChildren(thebigvoidPackageNode).size());

        AbstractGraphEditCommand command = new AddEntitiesViaOutDependenciesCommand(
                planetClassNode,
                fGraphPanel.getGraphLoader(),
                fGraphPanel.getEdgeGrouper(),
                null);
        command.execute();

        org.evolizer.famix.model.entities.FamixClass stellarObjectClass = new org.evolizer.famix.model.entities.FamixClass("thebigvoid.StellarObject", null);
        Assert.assertTrue("Graph must contain FAMIX entity " + stellarObjectClass.getUniqueName(), graph.contains(stellarObjectClass));
        org.evolizer.famix.model.entities.FamixAttribute stellarObjectName = new org.evolizer.famix.model.entities.FamixAttribute("thebigvoid.StellarObject.name", null);
        Assert.assertTrue("Graph must contain FAMIX entity " + stellarObjectName.getUniqueName(), graph.contains(stellarObjectName));
        Node stellarObjectClassNode = graph.getNode(stellarObjectClass);
        Node stellarObjectNameNode = graph.getNode(stellarObjectName);

        Assert.assertEquals("Parent node of " + stellarObjectClassNode + " has to be " + thebigvoidPackageNode, thebigvoidPackageNode, graph.getHierarchyManager().getParentNode(stellarObjectClassNode));
        Assert.assertEquals("Parent node of " + stellarObjectNameNode + " has to be " + stellarObjectClassNode, stellarObjectClassNode, graph.getHierarchyManager().getParentNode(stellarObjectNameNode));
        Assert.assertEquals(thebigvoidPackageNode + " node should have 2 child nodes after adding the associations", 2, graph.getHierarchyManager().getChildren(thebigvoidPackageNode).size());
        Assert.assertEquals(stellarObjectClassNode + " node should have only 1 child node", 1, graph.getHierarchyManager().getChildren(stellarObjectClassNode).size());
View Full Code Here

        org.evolizer.famix.model.entities.FamixMethod getColor = new org.evolizer.famix.model.entities.FamixMethod("thebigvoid.Planet.getColor()", null);
        Assert.assertTrue("Graph must contain FAMIX entity " + getColor.getUniqueName(), graph.contains(getColor));
        org.evolizer.famix.model.entities.FamixAttribute color = new org.evolizer.famix.model.entities.FamixAttribute("thebigvoid.Planet.color", null);
        Assert.assertTrue("Graph must contain FAMIX entity " + color.getUniqueName(), graph.contains(color));

        Node thebigvoidPackageNode = graph.getNode(thebigvoidPackage);
        Node planetClassNode = graph.getNode(planetClass);
        Node planetConstructorNode = graph.getNode(planetContstructor);
        Node getColorNode = graph.getNode(getColor);
        Node colorNode = graph.getNode(color);
        Assert.assertNull("Parent node of " + thebigvoidPackageNode + " has to be null", graph.getHierarchyManager().getParentNode(thebigvoidPackageNode));
        Assert.assertEquals("Parent node of " + planetClassNode + " has to be " + thebigvoidPackageNode, thebigvoidPackageNode, graph.getHierarchyManager().getParentNode(planetClassNode));
        Assert.assertEquals("Parent node of " + planetConstructorNode + " has to be " + planetClassNode, planetClassNode, graph.getHierarchyManager().getParentNode(planetConstructorNode));
        Assert.assertEquals("Parent node of " + getColorNode + " has to be " + planetClassNode, planetClassNode, graph.getHierarchyManager().getParentNode(getColorNode));
        Assert.assertEquals("Parent node of " + colorNode + " has to be " + planetClassNode, planetClassNode, graph.getHierarchyManager().getParentNode(colorNode));
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void execute() {
        Node selectedNode = getGraphLoader().getGraph().getNode(fSelectedEntity);
        if (fIsOpenCommand) {
            openFolder(selectedNode);
        } else {
            closeGroup(selectedNode);
        }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void undo() {
        Node selectedNode = getGraphLoader().getGraph().getNode(fSelectedEntity);
        if (fIsOpenCommand) {
            closeGroup(selectedNode);
        } else {
            openFolder(selectedNode);
        }
View Full Code Here

    private void expandToEntities() {
        DependencyGraph graph = getGraphLoader().getGraph();
        for (AbstractFamixEntity entity : fEntities) {
            List<AbstractFamixEntity> parentEntities = getGraphLoader().getSnapshotAnalyzer().getParentEntities(entity);
            for (int i = parentEntities.size() - 1; i >= 0; i--) {
                Node parentNode = graph.getNode(parentEntities.get(i));
                if (parentNode != null) {
                    GroupNodeRealizer gr = (GroupNodeRealizer) graph.getRealizer(parentNode);
                    if (gr.isGroupClosed()) {
                        getEdgeGrouper().handleOpenFolder(parentNode);
                    }
View Full Code Here

        EditResult editResult = getCommand().getEditResult();
        DependencyGraph graph = getCommand().getGraphLoader().getGraph();

        if (!editResult.isEmpty()) {
            for (AbstractFamixEntity entity : editResult.getEntities()) {
                Node node = graph.getNode(entity);
                if (node != null) {
                    nodesToSelect.add(node);
                }
            }
        }
View Full Code Here

    public void initSelection() {
        Set<Node> nodesToSelect = new HashSet<Node>();
        DependencyGraph graph = getCommand().getGraphLoader().getGraph();

        for (AbstractFamixEntity entity : fEntities) {
            Node node = graph.getNode(entity);
            if (node != null) {
                nodesToSelect.add(node);
            } else {
                sLogger.error("Could not determine graph node of FAMIX entity " + entity.getUniqueName());
            }
View Full Code Here

            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

TOP

Related Classes of y.base.Node

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.