Exemplo n.º 1
0
  /** @see org.graphstream.stream.Sink */
  public void stepBegins(String sourceId, long timeId, double step) {
    gg.stepBegins(sourceId, timeId, step);

    switch (outputPolicy) {
      case ByEventOutput:
      case ByStepOutput:
        outputNewImage();
        break;
    }
  }
Exemplo n.º 2
0
  /** @see org.graphstream.stream.Sink */
  public void edgeRemoved(String sourceId, long timeId, String edgeId) {
    gg.edgeRemoved(sourceId, timeId, edgeId);

    switch (outputPolicy) {
      case ByEventOutput:
      case ByEdgeEventOutput:
      case ByEdgeAddedRemovedOutput:
      case ByElementEventOutput:
        outputNewImage();
        break;
    }
  }
Exemplo n.º 3
0
  /** @see org.graphstream.stream.Sink */
  public void nodeAttributeRemoved(String sourceId, long timeId, String nodeId, String attribute) {
    gg.nodeAttributeRemoved(sourceId, timeId, nodeId, attribute);

    switch (outputPolicy) {
      case ByEventOutput:
      case ByNodeEventOutput:
      case ByNodeAttributeOutput:
      case ByAttributeEventOutput:
        outputNewImage();
        break;
    }
  }
Exemplo n.º 4
0
  /** @see org.graphstream.stream.Sink */
  public void stepBegins(String sourceId, long timeId, double step) {
    sink.stepBegins(sourceId, timeId, step);

    switch (outputPolicy) {
      case BY_EVENT:
      case BY_STEP:
        if (hasBegan) outputNewImage();
        break;
      default:
        break;
    }
  }
Exemplo n.º 5
0
  /** @see org.graphstream.stream.Sink */
  public void graphAttributeAdded(String sourceId, long timeId, String attribute, Object value) {
    gg.graphAttributeAdded(sourceId, timeId, attribute, value);

    switch (outputPolicy) {
      case ByEventOutput:
      case ByGraphEventOutput:
      case ByGraphAttributeOutput:
      case ByAttributeEventOutput:
        outputNewImage();
        break;
    }
  }
Exemplo n.º 6
0
  /** @see org.graphstream.stream.Sink */
  public void nodeRemoved(String sourceId, long timeId, String nodeId) {
    gg.nodeRemoved(sourceId, timeId, nodeId);

    switch (outputPolicy) {
      case ByEventOutput:
      case ByNodeEventOutput:
      case ByNodeAddedRemovedOutput:
      case ByElementEventOutput:
        outputNewImage();
        break;
    }
  }
Exemplo n.º 7
0
  /** @see org.graphstream.stream.Sink */
  public void graphCleared(String sourceId, long timeId) {
    gg.graphCleared(sourceId, timeId);

    switch (outputPolicy) {
      case ByEventOutput:
      case ByGraphEventOutput:
      case ByNodeAddedRemovedOutput:
      case ByEdgeAddedRemovedOutput:
      case ByElementEventOutput:
        outputNewImage();
        break;
    }
  }
Exemplo n.º 8
0
  /** @see org.graphstream.stream.Sink */
  public void nodeRemoved(String sourceId, long timeId, String nodeId) {
    sink.nodeRemoved(sourceId, timeId, nodeId);

    switch (outputPolicy) {
      case BY_EVENT:
      case BY_NODE_EVENT:
      case BY_NODE_ADDED_REMOVED:
      case BY_ELEMENT_EVENT:
        if (hasBegan) outputNewImage();
        break;
      default:
        break;
    }
  }
Exemplo n.º 9
0
  /** @see org.graphstream.stream.Sink */
  public void nodeAttributeRemoved(String sourceId, long timeId, String nodeId, String attribute) {
    sink.nodeAttributeRemoved(sourceId, timeId, nodeId, attribute);

    switch (outputPolicy) {
      case BY_EVENT:
      case BY_NODE_EVENT:
      case BY_NODE_ATTRIBUTE:
      case BY_ATTRIBUTE_EVENT:
        if (hasBegan) outputNewImage();
        break;
      default:
        break;
    }
  }
Exemplo n.º 10
0
  /** @see org.graphstream.stream.Sink */
  public void graphAttributeAdded(String sourceId, long timeId, String attribute, Object value) {
    sink.graphAttributeAdded(sourceId, timeId, attribute, value);

    switch (outputPolicy) {
      case BY_EVENT:
      case BY_GRAPH_EVENT:
      case BY_GRAPH_ATTRIBUTE:
      case BY_ATTRIBUTE_EVENT:
        if (hasBegan) outputNewImage();
        break;
      default:
        break;
    }
  }
Exemplo n.º 11
0
  /*
   * (non-Javadoc)
   *
   * @see
   * org.graphstream.stream.file.FileSink#writeAll(org.graphstream.graph.Graph
   * , java.lang.String)
   */
  public synchronized void writeAll(Graph g, String filename) throws IOException {
    clearGG();

    GraphReplay replay =
        new GraphReplay(String.format("file_sink_image-write_all-replay-%x", System.nanoTime()));

    replay.addSink(gg);
    replay.replay(g);
    replay.removeSink(gg);

    outputNewImage(filename);

    clearGG();
  }
Exemplo n.º 12
0
  /** @see org.graphstream.stream.Sink */
  public void graphCleared(String sourceId, long timeId) {
    sink.graphCleared(sourceId, timeId);

    switch (outputPolicy) {
      case BY_EVENT:
      case BY_GRAPH_EVENT:
      case BY_NODE_ADDED_REMOVED:
      case BY_EDGE_ADDED_REMOVED:
      case BY_ELEMENT_EVENT:
        if (hasBegan) outputNewImage();
        break;
      default:
        break;
    }
  }
Exemplo n.º 13
0
  /** @see org.graphstream.stream.Sink */
  public void nodeAttributeChanged(
      String sourceId,
      long timeId,
      String nodeId,
      String attribute,
      Object oldValue,
      Object newValue) {
    gg.nodeAttributeChanged(sourceId, timeId, nodeId, attribute, oldValue, newValue);

    switch (outputPolicy) {
      case ByEventOutput:
      case ByNodeEventOutput:
      case ByNodeAttributeOutput:
      case ByAttributeEventOutput:
        outputNewImage();
        break;
    }
  }
Exemplo n.º 14
0
  /** @see org.graphstream.stream.Sink */
  public void edgeAdded(
      String sourceId,
      long timeId,
      String edgeId,
      String fromNodeId,
      String toNodeId,
      boolean directed) {
    gg.edgeAdded(sourceId, timeId, edgeId, fromNodeId, toNodeId, directed);

    switch (outputPolicy) {
      case ByEventOutput:
      case ByEdgeEventOutput:
      case ByEdgeAddedRemovedOutput:
      case ByElementEventOutput:
        outputNewImage();
        break;
    }
  }
Exemplo n.º 15
0
  /** @see org.graphstream.stream.Sink */
  public void edgeAdded(
      String sourceId,
      long timeId,
      String edgeId,
      String fromNodeId,
      String toNodeId,
      boolean directed) {
    sink.edgeAdded(sourceId, timeId, edgeId, fromNodeId, toNodeId, directed);

    switch (outputPolicy) {
      case BY_EVENT:
      case BY_EDGE_EVENT:
      case BY_EDGE_ADDED_REMOVED:
      case BY_ELEMENT_EVENT:
        if (hasBegan) outputNewImage();
        break;
      default:
        break;
    }
  }
Exemplo n.º 16
0
  /** @see org.graphstream.stream.Sink */
  public void edgeAttributeChanged(
      String sourceId,
      long timeId,
      String edgeId,
      String attribute,
      Object oldValue,
      Object newValue) {
    sink.edgeAttributeChanged(sourceId, timeId, edgeId, attribute, oldValue, newValue);

    switch (outputPolicy) {
      case BY_EVENT:
      case BY_EDGE_EVENT:
      case BY_EDGE_ATTRIBUTE:
      case BY_ATTRIBUTE_EVENT:
        if (hasBegan) outputNewImage();
        break;
      default:
        break;
    }
  }
Exemplo n.º 17
0
 /** Produce a new image. */
 public void outputNewImage() {
   outputNewImage(String.format("%s%06d.%s", filePrefix, counter++, outputType.ext));
 }