Skip to content

8264398: BevelBorderUIResource​(int, Color, Color) and BevelBoder(int, Color, Color) spec should clarify about usage of highlight and shadow color #3305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from

Conversation

prsadhuk
Copy link
Contributor

@prsadhuk prsadhuk commented Apr 1, 2021

The current spec for javax/swing/plaf/BorderUIResource.BevelBorderUIResource.html(int,java.awt.Color,java.awt.Color) does not clearly specify the usage of color for hightlight and shadow as there are outer/inner hightlight and outer/inner shadow.
Updated spec to clarify the same.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8264398: BevelBorderUIResource​(int, Color, Color) and BevelBoder(int, Color, Color) spec should clarify about usage of highlight and shadow color

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3305/head:pull/3305
$ git checkout pull/3305

Update a local copy of the PR:
$ git checkout pull/3305
$ git pull https://git.openjdk.java.net/jdk pull/3305/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3305

View PR using the GUI difftool:
$ git pr show -t 3305

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3305.diff

…n that the passed colors are for highlightInner and shadowOuter props
@bridgekeeper
Copy link

bridgekeeper bot commented Apr 1, 2021

👋 Welcome back psadhukhan! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Apr 1, 2021
@openjdk
Copy link

openjdk bot commented Apr 1, 2021

@prsadhuk The following label will be automatically applied to this pull request:

  • swing

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the swing client-libs-dev@openjdk.org label Apr 1, 2021
@mlbridge
Copy link

mlbridge bot commented Apr 1, 2021

Webrevs

@dbessono
Copy link

dbessono commented Apr 5, 2021

Is there a normative definition somewhere in the spec of what "derived color" is for this domain?

@prsadhuk
Copy link
Contributor Author

prsadhuk commented Apr 5, 2021

As per https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/border/BevelBorder.java#L151
and https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/border/BevelBorder.java#L183
derived is used to obtain the darker or brighter version of the same color, which is being done here for this highlight and shadow color too.

@prsadhuk
Copy link
Contributor Author

prsadhuk commented Apr 6, 2021

any comments on the spec wording?

@dbessono
Copy link

dbessono commented Apr 6, 2021

Does 'derived' in javax.swing domain mean the color would be different, or 'equal color' also qualifies as 'derived' javax.swing?

@prsadhuk
Copy link
Contributor Author

prsadhuk commented Apr 6, 2021

In this context and BevelBorder context, 'derived' is used for brighter/darker version of the same color and as per Color.brighter method https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/java/awt/Color.java#L636
it can return the same color on case-to-case basis.

@mrserb
Copy link
Member

mrserb commented Apr 8, 2021

Please update the title of the bug/PR, since the change now in another class.

@mrserb
Copy link
Member

mrserb commented Apr 8, 2021

/csr

@openjdk openjdk bot added the csr Pull request needs approved CSR before integration label Apr 8, 2021
@openjdk
Copy link

openjdk bot commented Apr 8, 2021

@mrserb this pull request will not be integrated until the CSR request JDK-8264706 for issue JDK-8264398 has been approved.

@mrserb
Copy link
Member

mrserb commented Apr 8, 2021

BevelBorder vs BevelBorderUIResource. The BevelBorderUIResource is a UIResource version of BevelBorder and its spec is just a copy.

@prsadhuk
Copy link
Contributor Author

prsadhuk commented Apr 8, 2021

Not sure I understand...The change is still in BevelorderUIResource(int, Color, Color) method so what should be changed in PR title?

@mrserb
Copy link
Member

mrserb commented Apr 8, 2021

Not sure I understand...The change is still in BevelorderUIResource(int, Color, Color) method so what should be changed in PR title?

It should be Bevelorder as well, the class from where the spec is copied to the BevelorderUIResource.

@prsadhuk
Copy link
Contributor Author

prsadhuk commented Apr 8, 2021

I don't think the spec is coped from BevelBorder...Yes, the spec is inspired by how BevelBorder treates the shadow/highlight color!!
You want same spec to be copied to BevelBorder(int, Color, Color) constrcutor too?

