Package org.gephi.data.attributes.api

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


    @Test
    public void testValues() {
        int i = 0;

        AttributeRow row = rows.get(0);
        assertEquals("col1value 0", row.getValue(columnMap.get("col1")));
        assertEquals(0, row.getValue(columnMap.get("col2")));
        assertNull(row.getValue(columnMap.get("col3")));
        assertEquals("col4value 0", row.getValue(columnMap.get("col4")));
        assertEquals(false, row.getValue(columnMap.get("col5")));
        assertEquals(columnMap.get("col6").getDefaultValue(), row.getValue(columnMap.get("col6")));

        showValues(row);
    }
View Full Code Here


        //Test GetColumn
        assertSame(co7, nodeClass.getColumn("col7"));

        //Test value
        AttributeRow row = rows.get(0);
        assertEquals(columnMap.get("col7").getDefaultValue(), row.getValue(columnMap.get("col7")));
        row.setValue(co7, "test");
        assertEquals("test", row.getValue(columnMap.get("col7")));

        showValues(row);
    }
View Full Code Here

        //Test GetColumn
        assertNull(nodeClass.getColumn("col4"));

        //Test value
        AttributeRow row = rows.get(0);
        assertNull(row.getValue(columnMap.get("col4")));

        showValues(row);
    }
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

                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 MultipleNodesAttributeValueWrapper(nodes, value.getColumn());
                } else {
                    wrap = new SingleNodeAttributeValueWrapper(row, value.getColumn());
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 MultipleEdgesAttributeValueWrapper(edges, value.getColumn());
                } else {
                    wrap = new SingleEdgeAttributeValueWrapper(row, value.getColumn());
View Full Code Here

                }
                color[indicies.get(u)] = 2;
                seenCount++;
            }
            for (Node s : component) {
                AttributeRow row = (AttributeRow) s.getNodeData().getAttributes();
                row.setValue(componentCol, componentCount);
            }
            sizeList.add(component.size());
            componentCount++;
        }
        hgraph.readUnlock();
View Full Code Here

        }
        if (low_index[id] == index[id]) {
            Node v = null;
            while (v != f) {
                v = S.removeFirst();
                AttributeRow row = (AttributeRow) v.getNodeData().getAttributes();
                row.setValue(col, stronglyCount);
            }
            stronglyCount++;
        }
    }
View Full Code Here

        }

        avgDist /= shortestPaths;//mN * (mN - 1.0f);

        for (Node s : hgraph.getNodes()) {
            AttributeRow row = (AttributeRow) s.getNodeData().getAttributes();
            int s_index = indicies.get(s);

            if (!isDirected) {
                betweenness[s_index] /= 2;
            }
            if (isNormalized) {
                closeness[s_index] = (closeness[s_index] == 0) ? 0 : 1.0 / closeness[s_index];
                betweenness[s_index] /= isDirected ? (N - 1) * (N - 2) : (N - 1) * (N - 2) / 2;
            }
            row.setValue(eccentricityCol, eccentricity[s_index]);
            row.setValue(closenessCol, closeness[s_index]);
            row.setValue(betweenessCol, betweenness[s_index]);
        }
        hgraph.readUnlock();
    }
View Full Code Here

        flushToNodeAttributes(nodeDraft, node);
    }

    protected void flushToNodeAttributes(NodeDraftGetter nodeDraft, Node node) {
        if (node.getNodeData().getAttributes() != null) {
            AttributeRow row = (AttributeRow) node.getNodeData().getAttributes();
            for (AttributeValue val : nodeDraft.getAttributeRow().getValues()) {
                if (!val.getColumn().getOrigin().equals(AttributeOrigin.PROPERTY) && val.getValue() != null) {
                    row.setValue(val.getColumn(), val.getValue());
                }
            }
        }
    }
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.