classpath-patches
[Top][All Lists]
Advanced

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

[cp-patches] FYI: DefaultCaret 1.5 additions


From: Anthony Balkissoon
Subject: [cp-patches] FYI: DefaultCaret 1.5 additions
Date: Fri, 14 Oct 2005 13:30:35 -0400

1.5 introduced update policies for DefaultCaret, this patch implements
them.  It's already committed, but comments are appreciated if we have
some issues w/ putting 1.5 stuff in on the main trunk.

Basically, DefaultCaret has 3 update states - the Caret isn't always
updated when the Document changes.  In the default state if the Document
changes occur on the EventDispatch thread, then the Caret is updated.
The caret can also be updated always (ALWAYS_UPDATE), or only when the
Document length becomes less than the current Caret position
(NEVER_UPDATE).

I made the appropriate changes to insertUpdate and removeUpdate to make
sure they're using the update policy properly.


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

        * javax/swing/text/DefaultCaret.java:
        (ALWAYS_UPDATE): New field.
        (NEVER_UPDATE): New field.
        (UPDATE_WHEN_ON_EDIT): New field.
        (insertUpdate): Fixed docs.  Only update the dot if the policy is
        ALWAYS_UPDATE or if the policy is UPDATE_WHEN_ON_EDT and the event
        was generated on the Event Dispatch thread.
        (removeUpdate): Fixed docs.  Only update the dot if the policy is
        ALWAYS_UPDATE, if the policy is UPDATE_WHEN_ON_EDT and the event was 
        generated on the Event Dispatch thread, or if the document length 
        has become less than the current dot position.
        (setUpdatePolicy): New method.
        (getUpdatePolicy): New method.

--Tony

Attachment: DefaultCaretUpdatePolicies.diff
Description: Text Data


reply via email to

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