@mrserb
Copy link
Member

mrserb commented Apr 8, 2021

I don't think the spec is coped from BevelBorder...Yes, the spec is inspired by how BevelBorder treates the shadow/highlight color!

The BevelBorderUIResource is just a tagged wrapper on top of the BevelBorder, it does not provide any additional functionality.

You want same spec to be copied to BevelBorder(int, Color, Color) constrcutor too?

Yes, this constructor is called from the BevelBorderUIResource, and it will be strange if the subclass will have a better spec than the parent.

@prsadhuk prsadhuk changed the title 8264398: BevelBorderUIResource​(int, Color, Color) spec should mention that the passed colors are for highlightInner and shadowOuter props 8264398: BevelBorderUIResource​(int, Color, Color) and BevelBoder(int, Color, Color) spec should clarify about usage of highlight and shadow color Apr 8, 2021
@@ -86,6 +86,10 @@ public BevelBorder(int bevelType) {
/**
* Creates a bevel border with the specified type, highlight and
* shadow colors.
* highlightOuterColor and highlightInnerColor will be derived from
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should use just a brief text for "highlightOuterColor"/etc like in the other parts of class "the outer shadow"/"the inner shadow"/"the inner highlight" etc. Since in this particular case the highlightOuterColor is not a parameter nor a field.
And please update the copyright dates.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I have done what is being asked. Are there any other comments? If not, can this PR and CSR be approved please?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So as per the updated version of the specification - what could be checked is that the resulting inner/outer/highlight/shadow colors should be either:

  • equal to the passed
  • ::brighter() than the passed
  • darker() than the passed
    ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the passed highlight and shadow color to the constructor would be equal to getHighlightInnerColor(), getShadowOuterColor but again this is for our jdk implementation. As told in the JBS, these are implementation details which should hold true if JDK's BevelBorder class is in use
but some other JDK can override the class and can give its own implementation as the class is not 'final'.

@prsadhuk
Copy link
Contributor Author

Please have a look at the CSR too https://bugs.openjdk.java.net/browse/JDK-8264706

@openjdk openjdk bot removed the csr Pull request needs approved CSR before integration label Apr 15, 2021
@openjdk
Copy link

openjdk bot commented Apr 15, 2021

@prsadhuk This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8264398: BevelBorderUIResource​(int, Color, Color) and BevelBoder(int, Color, Color) spec should clarify about usage of highlight and shadow color

Reviewed-by: serb

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 382 new commits pushed to the master branch:

  • e7cbeba: 8259070: Add jcmd option to dump CDS
  • 5931948: 8265246: Fix macos-Aarch64 build after JDK-8263709
  • 79bff21: 8263709: Cleanup THREAD/TRAPS/CHECK usage in JRT_ENTRY routines
  • f4c3efd: 8265192: [macos_aarch64] configure script fails if GNU uname in PATH
  • e167577: 8265078: jpackage tests on Windows leave large temp files
  • 05f851e: 8265236: ProblemList java/foreign/TestUpcall.java on macosx-aarch64
  • d1b28e7: 8265231: (fc) ReadDirect and WriteDirect tests fail after fix for JDK-8264821
  • 57f86a0: 8265235: ProblemList java/foreign/TestIntrinsics.java on macosx-aarch64
  • 4c83d24: 8058176: [mlvm] tests should not allow code cache exhaustion
  • 9406744: 8264976: Minor numeric bug in AbstractSplittableWithBrineGenerator.makeSplitsSpliterator
  • ... and 372 more: https://git.openjdk.java.net/jdk/compare/d24e4cfef36026b781906a9e0c5cf519eb72696e...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 15, 2021
@prsadhuk
Copy link
Contributor Author

prsadhuk commented May 5, 2021

/integrate

@openjdk openjdk bot closed this May 5, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels May 5, 2021
@openjdk
Copy link

openjdk bot commented May 5, 2021

@prsadhuk Since your change was applied there have been 740 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

Pushed as commit b71f85a.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@prsadhuk prsadhuk deleted the 8264398 branch May 5, 2021 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated swing client-libs-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

3 participants