Package org.gephi.data.attributes

Examples of org.gephi.data.attributes.AttributeRowImpl


        writer.writeStartElement(ELEMENT_ROWS);

        HierarchicalGraph hierarchicalGraph = graphModel.getHierarchicalGraph();
        for (Node node : hierarchicalGraph.getNodesTree()) {
            if (node.getNodeData().getAttributes() != null && node.getNodeData().getAttributes() instanceof AttributeRowImpl) {
                AttributeRowImpl row = (AttributeRowImpl) node.getNodeData().getAttributes();
                writer.writeStartElement(ELEMENT_NODE_ROW);
                writer.writeAttribute("for", String.valueOf(node.getId()));
                if (writeRow(writer, row)) {
                    writer.writeEndElement();
                }
            }
        }

        for (Node node : hierarchicalGraph.getNodesTree()) {
            for (Edge edge : hierarchicalGraph.getEdges(node)) {
                if (edge.getEdgeData().getAttributes() != null && edge.getEdgeData().getAttributes() instanceof AttributeRowImpl) {
                    AttributeRowImpl row = (AttributeRowImpl) edge.getEdgeData().getAttributes();
                    writer.writeStartElement(ELEMENT_EDGE_ROW);
                    writer.writeAttribute("for", String.valueOf(edge.getId()));
                    if (writeRow(writer, row)) {
                        writer.writeEndElement();
                    }
View Full Code Here


                    String name = reader.getLocalName();
                    if (ELEMENT_NODE_ROW.equalsIgnoreCase(name)) {
                        int id = Integer.parseInt(reader.getAttributeValue(null, "for"));
                        Node node = hierarchicalGraph.getNode(id);
                        if (node.getNodeData().getAttributes() != null && node.getNodeData().getAttributes() instanceof AttributeRowImpl) {
                            AttributeRowImpl row = (AttributeRowImpl) node.getNodeData().getAttributes();
                            readRow(reader, attributeModel, attributeModel.getNodeTable(), row);
                        }
                    } else if (ELEMENT_EDGE_ROW.equalsIgnoreCase(name)) {
                        int id = Integer.parseInt(reader.getAttributeValue(null, "for"));
                        Edge edge = hierarchicalGraph.getEdge(id);
                        if (edge.getEdgeData().getAttributes() != null && edge.getEdgeData().getAttributes() instanceof AttributeRowImpl) {
                            AttributeRowImpl row = (AttributeRowImpl) edge.getEdgeData().getAttributes();
                            readRow(reader, attributeModel, attributeModel.getEdgeTable(), row);
                        }
                    }
                    break;
                case XMLStreamReader.END_ELEMENT:
View Full Code Here

        writer.writeStartElement(ELEMENT_ROWS);

        HierarchicalGraph hierarchicalGraph = graphModel.getHierarchicalGraph();
        for (Node node : hierarchicalGraph.getNodesTree()) {
            if (node.getNodeData().getAttributes() != null && node.getNodeData().getAttributes() instanceof AttributeRowImpl) {
                AttributeRowImpl row = (AttributeRowImpl) node.getNodeData().getAttributes();
                writer.writeStartElement(ELEMENT_NODE_ROW);
                writer.writeAttribute("for", String.valueOf(node.getId()));
                if (writeRow(writer, row)) {
                    writer.writeEndElement();
                }
            }
        }

        for (Edge edge : hierarchicalGraph.getEdges()) {
            if (edge.getEdgeData().getAttributes() != null && edge.getEdgeData().getAttributes() instanceof AttributeRowImpl) {
                AttributeRowImpl row = (AttributeRowImpl) edge.getEdgeData().getAttributes();
                writer.writeStartElement(ELEMENT_EDGE_ROW);
                writer.writeAttribute("for", String.valueOf(edge.getId()));
                if (writeRow(writer, row)) {
                    writer.writeEndElement();
                }
View Full Code Here

                    String name = reader.getLocalName();
                    if (ELEMENT_NODE_ROW.equalsIgnoreCase(name)) {
                        int id = Integer.parseInt(reader.getAttributeValue(null, "for"));
                        Node node = hierarchicalGraph.getNode(id);
                        if (node.getNodeData().getAttributes() != null && node.getNodeData().getAttributes() instanceof AttributeRowImpl) {
                            AttributeRowImpl row = (AttributeRowImpl) node.getNodeData().getAttributes();
                            readRow(reader, attributeModel, attributeModel.getNodeTable(), row);
                        }
                    } else if (ELEMENT_EDGE_ROW.equalsIgnoreCase(name)) {
                        int id = Integer.parseInt(reader.getAttributeValue(null, "for"));
                        Edge edge = hierarchicalGraph.getEdge(id);
                        if (edge.getEdgeData().getAttributes() != null && edge.getEdgeData().getAttributes() instanceof AttributeRowImpl) {
                            AttributeRowImpl row = (AttributeRowImpl) edge.getEdgeData().getAttributes();
                            readRow(reader, attributeModel, attributeModel.getEdgeTable(), row);
                        }
                    }
                    break;
                case XMLStreamReader.END_ELEMENT:
View Full Code Here

TOP

Related Classes of org.gephi.data.attributes.AttributeRowImpl

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.