High performance text component

John Hendrikx hjohn at xs4all.nl
Thu Sep 6 06:19:44 PDT 2012


  I think the problem is in the amount of Nodes that might be in such a 
general purpose container.  They'd all be in a List structure with poor 
insert/remove/search performance.  This may be a big problem with large 
documents.

This of course can be prevented by layering the children in subnodes 
(for a book this could be chapters, pages... or any other hierarchy that 
will split up the big heap of nodes in more manageable chunks.

It would not be impossible though to manage the children of a node in 
such a way that it automatically and transparently partitions them in 
groups, or one can use a different collection type (since Nodes must be 
unique, there are very nice (indexed) Lists that have good insert/remove 
performance -- although not standard in the JDK).

On 6-9-2012 3:02, Pedro Duque Vieira wrote:
> Hi Daniel,
>
> Yes I have read that a while back, but there was no explanation what makes
> this "Div" not suitable for a general purpose container and from what
> Felipe just said it makes me think that this container as even more things
> in common with an HTML DIV than I was thinking before, like the text inside
> wrapping. So my comments are kind of a reaction to the latest writings from
> the JavaFX personnel.
>
> Thanks for pointing that out even so, Daniel, Cheers,
>
> On Wed, Sep 5, 2012 at 5:58 PM, Daniel Zwolenski<zonski at gmail.com>  wrote:
>
>> Hey Pedro,
>>
>> I think you might want to read back through this topic for the thoughts on
>> this.
>>
>> Cheers,
>> Dan
>>
>>
>> On Thu, Sep 6, 2012 at 10:52 AM, Pedro Duque Vieira<
>> pedro.duquevieira at gmail.com>  wrote:
>>
>>> I also wonder this "Div" seems to have a lot in common with the DIV from
>>> HTML. Could this be the base work for having a DIV in JavaFX? This could
>>> be
>>> interesting for web developers who don't know a whole lot of programming
>>> and also in supporting some other features of CSS and in consequence being
>>> able to migrate techniques already existing on the web to a Java app. Also
>>> "Span" seems to have some commonalities with the SPAN from HTML.
>>>
>>> I imagine there will be some challenges like the overflow property of DIVs
>>> and some other things.. so I really don't know how much work/effort would
>>> it take to have something  that is not entirely on the "philosophy" of the
>>> core of JavaFX.
>>>
>>> Just my 2 cents..
>>>
>>> On Wed, Sep 5, 2012 at 1:29 PM, Pedro Duque Vieira<
>>> pedro.duquevieira at gmail.com>  wrote:
>>>
>>>> On 9/5/2012 9:10 AM, Richard Bair wrote:
>>>>>>>>> Felipe, we should update the documents on the WIKI to refer to the
>>>>> "Rich Text API" instead of DOM API because I fear this can get
>>> confusing!
>>>>> Other than those of us internally who have argued for / against the
>>>>> Attributed String style vs. the DOM style, most people probably won't
>>> get
>>>>> the subtlety, having missed the context.
>>>>>>>> Done,
>>>>>>>> Should I rename Div to Paragraph, Span to Text ?
>>>>>>> We already have 'Text'. Is this different or could we reuse what's
>>>>> already there.
>>>>>> That is an open question, although personally I would prefer that we
>>>>> just reuse the Text object. We have to make sense of a Text placed in a
>>>>> "Paragraph" anyway, even if we had a separate Span, so it seems more
>>>>> sensible to just make Text make sense.
>>>>> I'd also prefer to at least try to re-use Text and resort to a new
>>> class
>>>>> only if it we learn
>>>>> through experience that its going to be to problematic.
>>>>>>> Just checking: the 'Paragraph' isn't just a FlowPane with special
>>>>> support for line wrapping text is it? I.e FlowPane.setWordWrapEnabled(
>>>>> true).
>>>>>> I imagine the implementation is completely different, and the spacing
>>>>> etc parameters on FlowPane might not be sensible for a Paragraph.
>>> Plus, it
>>>>> is in the wrong package (we will need package private access to Text
>>>>> internals).
>>>>> I think its important to make clear that its not a general purpose
>>>>> container,
>>>>> and I can't imagine the maintainers of FlowPane want to have to learn
>>> not
>>>>> to break the text usage etc. And FlowPane supports vertical layout too,
>>>>> which
>>>>> is likely to be a tricky one and if we do vertical text layout even
>>> then
>>>>> I wouldn't bet on
>>>>> it fitting well. So making it something different and putting it in
>>>>> javafx.scene.text seems right.
>>>>> BTW can I throw TextLayoutPane and RichTextPane into the mix as
>>> possible
>>>>> names ..
>>>>> -phil.
>>>>>> Richard
>>>>
>>>> Hi,
>>>>
>>>> Just to clear things up in my head: why is it not a general purpose
>>>> container? What's withholding it of being one?
>>>>
>>>> Thanks, best regards,
>>>>
>>>> --
>>>> Pedro Duque Vieira
>>>>
>>>
>>>
>>> --
>>> Pedro Duque Vieira
>>>
>>
>



More information about the openjfx-dev mailing list