RFR: 7124282: [macosx] Can't see table cell highlighter when the highlight border is the same color as the cell. [v7]

Harshitha Onkar duke at openjdk.java.net
Wed Mar 30 20:42:27 UTC 2022


> 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 lighter focus ring color by changing saturation and setting brightness component to 100% of original focus ring color so that it is visible while tabbing through `JTable` cells. A new method is added for this purpose which takes in `focusRingColor`, does adjustment to saturation and brightness 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.
> 
> **Edge Cases**
> **Selection Background**     -----       **Returned Focus Ring Color**
> - White/ Black/Gray                        ----->          Light Gray
> 
> The following HSB chart was used [Chart Link](https://codepen.io/HunorMarton/details/eWvewo), to determine the best saturation offsets used in deriveContrastFocusRing method.
> 
> 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 white cell background changes are not incorporated. Only the Focus Ring/ Cell Highlighter is made more prominent.

Harshitha Onkar has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains seven additional commits since the last revision:

 - Merge branch 'openjdk:master' into focusRing_7124282
 - on-the-fly focus ring color changes added
 - updated deriveContrastFocusRing method
 - changed javadocs for the new method and expanded imports
 - formatting changes to test case
 - formatted line lengths, added method-level comments
 - Cell Focus Ring Changes for Aqua LAF

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/7768/files
  - new: https://git.openjdk.java.net/jdk/pull/7768/files/f6c9b6c0..ec872c82

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7768&range=06
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7768&range=05-06

  Stats: 129377 lines in 1823 files changed: 95559 ins; 28740 del; 5078 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



More information about the client-libs-dev mailing list