Ah, so you don’t want to highlight a node, but the area covered by the cells which the node occupies. In a table you would say that you want to highlight the row. I suppose you will eventually also want to be able to highlight columns too, which could be implemented in a similar fashion.
Since you already have a “BANDS” singleton template that is used to draw the border around the whole table, the horizontal separator lines, and the vertical separator lines, I suggest that you add a Shape to that “BANDS” template whose purpose is to draw the desired rectangular highlight areas, one per row, presumably with a zero Shape.strokeWidth.
Just as the BorderedTreeLayout.commitLayers method specifies the Geometry of the “HORIZONTALS” Shape in order to draw horizontal lines, you could augment that method to look for the new Shape that you have added to the “BANDS” template. Let’s name it “ROWS”. Just as with the “HORIZONTALS” Shape, you would iterate over the vertexes. For each one that had a LayoutVertex.node and whose node was Part.isSelected, you would add a PathFigure specifying points defining a rectangle with the position and size that you want.
Hi Walter,
Thanks for the response.
Yes your understanding is correct but I dont need column selection only row selection is good enough.
If its not a big task for you can you please modify my code given in the link? I spent time and I tried the way you suggested but I could not figure out how to make it work.
The above does as Walter describes, adding a “ROWS” Shape to the “BANDS” template, and updating its Geometry by looping through the selected Nodes during commitLayers. The node templates now use a selectionChanged function to ensure the “ROWS” shape gets updated.