> Previously while tabbing through the JTable cell, the cell highlighter/focus > ring was not visible against the selection background. > > Changes are made to Aqua LAF to derive a brighter focus ring color by > changing hue, saturation and brightness of selection background color so that > it is visible while tabbing through `JTable` cells. A new method is added for > this purpose which takes in `selectionBackground` color, does the hue, > saturation and brightness manipulation and returns a new focus ring color. > There are edge cases where the HSB transformation does not yield the right > focus ring color, for these cases a default color is returned that is > different and can be seen against the `selectionBackground`. > > **Edge Cases** > **Selection Background** ----- **Returned Focus Ring Color** > - White/ Black -----> Gray > > - Shade of Gray > towards white (r=g=b >= 128) -----> Black > > - Shade of Gray > towards Black (r=g=b < 128) ------> White > > A test case is added to compare the RGB difference between the original focus > ring color & selection background and the brighter focus ring color & > selection background. > > PS: The native L&F (Mac OS) and Swing L&F for JTable cell tabbing differs (on > native tables the cell background turns white on focus with a cell focus > ring). Since the background for Swing tables can be set by users and also > overridden by subclassing `DefaultTableCellRenderer`, and to adhere to > current implementation of Swing, the cell background changes are not > incorporated. Only the Focus Ring/ Cell Highlighter is made more prominent > against the selection background.
Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: changed javadocs for the new method and expanded imports ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/7768/files - new: https://git.openjdk.java.net/jdk/pull/7768/files/d715aa7d..d32560ce Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7768&range=03 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7768&range=02-03 Stats: 20 lines in 2 files changed: 6 ins; 2 del; 12 mod Patch: https://git.openjdk.java.net/jdk/pull/7768.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7768/head:pull/7768 PR: https://git.openjdk.java.net/jdk/pull/7768