Paulo Levi | 12 Feb 03:03 2008
Picon

I bow before swing.text.

Masters i beg your patience and mercy before a humble petitioner.
There are two matters - one pertains to the HTMLEditorKit.ParserCallback empty class, designed to be a callback to the html parser.
I've tried to use its get HTMLCallback thus:

htmlEditor = new ParserDelegator();
StyledDocument newDoc = new DefaultStyledDocument();
HTMLCallBack c = getHtmlCallback(newDoc);
htmlEditor.parse(reader, c, ignoreCharset);

To my horror the method flush() that is supposted to be called at the end of the parsing, is not. Only handleEndOfLineString(String s) is still faithful.

The other matter is In the DefaultStyledDocument class the bulk insert method.

protected void insert(int offset, ElementSpec [] data) throws BadLocationException

has method code is

   if (data == null || data.length == 0) {
        return;
    }
    try {
        writeLock();

        // install the content
        Content c = getContent();
        int n = data.length;
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < n; i++) {
        ElementSpec es = data[i];
        if (es.getLength() > 0) {
            sb.append(es.getArray(), es.getOffset(),  es.getLength());
        }
        }
        if (sb.length() == 0) {
        // Nothing to insert, bail.
        return;
        }
        UndoableEdit cEdit = c.insertString(offset, sb.toString());

        // create event and build the element structure
        int length = sb.length();
        DefaultDocumentEvent evnt =
        new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.INSERT);
        evnt.addEdit(cEdit);
        buffer.insert(offset, length, data, evnt);
       
        //update bidi
        super.insertUpdate(evnt, null);

        // notify the listeners
        evnt.end();
        fireInsertUpdate(evnt);
        fireUndoableEditUpdate(new UndoableEditEvent(this, evnt));
    } finally {
        writeUnlock();
    }


Undeserving student of the Masters of Swing that i am, may i direct your attention to the StringBuffer created in each bulk insert (that will probably be called buffered, so more than once).

With a default size of 16.

Masters - i then call your attention to the client code arguments - my unworthy eyes spied the array that had to be created by client code, creation thereof that include a length argument for each and every one of the lovely ElementSpec objects. Added to a list-like datastructure - lovingly - by great and gentle code users.

My hands tremble as i dare to suggest something - I AM NOT WORTHY - i abase myself before the glorious and terrible might of the magnificent JDK coders - i offer this.
Could you possibly consider replacing StringBuffer with the spry and luscious StringBuilder and refactoring slightly the existing code to a method

    <at> Override
    protected void insert(int offset, ElementSpec [] data) throws BadLocationException{
       
        int charArraysSize = 0;
        for(ElementSpec e : data)
            charArraysSize += e.getLength();
       
        insert(offset, data, charArraysSize);
    }
   
    protected void insert(int offset, ElementSpec [] data, int charArraysSize) throws BadLocationException{
      .. same except stringbuilder starts with charArraysSize
    }

Also - I cringe to say it - Masters I've sinned by transplanting this code to my custom GPL'd StyledDocument - i see you frown in terrible wisdom - you are right Masters. The effect can't be recreated by these unskilled hands - the super.insertUpdate(evnt, null); call won't allow it. My sin is twofold - for i have commented it.

Forgive for i have i sinned.

Jason Mehrens | 21 Feb 16:51 2008
Picon

[TEST CASE] 6219960 NullPointer on ToolTipManager.mouseEntered

Bug 6219960 has marked Closed, will not be fixed because the evaluator could not create a test case.  Attached is a test case that will produce the null pointer without using custom components (JDK6u4).  Hopefully this is enough proof that this is a real bug.
 
Jason Mehrens

Climb to the top of the charts! Play the word scramble challenge with star power. Play now!
Attachment (SinglePixelTooltip.java): text/x-java, 3538 bytes
Roman Kennke | 29 Feb 13:26 2008

[OpenJDK 2D-Dev] Portable GUI backends

Hi,

(sorry for x-posting, but I think this affects all 3 lists.)

I'd like to point you to my proposal for the OpenJDK Innovators
Challenge, which aims to improve the design of AWT, Java2D and Swing,
such that it is possible to implement new (external) backends for AWT
and Java2D:

http://mail.openjdk.java.net/pipermail/challenge-discuss/2008-February/000045.html

I'd like to hear your opinion on that proposal. The proposal phase ends
on march, 2nd, I will send the final proposal then, so if you have a
good suggestion for improvement, I'd be happy if you could post it today
or tomorrow (in reply to the proposal, not this email please).

Thanks alot and cheers, Roman

--

-- 
Dipl.-Inform. (FH) Roman Kennke, Software Engineer, http://kennke.org
aicas Allerton Interworks Computer Automated Systems GmbH
Haid-und-Neu-Straße 18 * D-76131 Karlsruhe * Germany
http://www.aicas.com   * Tel: +49-721-663 968-0
USt-Id: DE216375633, Handelsregister HRB 109481, AG Karlsruhe
Geschäftsführer: Dr. James J. Hunt

Dmitri Trembovetski | 29 Feb 18:36 2008
Picon

Re: [OpenJDK 2D-Dev] Portable GUI backends


   Hi Roman,

   this looks like a good proposal. Won't be easy, but
   it would be nice to have a clear separation between
   the interfaces and the implementation.

   Thanks,
     Dmitri

