scala-force-layout icon indicating copy to clipboard operation
scala-force-layout copied to clipboard

Label style customization via NodePainter

Open rsimon opened this issue 11 years ago • 2 comments

The label style is currently hard-wired. It should really be included in the NodePainter. (Thx to @nhelke)

rsimon avatar Sep 23 '13 07:09 rsimon

I was in the process of implementing such a change as well as a general refactoring of the painting functions (including in and out edge painters and selection painter) in order to enable them to also be overridden. Cf. nhelke@2b42ea96f57795aa2d4138dabdf3c7a4f4f6e052

I was then in the process of moving the label drawing code to the node painter when I happened upon an issue that will require more consideration. Currently the labels for adjacent nodes are painted in the in and out edge painting functions. Moving them into the node painting function would require quite a few additional optional fields on Node2D indicating not only whether the node is selected but whether it is an adjacent node on an entering or exiting edge, so that one could potentially change the styling of labels depending on the role of the node in the selection. This strikes me as a sign that a large restructuring might be in order.

I must think more about it. So far the changes I have made do not break the API. Maybe the way to go is to introduce a new completely customisable rendering infrastructure. This may also be an opportunity to enable the customisation of action listeners as well as enabling action listeners on individual nodes.

I would greatly appreciate your input, to make sure I am not veering completely off course.

nhelke avatar Sep 23 '13 14:09 nhelke

Hm. Yes I see your point. Really not sure how to approach it, though (but definitely open to suggestions!) Action listeners on individual nodes would be excellent as well of course!

rsimon avatar Sep 24 '13 10:09 rsimon