Package org.graphstream.graph

Examples of org.graphstream.graph.Graph.addAttribute()


    g.addSink(nsc);
    // - generate some events on the client side
    String style = "node{fill-mode:plain;fill-color:#567;size:6px;}";
    g.addAttribute("stylesheet", style);
    g.addAttribute("ui.antialias", true);
    g.addAttribute("layout.stabilization-limit", 0);
    for (int i = 0; i < 500; i++) {
      g.addNode(i + "");
      if (i > 0) {
        g.addEdge(i + "-" + (i - 1), i + "", (i - 1) + "");
        g.addEdge(i + "--" + (i / 2), i + "", (i / 2) + "");
View Full Code Here


    System.out.printf("> \"%s\"\n", entry.ressourceName);
   
    Graph graph = new MultiGraph("foo");
    FileSourcePajek in = new FileSourcePajek();

    graph.addAttribute("ui.quality");
    if (!entry.veryLarge)
      graph.addAttribute("ui.antialias");
    if (entry.addLabels)
      graph.addAttribute(
          "ui.stylesheet",
View Full Code Here

    Graph graph = new MultiGraph("foo");
    FileSourcePajek in = new FileSourcePajek();

    graph.addAttribute("ui.quality");
    if (!entry.veryLarge)
      graph.addAttribute("ui.antialias");
    if (entry.addLabels)
      graph.addAttribute(
          "ui.stylesheet",
          String.format(
              "node { text-alignment: center; size: %dpx; fill-color: grey; %s } edge { fill-color: #333; }",
View Full Code Here

    graph.addAttribute("ui.quality");
    if (!entry.veryLarge)
      graph.addAttribute("ui.antialias");
    if (entry.addLabels)
      graph.addAttribute(
          "ui.stylesheet",
          String.format(
              "node { text-alignment: center; size: %dpx; fill-color: grey; %s } edge { fill-color: #333; }",
              entry.veryLarge ? 6 : 16, entry.veryLarge ? ""
                  : "stroke-mode: plain; stroke-color: #333;"));
View Full Code Here

          String.format(
              "node { text-alignment: center; size: %dpx; fill-color: grey; %s } edge { fill-color: #333; }",
              entry.veryLarge ? 6 : 16, entry.veryLarge ? ""
                  : "stroke-mode: plain; stroke-color: #333;"));
    else
      graph.addAttribute(
          "ui.stylesheet",
          String.format(
              "node { text-alignment: at-right; size: %dpx; fill-color: grey; %s text-background-mode: plain; text-offset: 2px, 0px; text-padding: 2px; text-background-color: #FFFFFFAA; } edge { fill-color: #333; }",
              entry.veryLarge ? 6 : 16, entry.veryLarge ? ""
                  : "stroke-mode: plain; stroke-color: #333;"));
View Full Code Here

  public void testSmallFile() {
    try {
      Graph graph = new MultiGraph("foo");
      FileSourceGML source = new FileSourceGML();

      graph.addAttribute("ui.quality");
      graph.addAttribute("ui.antialias");
      //graph.addAttribute("ui.stylesheet", "node { text-size:8; text-color: #0008; text-alignment: at-right; } edge { text-size:8; text-color: #0008; }");
      graph.display();
      source.addSink(graph);
      source.begin(TestSourceGML.class.getResourceAsStream("SmallTest.gml"));
View Full Code Here

    try {
      Graph graph = new MultiGraph("foo");
      FileSourceGML source = new FileSourceGML();

      graph.addAttribute("ui.quality");
      graph.addAttribute("ui.antialias");
      //graph.addAttribute("ui.stylesheet", "node { text-size:8; text-color: #0008; text-alignment: at-right; } edge { text-size:8; text-color: #0008; }");
      graph.display();
      source.addSink(graph);
      source.begin(TestSourceGML.class.getResourceAsStream("SmallTest.gml"));
      while(source.nextEvents()) {}
View Full Code Here

 
  @Test(expected=NullAttributeException.class)
  public void testElementValueAttributeNull4() {
    Graph graph = new MultiGraph("g");
    graph.setNullAttributesAreErrors(true);
    graph.addAttribute("foo","ah ah ah");
    graph.getNumber("foo");
  }
 
  @Test(expected=NullAttributeException.class)
  public void testElementValueAttributeNull5() {
View Full Code Here

        // - plug the graph to the sender so that graph events can be
        // sent automatically
        g.addSink(nsc);
        // - generate some events on the client side
        String style = "node{fill-mode:plain;fill-color:#567;size:6px;}";
        g.addAttribute("stylesheet", style);
        g.addAttribute("ui.antialias", true);
        g.addAttribute("layout.stabilization-limit", 0);
        for (int i = 0; i < 5000; i++) {
          g.addNode(i + "");
          if (i > 0) {
View Full Code Here

 
  @Test(expected=NullAttributeException.class)
  public void testElementValueAttributeNull6() {
    Graph graph = new MultiGraph("g");
    graph.setNullAttributesAreErrors(true);
    graph.addAttribute("foo",5);
    graph.getLabel("foo");
  }

  @Test
  public void testElementMultiAttributes() {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.