[Lazarus] Java's Document & Elements model

Kostas Michalopoulos badsector at slashstone.com
Thu Jun 26 07:30:12 CEST 2008


I have the feeling that Swing uses this wherever text is used. This is why 
you can set a JLabel's caption to "<html>This is <b>some bold test</b> near 
an image <img src='foo.png'>" and having it working. This provides a lot of 
flexibility. And this is one of the reasons why Swing is *so* slow :-). In a 
program of medium size i did in Java which was in Swing, i used this feature 
only once. Yet i could do without it if the toolkit was a little more 
faster.

Please don't bring stuff like this to LCL. Or at least make them so optional 
one can throw them out completelly if not needed. Anything more elaborate 
than:

Canvas.TextOut(X, Y, FCaption);

for a pushbutton is a waste of resources in most cases.

----- Original Message ----- 
From: "Graeme Geldenhuys" <graemeg.lists at gmail.com>
To: "General mailing list" <lazarus at lazarus.freepascal.org>
Sent: Wednesday, June 25, 2008 1:37 PM
Subject: [Lazarus] Java's Document & Elements model


> Hi,
>
> Has anybody studied or tried to implement the Java 'Document' model
> yet? Every text Swing component (JTextArea, JTextEdit, JTextPane etc)
> uses the Document class internally to represent the text content. Is
> seems very easy to use and extend like they did for the Styled
> Document (HTML, RTF etc...). It also supports document/text filters
> for things like Tab Stops, Elastic Tabstops, Spell Checking, Syntax
> Highlighting etc..  Quite a powerfull component which can be used for
> simple one line text components like TEdit and scale to complex text
> components like text editors or HTML, RTF viewers/editors.
>
> I'm researching the posibility of implementing the Document, Elements,
> Position, AttributeSet etc interfaces in Object Pascal for use with
> the text components (TextEdit, Memo, ComboBox etc) in fpGUI. The above
> classes will be toolkit indepenent, but builds a very flexible base to
> use in any text based components.
>
> I thought I would first ask here if anybody has done something like
> this already? I don't want to duplicate work if it's already done by
> somebody else and freely available.
>
> Regards,
> - Graeme -
>
>
> _______________________________________________
> fpGUI - a cross-platform Free Pascal GUI toolkit
> http://opensoft.homeip.net/fpgui/
> _______________________________________________
> Lazarus mailing list
> Lazarus at lazarus.freepascal.org
> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus 




More information about the Lazarus mailing list