Package org.gephi.datalab.api

Examples of org.gephi.datalab.api.GraphElementsController


    public void setup(Node[] nodes, Node clickedNode) {
        this.nodes = nodes;
    }

    public void execute() {
        GraphElementsController gec = Lookup.getDefault().lookup(GraphElementsController.class);
        gec.ungroupNodes(nodes);//At least 1 node is a group. And we don't have to check now every node because the ungroupNodes method does it for us.
    }
View Full Code Here


    public String getDescription() {
        return "";
    }

    public boolean canExecute() {
        GraphElementsController gec = Lookup.getDefault().lookup(GraphElementsController.class);
        for (Node n : nodes) {
            if (gec.canUngroupNode(n)) {
                return true;//If any of the nodes can be ungrouped, then allow to execute this action.
            }
        }
        return false;
    }
View Full Code Here

        this.nodes = nodes;
    }

    public void execute() {
        if (JOptionPane.showConfirmDialog(null, NbBundle.getMessage(DeleteNodes.class, "DeleteNodes.confirmation.message"), getName(), JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
            GraphElementsController gec = Lookup.getDefault().lookup(GraphElementsController.class);
            gec.deleteNodes(nodes);
        }
    }
View Full Code Here

        this.nodes = nodes;
    }

    public void execute() {
        if (group != null) {
            GraphElementsController gec = Lookup.getDefault().lookup(GraphElementsController.class);
            gec.moveNodesToGroup(nodes, group);
        }
    }
View Full Code Here

    /**
     * Can group nodes so it can be all moved to a group (at least 1 available)
     */
    public boolean canExecute() {
        GraphElementsController gec = Lookup.getDefault().lookup(GraphElementsController.class);
        boolean canGroup = gec.canGroupNodes(nodes);
        if (canGroup) {
            availableGroupsToMoveNodes = gec.getAvailableGroupsToMoveNodes(nodes);
            return availableGroupsToMoveNodes != null && availableGroupsToMoveNodes.length > 0;
        } else {
            return false;
        }
    }
View Full Code Here

TOP

Related Classes of org.gephi.datalab.api.GraphElementsController

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.