<Swing Dev> RFR: 8264398: BevelBorderUIResource​(int, Color, Color) spec should mention that the passed colors are for highlightInner and shadowOuter props

classic Classic list List threaded Threaded
21 messages Options
12
Reply | Threaded
Open this post in threaded view
|

<Swing Dev> RFR: 8264398: BevelBorderUIResource​(int, Color, Color) spec should mention that the passed colors are for highlightInner and shadowOuter props

Prasanta Sadhukhan-2
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.

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

Commit messages:
 - 8264398: BevelBorderUIResource​(int, Color, Color) spec should mention that the passed colors are for highlightInner and shadowOuter props

Changes: https://git.openjdk.java.net/jdk/pull/3305/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3305&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8264398
  Stats: 4 lines in 1 file changed: 4 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3305.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3305/head:pull/3305

PR: https://git.openjdk.java.net/jdk/pull/3305
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: 8264398: BevelBorderUIResource​(int, Color, Color) spec should mention that the passed colors are for highlightInner and shadowOuter props [v2]

Prasanta Sadhukhan-2
> 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.

Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:

  Fix javadoc

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/3305/files
  - new: https://git.openjdk.java.net/jdk/pull/3305/files/ea847758..cb0b25c3

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3305&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3305&range=00-01

  Stats: 4 lines in 1 file changed: 0 ins; 0 del; 4 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3305.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3305/head:pull/3305

PR: https://git.openjdk.java.net/jdk/pull/3305
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: 8264398: BevelBorderUIResource​(int, Color, Color) spec should mention that the passed colors are for highlightInner and shadowOuter props

Dmitry Bessonov-2
In reply to this post by Prasanta Sadhukhan-2
On Thu, 1 Apr 2021 12:20:54 GMT, Prasanta Sadhukhan <[hidden email]> wrote:

> 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.

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

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

PR: https://git.openjdk.java.net/jdk/pull/3305
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: 8264398: BevelBorderUIResource​(int, Color, Color) spec should mention that the passed colors are for highlightInner and shadowOuter props

Prasanta Sadhukhan-2
On Mon, 5 Apr 2021 11:10:40 GMT, Dmitry Bessonov <[hidden email]> wrote:

>> 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.
>
> 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
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.

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

PR: https://git.openjdk.java.net/jdk/pull/3305
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: 8264398: BevelBorderUIResource​(int, Color, Color) spec should mention that the passed colors are for highlightInner and shadowOuter props

Prasanta Sadhukhan-2
On Mon, 5 Apr 2021 11:23:36 GMT, Prasanta Sadhukhan <[hidden email]> wrote:

>> 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
> 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.

any comments on the spec wording?

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

PR: https://git.openjdk.java.net/jdk/pull/3305
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: 8264398: BevelBorderUIResource​(int, Color, Color) spec should mention that the passed colors are for highlightInner and shadowOuter props

Dmitry Bessonov-2
On Tue, 6 Apr 2021 11:12:27 GMT, Prasanta Sadhukhan <[hidden email]> wrote:

>> 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.
>
> 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?

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

PR: https://git.openjdk.java.net/jdk/pull/3305
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: 8264398: BevelBorderUIResource​(int, Color, Color) spec should mention that the passed colors are for highlightInner and shadowOuter props

Prasanta Sadhukhan-2
On Tue, 6 Apr 2021 12:15:20 GMT, Dmitry Bessonov <[hidden email]> wrote:

>> 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
it can return the same color on case-to-case basis.

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

PR: https://git.openjdk.java.net/jdk/pull/3305
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: 8264398: BevelBorderUIResource​(int, Color, Color) spec should mention that the passed colors are for highlightInner and shadowOuter props

Sergey Bylokhov-2
On Tue, 6 Apr 2021 12:31:00 GMT, Prasanta Sadhukhan <[hidden email]> wrote:

>> 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
> it can return the same color on case-to-case basis.

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

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

PR: https://git.openjdk.java.net/jdk/pull/3305
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: 8264398: BevelBorderUIResource​(int, Color, Color) spec should mention that the passed colors are for highlightInner and shadowOuter props

Sergey Bylokhov-2
On Thu, 8 Apr 2021 00:56:34 GMT, Sergey Bylokhov <[hidden email]> wrote:

>> 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.
>
> Please update the title of the bug/PR, since the change now in another class.

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

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

PR: https://git.openjdk.java.net/jdk/pull/3305
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: 8264398: BevelBorderUIResource​(int, Color, Color) spec should mention that the passed colors are for highlightInner and shadowOuter props

Prasanta Sadhukhan-2
On Thu, 8 Apr 2021 01:00:37 GMT, Sergey Bylokhov <[hidden email]> wrote:

>> Please update the title of the bug/PR, since the change now in another class.
>
> 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?

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

PR: https://git.openjdk.java.net/jdk/pull/3305
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: 8264398: BevelBorderUIResource​(int, Color, Color) spec should mention that the passed colors are for highlightInner and shadowOuter props

Sergey Bylokhov-2
On Thu, 8 Apr 2021 04:20:16 GMT, Prasanta Sadhukhan <[hidden email]> wrote:

> 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.

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

PR: https://git.openjdk.java.net/jdk/pull/3305
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: 8264398: BevelBorderUIResource​(int, Color, Color) spec should mention that the passed colors are for highlightInner and shadowOuter props

Prasanta Sadhukhan-2
On Thu, 8 Apr 2021 04:27:02 GMT, Sergey Bylokhov <[hidden email]> wrote:

