JavaFXSmartGraph icon indicating copy to clipboard operation
JavaFXSmartGraph copied to clipboard

Set icon to Vertex

Open k1ll1n opened this issue 1 year ago • 1 comments

Hello! Can I set an icon to the Vertex?

I tried using "-fx-background-image: url("./town.png)"

But it was not successful.

What are some options to achieve my goal?

k1ll1n avatar Feb 09 '24 14:02 k1ll1n

The same question. Thanks for reply

SashaVolushkova avatar Feb 19 '24 18:02 SashaVolushkova

New shapes added to version 2.0.0-rc1! 😄

Regarding images, maybe they can be set to the background of the shapes. I'll have to look into it!

brunomnsilva avatar Mar 19 '24 17:03 brunomnsilva

Version 2.0.0-rc2 exemplifies using images as a shape's background. Seems to work 😄

See ExampleMain.java:

graphView.getStylableVertex(tokyo).setStyleInline("-fx-fill: url(\"file:squares.jpg\");");

This can also be set in the smartgraph.css file.

Note that the image will be scaled down to the size of the vertex.

brunomnsilva avatar Apr 03 '24 16:04 brunomnsilva