Package org.evolizer.daforjava.commands

Examples of org.evolizer.daforjava.commands.CommandController


     *
     * @param graphLoader The graph loader
     */
    public DAForJavaGraphPanel(GraphLoader graphLoader) {
        fGraphLoader = graphLoader;
        fCommandController = new CommandController();
        fDependencyGraph = new DependencyGraph();

        fViewConfigModel = new ViewConfigModel();
        fPolymetricViewDataCollector = new PolymetricViewDataContainer(this);
    }
View Full Code Here


    @Test
    public void undoRedoShowClassPlanet() {
        showClassPlanet();
       
        CommandController commandController = fGraphPanel.getCommandController();
        Assert.assertEquals("Command controller must be able to undo the last command ", true, commandController.canUndo());
       
        commandController.undoCommand();
        Assert.assertEquals("Graph must not contain nodes after undo", 0, fGraphPanel.getGraph().nodeCount());
        Assert.assertEquals("Graph must not contain edges after undo", 0, fGraphPanel.getGraph().edgeCount());
        Assert.assertEquals("There should be no more command to be undone", false, commandController.canUndo());
       
        Assert.assertEquals("Command controller must be able to redo the last command ", true, commandController.canRedo());
        commandController.redoCommand();
        Assert.assertEquals("There should be no more command to be redone", false, commandController.canRedo());
       
        checkClassPlanet();
    }
View Full Code Here

    public void propertyChange(PropertyChangeEvent evt) {
        if (evt.getPropertyName().equals(CommandController.COMMAND_EXECUTED)
                || evt.getPropertyName().equals(CommandController.COMMAND_UNDONE)
                || evt.getPropertyName().equals(CommandController.COMMAND_REDONE)) {

            CommandController controller = (CommandController) evt.getSource();
            if (!controller.canRedo()) {
                fRedoButton.setEnabled(false);
            } else {
                fRedoButton.setEnabled(true);
            }
            if (!controller.canUndo()) {
                fUndoButton.setEnabled(false);
            } else {
                fUndoButton.setEnabled(true);
            }
        }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void actionPerformed(ActionEvent e) {
        CommandController controller = fGraphPanel.getCommandController();
        controller.redoCommand();
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void actionPerformed(ActionEvent e) {
        CommandController controller = fGraphPanel.getCommandController();
        controller.undoCommand();
    }
View Full Code Here

TOP

Related Classes of org.evolizer.daforjava.commands.CommandController

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.