Package org.gephi.data.attributes.api

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


        GraphElementsController gec = Lookup.getDefault().lookup(GraphElementsController.class);
        SearchResult result = null;
        Set<Integer> columnsToSearch = searchOptions.getColumnsToSearch();
        boolean searchAllColumns = columnsToSearch.isEmpty();
        Node[] nodes = searchOptions.getNodesToSearch();
        AttributeRow row;
        Object value;
        for (; rowIndex < nodes.length; rowIndex++) {
            if (!gec.isNodeInGraph(nodes[rowIndex])) {
                continue;//Make sure node is still in graph when continuing a search
            }
            row = (AttributeRow) nodes[rowIndex].getNodeData().getAttributes();
            for (; columnIndex < row.countValues(); columnIndex++) {
                if (searchAllColumns || columnsToSearch.contains(columnIndex)) {
                    value = row.getValue(columnIndex);
                    result = matchRegex(value, searchOptions, rowIndex, columnIndex);
                    if (result != null) {
                        result.setFoundNode(nodes[rowIndex]);
                        return result;
                    }
View Full Code Here


        GraphElementsController gec = Lookup.getDefault().lookup(GraphElementsController.class);
        SearchResult result = null;
        Set<Integer> columnsToSearch = searchOptions.getColumnsToSearch();
        boolean searchAllColumns = columnsToSearch.isEmpty();
        Edge[] edges = searchOptions.getEdgesToSearch();
        AttributeRow row;
        Object value;
        for (; rowIndex < edges.length; rowIndex++) {
            if (!gec.isEdgeInGraph(edges[rowIndex])) {
                continue;//Make sure edge is still in graph when continuing a search
            }
            row = (AttributeRow) edges[rowIndex].getEdgeData().getAttributes();
            for (; columnIndex < row.countValues(); columnIndex++) {
                if (searchAllColumns || columnsToSearch.contains(columnIndex)) {
                    value = row.getValue(columnIndex);
                    result = matchRegex(value, searchOptions, rowIndex, columnIndex);
                    if (result != null) {
                        result.setFoundEdge(edges[rowIndex]);
                        return result;
                    }
View Full Code Here

                    }
                }

                if (newEdge != null) {//Edge may not be created if repeated
                    //Copy edge attributes:
                    AttributeRow row = (AttributeRow) edge.getAttributes();
                    for (int i = 0; i < row.countValues(); i++) {
                        if (row.getAttributeValueAt(i).getColumn().getIndex() != PropertiesColumn.EDGE_ID.getIndex()) {
                            newEdge.getAttributes().setValue(i, row.getValue(i));
                        }
                    }
                }
            }
        }
View Full Code Here

        copyData.setSize(nodeData.getSize());
        copyData.setColor(nodeData.r(), nodeData.g(), nodeData.b());
        copyData.setAlpha(nodeData.alpha());

        //Copy attributes:
        AttributeRow row = (AttributeRow) nodeData.getAttributes();
        for (int i = 0; i < row.countValues(); i++) {
            if (row.getAttributeValueAt(i).getColumn().getIndex() != PropertiesColumn.NODE_ID.getIndex()) {
                copyData.getAttributes().setValue(i, row.getValue(i));
            }
        }

        if (parent != null) {
            hg.addNode(copy, parent);
View Full Code Here

                    contextMenu.add(PopupMenuUtils.createMenuItemFromNodesManipulator(nm, clickedNode, selectedNodes));
                }
            }

            //Add AttributeValues manipulators submenu:
            AttributeRow row = (AttributeRow) clickedNode.getNodeData().getAttributes();
            int realColumnIndex = outlineTable.convertColumnIndexToModel(outlineTable.columnAtPoint(p)) - FAKE_COLUMNS_COUNT;//Get real attribute column index not counting fake columns.
            if (realColumnIndex >= 0) {
                AttributeColumn column = showingColumns[realColumnIndex];
                if (column != null) {
                    contextMenu.add(PopupMenuUtils.createSubMenuFromRowColumn(row, column));
View Full Code Here

                    contextMenu.add(PopupMenuUtils.createMenuItemFromEdgesManipulator(em, clickedEdge, selectedEdges));
                }
            }

            //Add AttributeValues manipulators submenu:
            AttributeRow row = (AttributeRow) clickedEdge.getEdgeData().getAttributes();
            int realColumnIndex = table.convertColumnIndexToModel(table.columnAtPoint(p)) - FAKE_COLUMNS_COUNT;//Get real attribute column index not counting fake columns.
            if (realColumnIndex >= 0) {
                AttributeColumn column = showingColumns[realColumnIndex];
                if (column != null) {
                    contextMenu.add(PopupMenuUtils.createSubMenuFromRowColumn(row, column));
View Full Code Here

                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);
View Full Code Here

                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);
View Full Code Here

TOP

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

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.