>> Not sure I understand...The change is still in BevelorderUIResource(int, Color, Color) method so what should be changed in PR title?
>
>> 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!!
You want same spec to be copied to BevelBorder(int, Color, Color) constrcutor too?

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

PR: https://git.openjdk.java.net/jdk/pull/3305
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: 8264398: BevelBorderUIResource​(int, Color, Color) spec should mention that the passed colors are for highlightInner and shadowOuter props

Sergey Bylokhov-2
On Thu, 8 Apr 2021 04:31:12 GMT, Prasanta Sadhukhan <[hidden email]> wrote:

> 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.

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

PR: https://git.openjdk.java.net/jdk/pull/3305
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: 8264398: BevelBorderUIResource​(int, Color, Color) spec should mention that the passed colors are for highlightInner and shadowOuter props [v3]

Prasanta Sadhukhan-2
In reply to this post by Prasanta Sadhukhan-2
> 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.

Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:

  javadoc change in BevelBorder constructor

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/3305/files
  - new: https://git.openjdk.java.net/jdk/pull/3305/files/cb0b25c3..f5d6be5d

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3305&range=02
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3305&range=01-02

  Stats: 4 lines in 1 file changed: 4 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3305.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3305/head:pull/3305

PR: https://git.openjdk.java.net/jdk/pull/3305
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: 8264398: BevelBorderUIResource​(int, Color, Color) and BevelBoder(int, Color, Color) spec should clarify about usage of highlight and shadow color [v3]

Sergey Bylokhov-2
On Thu, 8 Apr 2021 04:58:14 GMT, Prasanta Sadhukhan <[hidden email]> wrote:

>> 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.
>
> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>
>   javadoc change in BevelBorder constructor

src/java.desktop/share/classes/javax/swing/border/BevelBorder.java line 89:

> 87:      * Creates a bevel border with the specified type, highlight and
> 88:      * shadow colors.
> 89:      * highlightOuterColor and highlightInnerColor will be derived from

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.

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

PR: https://git.openjdk.java.net/jdk/pull/3305
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: 8264398: BevelBorderUIResource​(int, Color, Color) and BevelBoder(int, Color, Color) spec should clarify about usage of highlight and shadow color [v4]

Prasanta Sadhukhan-2
In reply to this post by Prasanta Sadhukhan-2
> 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.

Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:

  javadoc change

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/3305/files
  - new: https://git.openjdk.java.net/jdk/pull/3305/files/f5d6be5d..7605c189

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3305&range=03
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3305&range=02-03

  Stats: 20 lines in 2 files changed: 12 ins; 0 del; 8 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3305.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3305/head:pull/3305

PR: https://git.openjdk.java.net/jdk/pull/3305
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: 8264398: BevelBorderUIResource​(int, Color, Color) and BevelBoder(int, Color, Color) spec should clarify about usage of highlight and shadow color [v5]

Prasanta Sadhukhan-2
In reply to this post by Prasanta Sadhukhan-2
> 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.

Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:

  javadoc change

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/3305/files
  - new: https://git.openjdk.java.net/jdk/pull/3305/files/7605c189..4e650b0f

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3305&range=04
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3305&range=03-04

  Stats: 16 lines in 2 files changed: 0 ins; 8 del; 8 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3305.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3305/head:pull/3305

PR: https://git.openjdk.java.net/jdk/pull/3305
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: 8264398: BevelBorderUIResource​(int, Color, Color) and BevelBoder(int, Color, Color) spec should clarify about usage of highlight and shadow color [v3]

Prasanta Sadhukhan-2
In reply to this post by Sergey Bylokhov-2
On Fri, 9 Apr 2021 00:44:54 GMT, Sergey Bylokhov <[hidden email]> wrote:

>> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>>
>>   javadoc change in BevelBorder constructor
>
> src/java.desktop/share/classes/javax/swing/border/BevelBorder.java line 89:
>
>> 87:      * Creates a bevel border with the specified type, highlight and
>> 88:      * shadow colors.
>> 89:      * highlightOuterColor and highlightInnerColor will be derived from
>
> 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.

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

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

PR: https://git.openjdk.java.net/jdk/pull/3305
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: 8264398: BevelBorderUIResource​(int, Color, Color) and BevelBoder(int, Color, Color) spec should clarify about usage of highlight and shadow color [v3]

Dmitry Bessonov-2
On Sat, 10 Apr 2021 02:56:07 GMT, Prasanta Sadhukhan <[hidden email]> wrote:

>> src/java.desktop/share/classes/javax/swing/border/BevelBorder.java line 89:
>>
>>> 87:      * Creates a bevel border with the specified type, highlight and
>>> 88:      * shadow colors.
>>> 89:      * highlightOuterColor and highlightInnerColor will be derived from
>>
>> 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.
>
> I guess I have done what is being asked. Are there any other comments? If not, can this PR and CSR be approved please?

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
 ?

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

PR: https://git.openjdk.java.net/jdk/pull/3305
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: 8264398: BevelBorderUIResource​(int, Color, Color) and BevelBoder(int, Color, Color) spec should clarify about usage of highlight and shadow color [v3]

Prasanta Sadhukhan-2
On Sat, 10 Apr 2021 11:23:42 GMT, Dmitry Bessonov <[hidden email]> wrote:

>> I guess I have done what is being asked. Are there any other comments? If not, can this PR and CSR be approved please?
>
> 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
>  ?

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'.

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

PR: https://git.openjdk.java.net/jdk/pull/3305
12