Kfir Ettinger
Kfir Ettinger

Reputation: 632

graphStream image fill

I'm trying to fill Graphstream's Node with an image and for some reason it dosen't work.

this is my demo code:

import org.graphstream.graph.*;
import org.graphstream.graph.implementations.*;

public class test {
    public static void main(String args[]) {
        Graph graph = new SingleGraph("Tutorial 1");

        Node A = graph.addNode("A");
        Node B = graph.addNode("B");
        Node C = graph.addNode("C");

        graph.addEdge("AB", "A", "B");
        graph.addEdge("BC", "B", "C");
        graph.addEdge("CA", "C", "A");

        String car = "data/assets/carIcon.png";
        String drone = "https://cdn.dribbble.com/users/1084144/screenshots/3026469/ddd.jpg";

        B.setAttribute("ui.style", "size: 50px; fill-mode: image-scaled; fill-image: url('"+car+"');");
        
        graph.display();
    }
}

I tried to load both a local (car) and remote (drone) image and both faild.

Any ideas what am I missing?

Upvotes: 2

Views: 163

Answers (0)

Related Questions