Package org.gephi.graph.api

Examples of org.gephi.graph.api.Attributes


        dest.getTextData().setColor(source.getTextData().getR(), source.getTextData().getG(), source.getTextData().getB(), source.getTextData().getAlpha());
        dest.getTextData().setSize(source.getTextData().getSize());
        dest.getTextData().setVisible(source.getTextData().isVisible());

        //Attributes
        Attributes sourceAttributes = source.getAttributes();
        for (int i = 0; i < sourceAttributes.countValues(); i++) {
            dest.getAttributes().setValue(i, sourceAttributes.getValue(i));
        }
    }
View Full Code Here


        dest.getTextData().setColor(source.getTextData().getR(), source.getTextData().getG(), source.getTextData().getB(), source.getTextData().getAlpha());
        dest.getTextData().setSize(source.getTextData().getSize());
        dest.getTextData().setVisible(source.getTextData().isVisible());

        //Attributes
        Attributes sourceAttributes = source.getAttributes();
        for (int i = 0; i < sourceAttributes.countValues(); i++) {
            dest.getAttributes().setValue(i, sourceAttributes.getValue(i));
        }
    }
View Full Code Here

            }
        }

        int oldColumnIndex = column.getIndex();

        Attributes rows[] = getTableAttributeRows(table);

        Object[] oldValues = new Object[rows.length];
        for (int i = 0; i < rows.length; i++) {
            oldValues[i] = rows[i].getValue(oldColumnIndex);
        }
View Full Code Here

            }
        }
    }

    public void copyNodeDataToOtherNodes(Node node, Node[] otherNodes, AttributeColumn[] columnsToCopy) {
        Attributes row = node.getNodeData().getAttributes();
        Attributes[] otherRows = new Attributes[otherNodes.length];
        for (int i = 0; i < otherNodes.length; i++) {
            otherRows[i] = otherNodes[i].getNodeData().getAttributes();
        }
View Full Code Here

        copyRowDataToOtherRows(row, otherRows, columnsToCopy);
    }

    public void copyEdgeDataToOtherEdges(Edge edge, Edge[] otherEdges, AttributeColumn[] columnsToCopy) {
        Attributes row = edge.getEdgeData().getAttributes();
        Attributes[] otherRows = new Attributes[otherEdges.length];
        for (int i = 0; i < otherEdges.length; i++) {
            otherRows[i] = otherEdges[i].getEdgeData().getAttributes();
        }
View Full Code Here

            //Create nodes:
            GraphElementsController gec = Lookup.getDefault().lookup(GraphElementsController.class);
            Graph graph = Lookup.getDefault().lookup(GraphController.class).getModel().getGraph();
            String id = null;
            Node node;
            Attributes nodeAttributes;
            reader = new CsvReader(new FileInputStream(file), separator, charset);
            reader.setTrimWhitespace(false);
            reader.readHeaders();
            while (reader.readRecord()) {
                //Prepare the correct node to assign the attributes:
View Full Code Here

            Edge edge;
            String sourceId, targetId;
            Node source, target;
            String type;
            boolean directed;
            Attributes edgeAttributes;
            reader = new CsvReader(new FileInputStream(file), separator, charset);
            reader.setTrimWhitespace(false);
            reader.readHeaders();
            while (reader.readRecord()) {
                sourceId = reader.get(sourceColumn);
View Full Code Here

                    switch (event.getEventType()) {
                        case REMOVE_NODES_AND_EDGES:
                            if (!edgeDynamicColumns.isEmpty() && event.getData().removedEdges() != null) {
                                AttributeColumn[] dynamicCols = edgeDynamicColumns.toArray(new AttributeColumn[0]);
                                for (Edge e : event.getData().removedEdges()) {
                                    Attributes attributeRow = e.getEdgeData().getAttributes();
                                    for (int i = 0; i < dynamicCols.length; i++) {
                                        DynamicType<?> ti = (DynamicType) attributeRow.getValue(dynamicCols[i].getIndex());
                                        if (ti != null) {
                                            for (Interval interval : ti.getIntervals(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY)) {
                                                timeIntervalIndex.remove(interval);
                                            }
                                        }
                                    }
                                }
                            }
                            if (!nodeDynamicColumns.isEmpty() && event.getData().removedNodes() != null) {
                                AttributeColumn[] dynamicCols = nodeDynamicColumns.toArray(new AttributeColumn[0]);
                                for (Node n : event.getData().removedNodes()) {
                                    Attributes attributeRow = n.getNodeData().getAttributes();
                                    for (int i = 0; i < dynamicCols.length; i++) {
                                        DynamicType<?> ti = (DynamicType) attributeRow.getValue(dynamicCols[i].getIndex());
                                        if (ti != null) {
                                            for (Interval interval : ti.getIntervals(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY)) {
                                                timeIntervalIndex.remove(interval);
                                            }
                                        }
View Full Code Here

    }

    private void indexNodeColumnsValues(AttributeColumn[] dynamicCols) {
        Graph graph = graphModel.getGraph();
        for (Node n : graph.getNodes()) {
            Attributes attributeRow = n.getNodeData().getAttributes();
            for (int i = 0; i < dynamicCols.length; i++) {
                DynamicType<?> ti = (DynamicType) attributeRow.getValue(dynamicCols[i].getIndex());
                if (ti != null) {
                    for (Interval interval : ti.getIntervals(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY)) {
                        timeIntervalIndex.add(interval);
                    }
                }
View Full Code Here

    }

    private void indexEdgeColumnsValues(AttributeColumn[] dynamicCols) {
        Graph graph = graphModel.getGraph();
        for (Edge e : graph.getEdges()) {
            Attributes attributeRow = e.getEdgeData().getAttributes();
            for (int i = 0; i < dynamicCols.length; i++) {
                DynamicType<?> ti = (DynamicType) attributeRow.getValue(dynamicCols[i].getIndex());
                if (ti != null) {
                    for (Interval interval : ti.getIntervals(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY)) {
                        timeIntervalIndex.add(interval);
                    }
                }
View Full Code Here

TOP

Related Classes of org.gephi.graph.api.Attributes

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.