Roman Kennke wrote:
> Hi,
> 
> (sorry for x-posting, but I think this affects all 3 lists.)
> 
> I'd like to point you to my proposal for the OpenJDK Innovators
> Challenge, which aims to improve the design of AWT, Java2D and Swing,
> such that it is possible to implement new (external) backends for AWT
> and Java2D:
> 
> http://mail.openjdk.java.net/pipermail/challenge-discuss/2008-February/000045.html
> 
> I'd like to hear your opinion on that proposal. The proposal phase ends
> on march, 2nd, I will send the final proposal then, so if you have a
> good suggestion for improvement, I'd be happy if you could post it today
> or tomorrow (in reply to the proposal, not this email please).
> 
> Thanks alot and cheers, Roman
> 

mr | 1 Mar 07:55 2008
Picon

hg: jdk7/swing: 2 new changesets

Changeset: 0a5c5386a678
Author:    xdono
Date:      2007-12-04 16:28 -0800
URL:       http://hg.openjdk.java.net/jdk7/swing/rev/0a5c5386a678

Added tag jdk7-b24 for changeset cfeea66a3fa8

+ .hgtags

Changeset: c57bef8dda9c
Author:    mr
Date:      2008-02-29 20:03 -0800
URL:       http://hg.openjdk.java.net/jdk7/swing/rev/c57bef8dda9c

6669216: Add jcheck configuration directories
Reviewed-by: ohair, xdono

+ .jcheck/conf

mr | 1 Mar 07:55 2008
Picon

hg: jdk7/swing/corba: 2 new changesets

Changeset: 474c23b174e9
Author:    xdono
Date:      2007-12-04 16:28 -0800
URL:       http://hg.openjdk.java.net/jdk7/swing/corba/rev/474c23b174e9

Added tag jdk7-b24 for changeset 55540e827aef

+ .hgtags

Changeset: fec639c69db2
Author:    mr
Date:      2008-02-29 20:03 -0800
URL:       http://hg.openjdk.java.net/jdk7/swing/corba/rev/fec639c69db2

6669216: Add jcheck configuration directories
Reviewed-by: ohair, xdono

+ .jcheck/conf

mr | 1 Mar 07:56 2008
Picon

hg: jdk7/swing/hotspot: 2 new changesets

Changeset: 92489cdc94d1
Author:    xdono
Date:      2007-12-04 16:28 -0800
URL:       http://hg.openjdk.java.net/jdk7/swing/hotspot/rev/92489cdc94d1

Added tag jdk7-b24 for changeset a61af66fc99e

+ .hgtags

Changeset: 7836be3e92d0
Author:    mr
Date:      2008-02-29 20:03 -0800
URL:       http://hg.openjdk.java.net/jdk7/swing/hotspot/rev/7836be3e92d0

6669216: Add jcheck configuration directories
Reviewed-by: ohair, xdono

+ .jcheck/conf

mr | 1 Mar 07:56 2008
Picon

hg: jdk7/swing/jaxp: 2 new changesets

Changeset: 9e3c1ad7cdb9
Author:    xdono
Date:      2007-12-04 16:28 -0800
URL:       http://hg.openjdk.java.net/jdk7/swing/jaxp/rev/9e3c1ad7cdb9

Added tag jdk7-b24 for changeset 6ce5f4757bde

+ .hgtags

Changeset: 49a4bc7b0aa0
Author:    mr
Date:      2008-02-29 20:03 -0800
URL:       http://hg.openjdk.java.net/jdk7/swing/jaxp/rev/49a4bc7b0aa0

6669216: Add jcheck configuration directories
Reviewed-by: ohair, xdono

+ .jcheck/conf

mr | 1 Mar 07:57 2008
Picon

hg: jdk7/swing/jaxws: 2 new changesets

Changeset: 7d53d3bd7879
Author:    xdono
Date:      2007-12-04 16:28 -0800
URL:       http://hg.openjdk.java.net/jdk7/swing/jaxws/rev/7d53d3bd7879

Added tag jdk7-b24 for changeset 0961a4a21176

+ .hgtags

Changeset: 018781e80410
Author:    mr
Date:      2008-02-29 20:03 -0800
URL:       http://hg.openjdk.java.net/jdk7/swing/jaxws/rev/018781e80410

6669216: Add jcheck configuration directories
Reviewed-by: ohair, xdono

+ .jcheck/conf

mr | 1 Mar 07:57 2008
Picon

hg: jdk7/swing/jdk: 2 new changesets

Changeset: 99a06bc7fdb5
Author:    xdono
Date:      2007-12-04 16:28 -0800
URL:       http://hg.openjdk.java.net/jdk7/swing/jdk/rev/99a06bc7fdb5

Added tag jdk7-b24 for changeset 37a05a11f281

+ .hgtags

Changeset: 8266cb7549d3
Author:    mr
Date:      2008-02-29 20:04 -0800
URL:       http://hg.openjdk.java.net/jdk7/swing/jdk/rev/8266cb7549d3

6669216: Add jcheck configuration directories
Reviewed-by: ohair, xdono

+ .jcheck/conf


Gmane