简体   繁体   English

如何突出显示树节点

[英]How to highlight tree nodes

I am displaying two trees using Rich faces 3.3.2 and JSF 1.2 and now I have a requirement to compare two trees and highlight their difference. 我正在使用Rich face 3.3.2和JSF 1.2显示两棵树,现在我需要比较两棵树并突出显示它们的区别。

Example: Consider two trees one on the left and other on the right... 示例:考虑两棵树,一棵在左边,另一棵在右边...
Suppose I have a node under left tree but it is not there on the right tree then i have to highlight the node and also its child node present in the left tree. 假设我在左树下有一个节点,但是在右树上没有该节点,那么我必须突出显示该节点及其在左树中的子节点。

while building the trees i would create in the same moment for each tree a hashmap where you can add the node while adding them to the tree. 在构建树时,我将在同一时间为每棵树创建一个哈希图,您可以在其中添加节点,同时将它们添加到树中。 in the end you only have to compare the difference from the two maps and highlight the node positions. 最后,您只需要比较两个地图的差异并突出显示节点位置即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM