Search in sources :

Example 1 with NodesManipulatorBuilder

use of org.gephi.datalab.spi.nodes.NodesManipulatorBuilder in project gephi by gephi.

the class DataLaboratoryHelper method getNodesManipulators.

/**
     * <p>Prepares an array with one new instance of every NodesManipulator
     * that has a builder registered and returns it.</p>
     * <p>It also returns the manipulators ordered first by type and then by position.</p>
     * @return Array of all NodesManipulator implementations
     */
public NodesManipulator[] getNodesManipulators() {
    ArrayList<NodesManipulator> nodesManipulators = new ArrayList<>();
    for (NodesManipulatorBuilder nm : Lookup.getDefault().lookupAll(NodesManipulatorBuilder.class)) {
        nodesManipulators.add(nm.getNodesManipulator());
    }
    sortManipulators(nodesManipulators);
    return nodesManipulators.toArray(new NodesManipulator[0]);
}
Also used : NodesManipulatorBuilder(org.gephi.datalab.spi.nodes.NodesManipulatorBuilder) ArrayList(java.util.ArrayList) NodesManipulator(org.gephi.datalab.spi.nodes.NodesManipulator)

Aggregations

ArrayList (java.util.ArrayList)1 NodesManipulator (org.gephi.datalab.spi.nodes.NodesManipulator)1 NodesManipulatorBuilder (org.gephi.datalab.spi.nodes.NodesManipulatorBuilder)1