Package org.gephi.data.attributes.api

Examples of org.gephi.data.attributes.api.AttributeController


        if (projectController.getCurrentProject() == null) {
            projectControllerUI.newProject();
        }

        //Add the time interval column if not exist
        AttributeController attributeController = Lookup.getDefault().lookup(AttributeController.class);
        AttributeModel attributeModel = attributeController.getModel();
        AttributeColumn col = null;
        if ((col = attributeModel.getNodeTable().getColumn(DynamicModel.TIMEINTERVAL_COLUMN)) == null) {
            col = attributeModel.getNodeTable().addColumn(DynamicModel.TIMEINTERVAL_COLUMN, AttributeType.TIME_INTERVAL);
        }
View Full Code Here


        //Add a element for no column selected
        comboBoxModel.addElement(NO_SELECTION);

        //Get the current attribute columns in the current workspace
        AttributeController attributeController = Lookup.getDefault().lookup(AttributeController.class);
        AttributeModel attributeModel = attributeController.getModel();
        AttributeUtils utils = AttributeUtils.getDefault();
        for (AttributeColumn col : attributeModel.getNodeTable().getColumns()) {
            if (utils.isNumberColumn(col)) {
                comboBoxModel.addElement(col);
            }
View Full Code Here

            return Lookup.getDefault().lookup(GraphElementsController.class).getEdgesCount();
        }
    }

    public boolean isNodeTable(AttributeTable table) {
        AttributeController ac = Lookup.getDefault().lookup(AttributeController.class);
        return table == ac.getModel().getNodeTable();
    }
View Full Code Here

        AttributeController ac = Lookup.getDefault().lookup(AttributeController.class);
        return table == ac.getModel().getNodeTable();
    }

    public boolean isEdgeTable(AttributeTable table) {
        AttributeController ac = Lookup.getDefault().lookup(AttributeController.class);
        return table == ac.getModel().getEdgeTable();
    }
View Full Code Here

*/
@ServiceProvider(service = WorkspaceDuplicateProvider.class, position = 10)
public class AttributeModelDuplicateProvider implements WorkspaceDuplicateProvider {

    public void duplicate(Workspace source, Workspace destination) {
        AttributeController controller = Lookup.getDefault().lookup(AttributeController.class);
        AttributeModel sourceModel = controller.getModel(source);
        AttributeModel destModel = controller.getModel(destination);
        if (sourceModel != null && destModel != null) {
            destModel.mergeModel(sourceModel);
        }
    }
View Full Code Here

    public SearchResult findNext(SearchResult result) {
        return findNext(result.getSearchOptions());
    }

    public boolean canReplace(SearchResult result) {
        AttributeController ac = Lookup.getDefault().lookup(AttributeController.class);
        AttributeTable table;
        AttributeColumn column;
        if (result.getFoundNode() != null) {
            table = ac.getModel().getNodeTable();
            column = table.getColumn(result.getFoundColumnIndex());
        } else {
            table = ac.getModel().getEdgeTable();
            column = table.getColumn(result.getFoundColumnIndex());
        }
        return Lookup.getDefault().lookup(AttributeColumnsController.class).canChangeColumnData(column);
    }
View Full Code Here

        }
        if (!canReplace(result)) {
            //Data has changed and the replacement can't be done, continue finding.
            return findNext(result);//Go to next search result
        }
        AttributeController ac = Lookup.getDefault().lookup(AttributeController.class);
        Object value;
        String str;
        Attributes attributes;
        AttributeColumn column;

        if (!result.getSearchOptions().isUseRegexReplaceMode()) {
            replacement = Matcher.quoteReplacement(replacement);//Avoid using groups and other regex aspects in the replacement
        }

        try {
            //Get value to re-match and replace:
            if (result.getFoundNode() != null) {
                attributes = result.getFoundNode().getNodeData().getAttributes();
                column = ac.getModel().getNodeTable().getColumn(result.getFoundColumnIndex());
            } else {
                attributes = result.getFoundEdge().getEdgeData().getAttributes();
                column = ac.getModel().getEdgeTable().getColumn(result.getFoundColumnIndex());
            }
            value = attributes.getValue(result.getFoundColumnIndex());
            str = value != null ? value.toString() : "";
            StringBuffer sb = new StringBuffer();
View Full Code Here

        model = graph.getGraphModel();
        sourceView = graph.getView();
        currentView = model.copyView(sourceView);

        AttributeController ac = Lookup.getDefault().lookup(AttributeController.class);
        attributeModel = ac.getModel(graph.getGraphModel().getWorkspace());

        this.low = low;
        this.high = high;

        if (low != Double.NEGATIVE_INFINITY || high != Double.POSITIVE_INFINITY) {
View Full Code Here

        }
    }

    public void selectTable(AttributeTable table) {
        if (listener != null) {
            AttributeController ac = Lookup.getDefault().lookup(AttributeController.class);
            if (ac.getModel().getNodeTable() == table) {
                selectNodesTable();
            } else {
                selectEdgesTable();
            }
        }
View Full Code Here

    private void loadColumns() {
        availableColumnsModel.clear();
        columnsToMergeModel.clear();

        AttributeController ac = Lookup.getDefault().lookup(AttributeController.class);
        AttributeColumn[] columns;
        if (mode == Mode.NODES_TABLE) {
            table = ac.getModel().getNodeTable();
            columns = table.getColumns();
        } else {
            table = ac.getModel().getEdgeTable();
            columns = table.getColumns();
        }

        for (int i = 0; i < columns.length; i++) {
            availableColumnsModel.addElement(new ColumnWrapper(columns[i]));
View Full Code Here

TOP

Related Classes of org.gephi.data.attributes.api.AttributeController

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.