Package org.gephi.datalab.api

Examples of org.gephi.datalab.api.AttributeColumnsController


        columnsToClearData = columnsToClearDataList.toArray(new AttributeColumn[0]);
    }

    public void execute() {
        if (columnsToClearData.length >= 0) {
            AttributeColumnsController ac = Lookup.getDefault().lookup(AttributeColumnsController.class);
            ac.clearEdgesData(edges, columnsToClearData);
            Lookup.getDefault().lookup(DataTablesController.class).refreshCurrentTable();
        }
    }
View Full Code Here


    public void setup(AttributeColumnsManipulator m, AttributeTable table, AttributeColumn column, DialogControls dialogControls) {
        this.manipulator=(CopyDataToOtherColumn) m;

        sourceColumnLabel.setText(NbBundle.getMessage(CopyDataToOtherColumnUI.class, "CopyDataToOtherColumnUI.sourceColumnLabel.text",column.getTitle()));

        AttributeColumnsController ac=Lookup.getDefault().lookup(AttributeColumnsController.class);

        ArrayList<AttributeColumn> availableColumns=new ArrayList<AttributeColumn>();

        for(AttributeColumn c:table.getColumns()){
            if(ac.canChangeColumnData(c)&&c!=column){
                availableColumns.add(c);
                columnsComboBox.addItem(c.getTitle());
            }
        }
View Full Code Here

    private Node[] nodes;
    private AttributeColumn[] columnsToClearData;

    public void setup(Node[] nodes, Node clickedNode) {
        this.nodes = nodes;
        AttributeColumnsController ac = Lookup.getDefault().lookup(AttributeColumnsController.class);
        ArrayList<AttributeColumn> columnsToClearDataList = new ArrayList<AttributeColumn>();
        for (AttributeColumn column : Lookup.getDefault().lookup(AttributeController.class).getModel().getNodeTable().getColumns()) {
            if (ac.canClearColumnData(column)) {
                columnsToClearDataList.add(column);
            }
        }
        columnsToClearData = columnsToClearDataList.toArray(new AttributeColumn[0]);
    }
View Full Code Here

        columnsToClearData = columnsToClearDataList.toArray(new AttributeColumn[0]);
    }

    public void execute() {
        if (columnsToClearData.length >= 0) {
            AttributeColumnsController ac = Lookup.getDefault().lookup(AttributeColumnsController.class);
            ac.clearNodesData(nodes, columnsToClearData);
            Lookup.getDefault().lookup(DataTablesController.class).refreshCurrentTable();
        }
    }
View Full Code Here

            //Nodes import parameters:
            Boolean assignNewNodeIds = (Boolean) wizardDescriptor.getProperty("assign-new-node-ids");
            //Edges import parameters:
            Boolean createNewNodes = (Boolean) wizardDescriptor.getProperty("create-new-nodes");

            AttributeColumnsController ac = Lookup.getDefault().lookup(AttributeColumnsController.class);
            switch ((Mode) wizardDescriptor.getProperty("mode")) {
                case NODES_TABLE:
                    ac.importCSVToNodesTable(file, separator, charset, columnNames, columnTypes, assignNewNodeIds);
                    break;
                case EDGES_TABLE:
                    ac.importCSVToEdgesTable(file, separator, charset, columnNames, columnTypes, createNewNodes);
                    break;
            }
            Lookup.getDefault().lookup(DataTablesController.class).refreshCurrentTable();
        }
        step1.unSetup();
View Full Code Here

        try {
            DynamicModel dm=Lookup.getDefault().lookup(DynamicController.class).getModel();
            if(dm!=null){
                currentTimeFormat=dm.getTimeFormat();
            }
            AttributeColumnsController ac = Lookup.getDefault().lookup(AttributeColumnsController.class);
            Sheet.Set set = new Sheet.Set();
            set.setName("attributes");
            if (nodes.length > 1) {
                set.setDisplayName(NbBundle.getMessage(EditNodes.class, "EditNodes.attributes.text.multiple"));
            } else {
                set.setDisplayName(NbBundle.getMessage(EditNodes.class, "EditNodes.attributes.text", nodes[0].getNodeData().getLabel()));
            }

            AttributeRow row = (AttributeRow) nodes[0].getNodeData().getAttributes();
            AttributeValueWrapper wrap;
            for (AttributeValue value : row.getValues()) {

                if (multipleNodes) {
                    wrap = new MultipleRowsAttributeValueWrapper(nodes, value.getColumn(),currentTimeFormat);
                } else {
                    wrap = new SingleRowAttributeValueWrapper(nodes[0], value.getColumn(),currentTimeFormat);
                }
                AttributeType type = value.getColumn().getType();
                Property p;
                if (ac.canChangeColumnData(value.getColumn())) {
                    //Editable column, provide "set" method:
                    if (!EditWindowUtils.NotSupportedTypes.contains(type)) {//The AttributeType can be edited by default:
                        p = new PropertySupport.Reflection(wrap, type.getType(), "getValue" + type.getType().getSimpleName(), "setValue" + type.getType().getSimpleName());
                    } else {//Use the AttributeType as String:
                        p = new PropertySupport.Reflection(wrap, String.class, "getValueAsString", "setValueAsString");
View Full Code Here

        try {
            DynamicModel dm=Lookup.getDefault().lookup(DynamicController.class).getModel();
            if(dm!=null){
                currentTimeFormat=dm.getTimeFormat();
            }
            AttributeColumnsController ac = Lookup.getDefault().lookup(AttributeColumnsController.class);
            Sheet.Set set = new Sheet.Set();
            set.setName("attributes");
            if (edges.length > 1) {
                set.setDisplayName(NbBundle.getMessage(EditEdges.class, "EditEdges.attributes.text.multiple"));
            } else {
                set.setDisplayName(NbBundle.getMessage(EditEdges.class, "EditEdges.attributes.text", edges[0].getEdgeData().getLabel()));
            }

            AttributeRow row = (AttributeRow) edges[0].getEdgeData().getAttributes();
            AttributeValueWrapper wrap;
            for (AttributeValue value : row.getValues()) {

                if (multipleEdges) {
                    wrap = new MultipleRowsAttributeValueWrapper(edges, value.getColumn(),currentTimeFormat);
                } else {
                    wrap = new SingleRowAttributeValueWrapper(edges[0], value.getColumn(),currentTimeFormat);
                }
                AttributeType type = value.getColumn().getType();
                Property p;
                if (ac.canChangeColumnData(value.getColumn())) {
                    //Editable column, provide "set" method:
                    if (!EditWindowUtils.NotSupportedTypes.contains(type)) {//The AttributeType can be edited by default:
                        p = new PropertySupport.Reflection(wrap, type.getType(), "getValue" + type.getType().getSimpleName(), "setValue" + type.getType().getSimpleName());
                    } else {//Use the AttributeType as String:
                        p = new PropertySupport.Reflection(wrap, String.class, "getValueAsString", "setValueAsString");
View Full Code Here

TOP

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

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.