Package edu.uci.ics.jung.graph.decorators

Examples of edu.uci.ics.jung.graph.decorators.StringLabeller


public class ExperimentGraphMLHandler extends GraphMLFileHandler {

  protected Edge createEdge(Map attributeMap) {
    Graph mGraph = getGraph();
    StringLabeller mLabeller = getLabeller();
        if (mGraph == null) {
            throw new FatalException("Error parsing graph. Graph element must be specified before edge element.");
        }

        String sourceId = (String) attributeMap.remove("source");
        Vertex sourceVertex =
                mLabeller.getVertex(sourceId);

        String targetId = (String) attributeMap.remove("target");
        Vertex targetVertex =
                 mLabeller.getVertex(targetId);

        String direction = (String) attributeMap.remove("directed");
        boolean directed = Boolean.parseBoolean(direction);
        Edge e;
        if(!(sourceVertex.getSuccessors().contains(targetVertex))){
View Full Code Here


        return e;
    }
 
  protected ArchetypeVertex createVertex(Map attributeMap) {
    Graph mGraph = getGraph();
    StringLabeller mLabeller = getLabeller();
        if (mGraph == null) {
            throw new FatalException("Error parsing graph. Graph element must be specified before node element.");
        }

        String idString = (String) attributeMap.remove("id");
        DeterministicDirectedSparseGraph.DeterministicVertex vertex =
          new DeterministicDirectedSparseGraph.DeterministicVertex(new VertexID(idString));// this ID will be subsequently modified when we look at the "VERTEX" tag.
        mGraph.addVertex(vertex);

        try {
            mLabeller.setLabel((Vertex) vertex,idString);
        } catch (StringLabeller.UniqueLabelException ule) {
            throw new FatalException("Ids must be unique");

        }
View Full Code Here

  }
 
  @Override
  protected Edge createEdge(Map attributeMap) {
    Graph mGraph = getGraph();
    StringLabeller mLabeller = getLabeller();
        if (mGraph == null) {
            throw new FatalException("Error parsing graph. Graph element must be specified before edge element.");
        }

        String sourceId = (String) attributeMap.remove("source");
        Vertex sourceVertex =
                mLabeller.getVertex(sourceId);

        String targetId = (String) attributeMap.remove("target");
        Vertex targetVertex =
                 mLabeller.getVertex(targetId);

        //String direction = (String) attributeMap.remove("directed");
        //boolean directed = Boolean.parseBoolean(direction);
        boolean directed = true;
        Edge e;
View Full Code Here

    }
 
  @Override
  protected ArchetypeVertex createVertex(Map attributeMap) {
    Graph mGraph = getGraph();
    StringLabeller mLabeller = getLabeller();
        if (mGraph == null) {
            throw new FatalException("Error parsing graph. Graph element must be specified before node element.");
        }

        String idString = ((String) attributeMap.remove("id")).replaceAll(AbstractPersistence.Initial+" *", "");
        DeterministicDirectedSparseGraph.DeterministicVertex vertex =
          new DeterministicDirectedSparseGraph.DeterministicVertex(VertexID.parseID(idString));// this ID will be subsequently modified when we look at the "VERTEX" tag.
        mGraph.addVertex(vertex);

        try {
            mLabeller.setLabel(vertex,idString);
        } catch (StringLabeller.UniqueLabelException ule) {
            throw new FatalException("Ids must be unique");

        }

View Full Code Here

public class ExperimentGraphMLHandler extends GraphMLFileHandler {

  @Override
  protected Edge createEdge(Map attributeMap) {
    Graph mGraph = getGraph();
    StringLabeller mLabeller = getLabeller();
        if (mGraph == null) {
            throw new FatalException("Error parsing graph. Graph element must be specified before edge element.");
        }

        String sourceId = (String) attributeMap.remove("source");
        Vertex sourceVertex =
                mLabeller.getVertex(sourceId);

        String targetId = (String) attributeMap.remove("target");
        Vertex targetVertex =
                 mLabeller.getVertex(targetId);

        String direction = (String) attributeMap.remove("directed");
        boolean directed = Boolean.parseBoolean(direction);
        Edge e;
        if(!(sourceVertex.getSuccessors().contains(targetVertex))){
View Full Code Here

    }
 
  @Override
  protected ArchetypeVertex createVertex(Map attributeMap) {
    Graph mGraph = getGraph();
    StringLabeller mLabeller = getLabeller();
        if (mGraph == null) {
            throw new FatalException("Error parsing graph. Graph element must be specified before node element.");
        }

        String idString = ((String) attributeMap.remove("id")).replaceAll(AbstractPersistence.Initial+" *", "");
        DeterministicDirectedSparseGraph.DeterministicVertex vertex =
          new DeterministicDirectedSparseGraph.DeterministicVertex(VertexID.parseID(idString));// this ID will be subsequently modified when we look at the "VERTEX" tag.
        mGraph.addVertex(vertex);

        try {
            mLabeller.setLabel(vertex,idString);
        } catch (StringLabeller.UniqueLabelException ule) {
            throw new FatalException("Ids must be unique");

        }

View Full Code Here

public class ExperimentGraphMLHandler extends GraphMLFileHandler {

  @Override
  protected Edge createEdge(Map attributeMap) {
    Graph mGraph = getGraph();
    StringLabeller mLabeller = getLabeller();
        if (mGraph == null) {
            throw new FatalException("Error parsing graph. Graph element must be specified before edge element.");
        }

        String sourceId = (String) attributeMap.remove("source");
        Vertex sourceVertex =
                mLabeller.getVertex(sourceId);

        String targetId = (String) attributeMap.remove("target");
        Vertex targetVertex =
                 mLabeller.getVertex(targetId);

        String direction = (String) attributeMap.remove("directed");
        boolean directed = true;
        Edge e;
        if(!(sourceVertex.getSuccessors().contains(targetVertex))){
View Full Code Here

    }
 
  @Override
  protected ArchetypeVertex createVertex(Map attributeMap) {
    Graph mGraph = getGraph();
    StringLabeller mLabeller = getLabeller();
        if (mGraph == null) {
            throw new FatalException("Error parsing graph. Graph element must be specified before node element.");
        }

        ArchetypeVertex vertex = mGraph.addVertex(new DeterministicDirectedSparseGraph.DeterministicVertex());
        String idString = ((String) attributeMap.remove("id")).replaceAll(Transform322.Initial+" *", "");
       
        try {
            mLabeller.setLabel((Vertex) vertex,idString);
        } catch (StringLabeller.UniqueLabelException ule) {
            throw new FatalException("Ids must be unique");

        }

View Full Code Here

public class ExperimentGraphMLHandler extends GraphMLFileHandler {

  @Override
  protected Edge createEdge(Map attributeMap) {
    Graph mGraph = getGraph();
    StringLabeller mLabeller = getLabeller();
        if (mGraph == null) {
            throw new FatalException("Error parsing graph. Graph element must be specified before edge element.");
        }

        String sourceId = (String) attributeMap.remove("source");
        Vertex sourceVertex =
                mLabeller.getVertex(sourceId);

        String targetId = (String) attributeMap.remove("target");
        Vertex targetVertex =
                 mLabeller.getVertex(targetId);

        //String direction = (String) attributeMap.remove("directed");
        //boolean directed = Boolean.parseBoolean(direction);
        boolean directed = true;
        Edge e;
View Full Code Here

    }
 
  @Override
  protected ArchetypeVertex createVertex(Map attributeMap) {
    Graph mGraph = getGraph();
    StringLabeller mLabeller = getLabeller();
        if (mGraph == null) {
            throw new FatalException("Error parsing graph. Graph element must be specified before node element.");
        }

        String idString = ((String) attributeMap.remove("id")).replaceAll(AbstractPersistence.Initial+" *", "");
        DeterministicDirectedSparseGraph.DeterministicVertex vertex =
          new DeterministicDirectedSparseGraph.DeterministicVertex(VertexID.parseID(idString));// this ID will be subsequently modified when we look at the "VERTEX" tag.
        mGraph.addVertex(vertex);

        try {
            mLabeller.setLabel(vertex,idString);
        } catch (StringLabeller.UniqueLabelException ule) {
            throw new FatalException("Ids must be unique");

        }

View Full Code Here

TOP

Related Classes of edu.uci.ics.jung.graph.decorators.StringLabeller

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.