classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: WrappedPlainView additions make line-wrapping work!


From: Anthony Balkissoon
Subject: [cp-patches] FYI: WrappedPlainView additions make line-wrapping work!
Date: Mon, 31 Oct 2005 15:45:47 -0500

I added a lot to WrappedPlainView (and fixed a bug in Utilities that I
mentioned in a previous email) to make line-wrapping in JTextAreas
actually work!

Of course, when testing, I hardcoded into JTextArea that it's View
should be of type WrappedPlainView so I could see the line wrapping
working.  This is incorrect and I didn't commit that.  WrappedPlainView
should be set as a JTextArea's View when setLineWrap(true) is called.
Once this is working (soon), you'll be able to see the line-wrapping
working.

I also haven't done a whole lot of testing, just a one-time insertion of
text and it wrapped properly, so I'll have to test (and fix) this much
more.


2005-10-31  Anthony Balkissoon  <address@hidden>

        * javax/swing/text/WrappedPlainView.java:
        (viewFactory): New field.
        (drawLine): New API method.
        (calculateBreakPosition): Update the metrics before calling Utilities
        methods. Fixed error in offset argument passed to the Utilities 
        methods.
        (updateMetrics): New implementation method.
        (getPreferredSpan): New API method.
        (insertUpdate): Likewise.
        (removeUpdate): Likewise.
        (changedUpdate): Likewise.
        (WrappedLineCreator): New class.
        (paint): New API method.
        (setSize): New API method.
        (WrappedLine.paint): Implemented.
        (WrappedLine.getPreferredSpan): Don't update the metrics, this is now
        done in WrappedPlainView.paint.
        (WrappedLine.modelToView): Likewise.
        (WrappedLine.viewToModel): Likewise.

--Tony

Attachment: WrappedPlainViewLineWrapping.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]