Package org.evolizer.daforjava.commands.additions

Examples of org.evolizer.daforjava.commands.additions.AddEntitiesCommand


                if (isDisplayedProject(structuredSelection)) {
                    sLogger.info("DRAG AND DROP: add selected elements to graph");
                    // add selected elements to graph
                    AbstractSelectionHandler selectionHandler = SelectionHandlerFactory.getInstance().getSelectionHandler(selection);
                    List<AbstractFamixEntity> entities = selectionHandler.getSelectedEntities(fGraphPanel.getGraphLoader().getSnapshotAnalyzer());
                    AbstractGraphEditCommand command = new AddEntitiesCommand(entities, fGraphPanel.getGraphLoader(), fGraphPanel.getEdgeGrouper());
                    fGraphPanel.getCommandController().executeCommand(command);
                } else {
                    final String message = "Unable add elements to the current graph!";
                    final IWorkbench workbench = PlatformUI.getWorkbench();
                    Display display = workbench.getDisplay();
View Full Code Here


                storeModelJob.join();

                entities = selectionHandler.getSelectedEntities(snapshotAnalyzer);
            }
           
            AbstractGraphEditCommand command = new AddEntitiesCommand(entities, fGraphPanel.getGraphLoader(), fGraphPanel.getEdgeGrouper());
            fGraphPanel.getCommandController().executeCommand(command);

            openDependencyAnalyzerPerspective();
        } catch (InterruptedException ie) {
            throw new PartInitException(ie.getMessage(), ie);
View Full Code Here

        showClassPlanet();

        IEvolizerSession session = EvolizerSessionHandler.getHandler().getCurrentSession(project.getProject());
        List<AbstractFamixEntity> queryResult = session.query("from FamixClass as c where c.uniqueName = 'thebigvoid.Galaxy'", AbstractFamixEntity.class, 1);

        AbstractGraphEditCommand command = new AddEntitiesCommand(
                queryResult,
                fGraphPanel.getGraphLoader(),
                fGraphPanel.getEdgeGrouper());
        command.execute();

        DependencyGraph graph = fGraphPanel.getGraph();

        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.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));

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

                    fMonitor.worked(10);
                    // AbstractSelectionHandler selectionHandler = new JavaElementSelectionHandler(graphEditor.getPanel().getGraphLoader().getSnapshotAnalyzer());
                    // List<AbstractFamixEntity> entities = selectionHandler.getSelectedEntities(fSelection);
                    AbstractSelectionHandler selectionHandler = SelectionHandlerFactory.getInstance().getSelectionHandler(fSelection);
                    List<AbstractFamixEntity> entities = selectionHandler.getSelectedEntities(graphEditor.getPanel().getGraphLoader().getSnapshotAnalyzer());
                    AbstractGraphEditCommand command = new AddEntitiesCommand(entities, graphEditor.getPanel().getGraphLoader(), graphEditor.getPanel().getEdgeGrouper());
                    graphEditor.getPanel().getCommandController().executeCommand(command);

                    fMonitor.worked(25);
                } else {
                    System.err.println("Editor is not a graph editor - select an active graph editor first");
View Full Code Here

TOP

Related Classes of org.evolizer.daforjava.commands.additions.AddEntitiesCommand

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.