Hmm. How about PHTMLText (or PHtmlText?) and setText, setTextColor methods to match PText?
I can be sold on committing it to core. The fidelity of PText looks pretty bad in some cases when compared to properly hinted JLabels. I will have to ressurect an example I whipped up some time ago to compare text rendering with different rendering hint settings in Swing vs. AWT vs. Piccolo and update it with a JLabel rendering with BasicHTML and the PHTMLText node. And SWT if I ever figure out how to build that module. michael On Mon, Jul 27, 2009 at 11:19 PM, Allain Lalonde<allain.lalo...@gmail.com> wrote: > The HTMLNode will perform slightly faster than a a JLabel with embedded html > since their won't be the overhead associated with the rest of the PSwing > code. > > Under the hood the JComponents use the same infrastructure as HTMLNode does. > > As far as naming goes PHTML might be awkward, but seeing that name leaves no > questions about what it does. It's perfect. > > 2009/7/27 Samuel Robert Reid <re...@colorado.edu> >> >> Something that's been bothersome with the proposed implementation of >> HTMLNode is the difference in setters between HTMLNode and PText (such as >> setting the text color); it would be nice if their interfaces were similar >> enough that it's easy to switch back and forth without having to change >> calls to setters, etc. Also, we should consider whether there is a >> reasonable name that fits better alongside PText, PImage, etc. (though PHTML >> sounds awkward). Also, what about putting this in piccolo core? >> >> Sam Reid >> >> Michael Heuer wrote: >> >> I also agree, please create an issue if one does not already exist. >> How does this perform when compared to JLabel via PSwing? >> >> Font, HTML, and HTMLColor should all be bound properties; in other >> words, they should fire property change events. >> >> michael >> >> >> On Mon, Jul 27, 2009 at 7:20 PM, Samuel Robert Reid<re...@colorado.edu> >> wrote: >> >> >> I agree this should become part of the extras package; it's >> indispensable to my team's projects. Regarding the performance, it is >> orders of magnitude slower than using a PText, so in some situations >> where I would have preferred HTMLNodes, I've made due with PTexts >> instead (where there are many onscreen simultaneously and when smooth >> performance is essential). >> >> Sam Reid >> >> allain wrote: >> >> >> The code here: >> >> http://groups.google.com/group/piccolo2d-users/browse_thread/thread/25835a96a5d921e7/6cf577a995557268?q=HTMLNode+piccolo#6cf577a995557268 >> >> Should definitely be considered for inclusion in Extras. For rendering >> styled text, it's far better (or at least simpler) then trying to hack >> something together with PStyledText and it's very fast since the guys >> at sun seem to have optimized the heck out of the HTMLView stuff. >> (I'll attest to having over a thousand HTML nodes on screen without >> even a hiccup). >> >> Thoughts? >> >> >> >> > > > > > --~--~---------~--~----~------------~-------~--~----~ Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en -~----------~----~----~----~------~----~------~--~---