Package org.graphstream.graph

Examples of org.graphstream.graph.ElementNotFoundException


    if (edge == null) {
      GraphicNode n1 = (GraphicNode) styleGroups.getNode(from);
      GraphicNode n2 = (GraphicNode) styleGroups.getNode(to);

      if (n1 == null)
        throw new ElementNotFoundException("node \"%s\"", from);

      if (n2 == null)
        throw new ElementNotFoundException("node \"%s\"", to);

      edge = new GraphicEdge(id, n1, n2, directed, null);// , attributes);

      styleGroups.addElement(edge);
View Full Code Here


      default:
        e = null;
      }

      if (e == null)
        throw new ElementNotFoundException();

      return e;
    }
View Full Code Here

  public <T extends Node> T removeNode(String id) {
    AbstractNode node = getNode(id);

    if (node == null) {
      if (strictChecking)
        throw new ElementNotFoundException("Node \"" + id
            + "\" not found. Cannot remove it.");
      return null;
    }

    return removeNode(node);
View Full Code Here

  public <T extends Node> T removeNode(int index) {
    Node node = getNode(index);

    if (node == null) {
      if (strictChecking)
        throw new ElementNotFoundException("Node #" + index
            + " not found. Cannot remove it.");
      return null;
    }

    return removeNode(node);
View Full Code Here

  public <T extends Edge> T removeEdge(String id) {
    Edge edge = getEdge(id);

    if (edge == null) {
      if (strictChecking)
        throw new ElementNotFoundException("Edge \"" + id
            + "\" not found. Cannot remove it.");
      return null;
    }

    return removeEdge(edge);
View Full Code Here

  public <T extends Edge> T removeEdge(int index) {
    Edge edge = getEdge(index);

    if (edge == null) {
      if (strictChecking)
        throw new ElementNotFoundException("Edge #" + index
            + " not found. Cannot remove it.");
      return null;
    }

    return removeEdge(edge);
View Full Code Here

    Node fromNode = getNode(from);
    Node toNode = getNode(to);

    if (fromNode == null || toNode == null) {
      if (strictChecking)
        throw new ElementNotFoundException(
            "Cannot remove the edge. The node \"%s\" does not exist",
            fromNode == null ? from : to);
      return null;
    }
View Full Code Here

    Node fromNode = getNode(fromIndex);
    Node toNode = getNode(toIndex);

    if (fromNode == null || toNode == null) {
      if (strictChecking)
        throw new ElementNotFoundException(
            "Cannot remove the edge. The node #%d does not exist",
            fromNode == null ? fromIndex : toIndex);
      return null;
    }
View Full Code Here

  public <T extends Edge> T removeEdge(Node node1, Node node2) {
    AbstractEdge edge = node1.getEdgeToward(node2);

    if (edge == null) {
      if (strictChecking)
        throw new ElementNotFoundException(
            "There is no edge from \"%s\" to \"%s\". Cannot remove it.",
            node1.getId(), node2.getId());
      return null;
    }
View Full Code Here

      return null;
    }

    if (src == null || dst == null) {
      if (strictChecking)
        throw new ElementNotFoundException(
            String.format(
                "Cannot create edge %s[%s-%s%s]. Node '%s' does not exist.",
                edgeId, srcId, directed ? ">" : "-", dstId,
                src == null ? srcId : dstId));
      if (!autoCreate)
View Full Code Here

TOP

Related Classes of org.graphstream.graph.ElementNotFoundException

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.