Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dinamically change vertex's label. #19

Closed
LazyAfternoons opened this issue Aug 19, 2020 · 3 comments
Closed

Dinamically change vertex's label. #19

LazyAfternoons opened this issue Aug 19, 2020 · 3 comments

Comments

@LazyAfternoons
Copy link

LazyAfternoons commented Aug 19, 2020

Hello and thank you for your hard work on this library. This is more of a question than an issue. I was wondering if I could change a vertex's label in my custom Strategy class or even outside it.
I was looking at the javadoc and eventually I found out that I can load my custom CSS class by using the setStyleClass method on a SmartLabel object. This SmartLabel is attached to a SmartGraphVertextNode in the addVertex method in SmartGraphPanel.
I can't find a way to get this SmartLabel and load the CSS class into it.
Any help is deeply appreciated, thank you.

@brunomnsilva
Copy link
Owner

This was already answered in previous issues.

The labels are automatically pulled from the contained element's toString() method. If you update the state of the element's instance and call GraphPanel.update() it will reload the labels.

@brunomnsilva
Copy link
Owner

This is now possible. Believe I misunderstood your issue from the beginning.

@LazyAfternoons
Copy link
Author

Sorry for the late answer and thank you again for your work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants