<Swing Dev> [9] Review Request for 8133108: [PIT] Container size is wrong in JEditorPane

Semyon Sadetsky semyon.sadetsky at oracle.com
Thu Sep 10 12:31:31 UTC 2015


Correct. It causes i18n layout errors 
[https://bugs.openjdk.java.net/browse/JDK-8076164].
GlyphView calculates its minimum width using text wrapping, but it 
shouldn't do this for the TextField.
In the View specs span calculation should be regulated by 
getSpanWeight()/getBreakWeight() methods, but in one of the previous 
GlyphView.getMinimumSize() fixes these checks were omitted.
My 8076164 fix attempt according to the spec failed because many views 
behavior depends on some defaults of other views which are fixed long 
time ago. The previous fix attempt caused many regressions. In the new 
solution I moved the minimum width fix to the TextFileldUI to avoid any 
impacts on other views and components behavior.

--Semyon

On 9/10/2015 2:23 PM, Alexander Scherbatiy wrote:
>
>   The getMinimumSpan(axis) method is redirected to 
> getPreferredSpan(axis) in the fix for GlyphView in the BasicTextFieldUI.
>   Does it mean that GlyphView itself does not properly display some 
> types of text?
>
>   Thanks,
>   Alexandr.
>
> On 9/3/2015 4:08 PM, Semyon Sadetsky wrote:
>> Hello,
>>
>> I have reworked the fix because more regressions was found.
>> Please look at the updated version:
>> http://cr.openjdk.java.net/~ssadetsky/8133108/webrev.02/
>>
>> --Semyon
>>
>>
>> On 8/10/2015 5:39 PM, Alexander Scherbatiy wrote:
>>> On 8/6/2015 7:46 PM, Semyon Sadetsky wrote:
>>>> Hello,
>>>>
>>>> Please review fix for JDK9:
>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8133108
>>>> webrev: http://cr.openjdk.java.net/~ssadetsky/8133108/webrev.01/
>>>
>>>   Could you look at the test 
>>> javax/swing/JTextPane/JTextPaneDocumentAlignment.java
>>>   It fails on my system with the suggested fix.
>>>
>>>   Thanks,
>>>   Alexandr.
>>>
>>>>
>>>> This a regression from JDK-8132136 after which the GlyphView does 
>>>> not wrap text for the minimum width calculation by default anymore. 
>>>> InlineView as GlyphView descendant should take care about setting 
>>>> the right resize weight now. In the solution getResizeWeight() is 
>>>> overridden in InlineView to return the right weight according to 
>>>> the nowrap field.
>>>> Test suite is added to check the right text positioning for 
>>>> wrap/nowrap styles in the JTextPane document.
>>>>
>>>> --Semyon
>>>
>>
>




More information about the swing-dev mailing list