Package org.graphstream.graph

Examples of org.graphstream.graph.Node


    @SuppressWarnings("unchecked")
    public <T extends Node> T addNode(String id)
        throws IdAlreadyInUseException {
      T n;
      Node sn;

      elementLock.lock();

      n = wrappedElement.addNode(id);
      sn = new SynchronizedNode(this, n);
View Full Code Here


      return n;
    }

    public <T extends Node> T getNode(int index)
        throws IndexOutOfBoundsException {
      Node n;

      elementLock.lock();
      n = wrappedElement.getNode(index);
      elementLock.unlock();

      return n == null ? null : this.<T> getNode(n.getId());
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    public <T extends Node> T removeNode(String id)
        throws ElementNotFoundException {
      T n;
      Node sn;

      elementLock.lock();
      n = wrappedElement.removeNode(id);
      sn = synchronizedNodes.remove(n.getId());
      elementLock.unlock();
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    public <T extends Node> T removeNode(int index) {
      T n;
      Node sn;

      elementLock.lock();
      n = wrappedElement.removeNode(index);
      sn = synchronizedNodes.remove(n.getId());
      elementLock.unlock();
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    public <T extends Node> T removeNode(Node node) {
      T n;
      Node sn;

      if (node instanceof SynchronizedNode)
        node = ((SynchronizedNode) node).wrappedElement;

      elementLock.lock();
View Full Code Here

      }

    // Replay all nodes and their attributes.

    for (Node node : graph) {
      Node n = this.graph.addNode(node.getId());

      if (node.getAttributeKeySet() != null) {
        for (String key : node.getAttributeKeySet()) {
          n.addAttribute(key, node.getAttribute(key));
        }
      }
    }

    // Replay all edges and their attributes.
View Full Code Here

   * @return A newly allocated array of three floats containing the (x,y,z)
   *         position of the node, or null if the node is not part of the
   *         graph.
   */
  public static double[] nodePosition(Graph graph, String id) {
    Node node = graph.getNode(id);

    if (node != null)
      return nodePosition(node);

    return null;
View Full Code Here

   * @return A newly allocated point containing the (x,y,z)
   *         position of the node, or null if the node is not part of the
   *         graph.
   */
  public static Point3 nodePointPosition(Graph graph, String id) {
    Node node = graph.getNode(id);

    if (node != null)
      return nodePointPosition(node);

    return null;
View Full Code Here

   *            An array of at least three cells.
   * @throws RuntimeException
   *             If the node with the given identifier does not exist.
   */
  public static void nodePosition(Graph graph, String id, double xyz[]) {
    Node node = graph.getNode(id);

    if (node != null)
      nodePosition(node, xyz);

    throw new RuntimeException("node '" + id + "' does not exist");
View Full Code Here

   *            A point that will receive the node position.
   * @throws RuntimeException
   *             If the node with the given identifier does not exist.
   */
  public static void nodePosition(Graph graph, String id, Point3 pos) {
    Node node = graph.getNode(id);

    if (node != null)
      nodePosition(node, pos);

    throw new RuntimeException("node '" + id + "' does not exist");
View Full Code Here

TOP

Related Classes of org.graphstream.graph.Node

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.