[#1742] Highlight text white if in selection

This commit is contained in:
SiboVG 2022-10-15 15:11:07 +02:00
parent be8ecc36bb
commit 7fe5d75d3d

View File

@ -6,6 +6,7 @@ import java.awt.Font;
import java.util.Enumeration;
import java.util.List;
import java.util.Map;
import java.util.stream.IntStream;
import javax.swing.JTree;
import javax.swing.ToolTipManager;
@ -175,7 +176,12 @@ public class SimulationModifierTree extends BasicTree {
if (selectedModifiers.contains(object)) {
setForeground(Color.GRAY);
} else {
setForeground(Color.BLACK);
if (tree.getSelectionRows() != null &&
IntStream.of(tree.getSelectionRows()).anyMatch(r -> r == row)) {
setForeground(Color.WHITE);
} else {
setForeground(Color.BLACK);
}
}
setFont(modifierFont);
setText(((SimulationModifier) object).getName());