United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-8024395 : Improve fix for line break calculations

Details
Type:
Bug
Submit Date:
2013-09-06
Status:
Resolved
Updated Date:
2014-07-15
Project Name:
JDK
Resolved Date:
2013-09-12
Component:
client-libs
OS:
generic
Sub-Component:
javax.swing
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
7u40,8
Fixed Versions:

Related Reports
Backport:
Backport:
Backport:
Relates:
Relates:
Relates:
Relates:

Sub Tasks

Description
The fix made under JDK-8014863 is not full. JDK 7 and 8 still have some problems with line break calculation.

Steps to reproduce:
1. Run HTMLEditorTest.java (attached).
2. Place the cursor at the beginning of the first line and then type "one two ".

After the last space been entered the first line is incorrectly broken after the "this is" where we'd expect to see at least "this is a test" on the first line.
                                    

Comments
URL:   http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/3213c388740a
User:  lana
Date:  2013-10-01 17:37:37 +0000

                                     
2013-10-01
URL:   http://hg.openjdk.java.net/jdk8/awt/jdk/rev/3213c388740a
User:  mcherkas
Date:  2013-09-12 14:44:53 +0000

                                     
2013-09-12
Evaluation: the method View.forwardUpdate() does not send update event to the view located right after the changed place. It looks like, this behaviour is caused by complexity of View.forwardUpdate() since the method is responsible for sending updates to all types of views available in the system.
Suggested fix: revert the changes added for JDK-8014863 and override forwardUpdate() method for LogicalView class located at FlowView. LogicalView.forwardUpdate() sends update event to all views followed by the changed place. This event will cause view to drop the cache and re-calculate its break points. The fix does not cause the break spots re-calculation every time when a view is laid out. It initiates the break spots re-calculation only when an update of a document takes place.
                                     
2013-09-06



Hardware and Software, Engineered to Work Together