-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Conversation
…n that the passed colors are for highlightInner and shadowOuter props
👋 Welcome back psadhukhan! A progress list of the required criteria for merging this PR into |
Webrevs
|
Is there a normative definition somewhere in the spec of what "derived color" is for this domain? |
As per https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/border/BevelBorder.java#L151 |
any comments on the spec wording? |
Does 'derived' in javax.swing domain mean the color would be different, or 'equal color' also qualifies as 'derived' javax.swing? |
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 |
Please update the title of the bug/PR, since the change now in another class. |
/csr |
@mrserb this pull request will not be integrated until the CSR request JDK-8264706 for issue JDK-8264398 has been approved. |
BevelBorder vs BevelBorderUIResource. The BevelBorderUIResource is a UIResource version of BevelBorder and its spec is just a copy. |
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. |
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.
Yes, this constructor is called from the BevelBorderUIResource, and it will be strange if the subclass will have a better spec than the parent. |
@@ -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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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'.
Please have a look at the CSR too https://bugs.openjdk.java.net/browse/JDK-8264706 |
@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:
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
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 |
/integrate |
@prsadhuk Since your change was applied there have been 740 commits pushed to the
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. |
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
Issue
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