Package org.graphstream.util.cumulative

Examples of org.graphstream.util.cumulative.CumulativeSpells


        Object label = attr.getAny("label");

        if (label != null)
          stream.writeAttribute("label", label.toString());

        CumulativeSpells spells = graphSpells.getNodeSpells(nodeId);

        if (!spells.isEternal()) {
          startElement(stream, "spells");
          for (int i = 0; i < spells.getSpellCount(); i++) {
            Spell s = spells.getSpell(i);

            startElement(stream, "spell");
            putSpellAttributes(s);
            endElement(stream, true);
          }
          endElement(stream, false);
        }

        if (attr.getAttributesCount() > 0) {
          startElement(stream, "attvalues");
          nodeAttributes.push(stream, nodeId, graphSpells);
          endElement(stream, false);
        }

        endElement(stream,
            spells.isEternal() && attr.getAttributesCount() == 0);
      }
      endElement(stream, false);

      startElement(stream, "edges");
      for (String edgeId : graphSpells.getEdges()) {
        startElement(stream, "edge");

        GraphSpells.EdgeData data = graphSpells.getEdgeData(edgeId);

        stream.writeAttribute("id", edgeId);
        stream.writeAttribute("source", data.getSource());
        stream.writeAttribute("target", data.getTarget());

        CumulativeAttributes attr = graphSpells
            .getEdgeAttributes(edgeId);

        CumulativeSpells spells = graphSpells.getEdgeSpells(edgeId);

        if (!spells.isEternal()) {
          startElement(stream, "spells");
          for (int i = 0; i < spells.getSpellCount(); i++) {
            Spell s = spells.getSpell(i);

            startElement(stream, "spell");
            putSpellAttributes(s);
            endElement(stream, true);
          }
          endElement(stream, false);
        }

        if (attr.getAttributesCount() > 0) {
          startElement(stream, "attvalues");
          edgeAttributes.push(stream, edgeId, graphSpells);
          endElement(stream, false);
        }

        endElement(stream,
            spells.isEternal() && attr.getAttributesCount() == 0);
      }
      endElement(stream, false);

      endElement(stream, false);
    } catch (XMLStreamException e1) {
View Full Code Here

TOP

Related Classes of org.graphstream.util.cumulative.CumulativeSpells

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.