|
From: | Benja Fallenstein |
Subject: | Re: [Gzz-commits] gzz/gzz/view LinebrokenCellContentView.java |
Date: | Sat, 11 Jan 2003 13:18:33 +0100 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021226 Debian/1.2.1-9 |
Hi Matti! Matti Katila wrote:
On Fri, 10 Jan 2003, Benja Fallenstein wrote:Fixing LinebrokenCellContentView.getSize()Can you explain this fix to me, please? I don't understand it :)Without this PP looked ugly, because width of a bouding box it drew around linked cell was width of the whole content of that cell. Now LinebrokenCellContentView returns the width of its longest line.Wait. You're saying that it didn't do linebreaking? And you made it so that it linebreaks at newlines (and nowhere else)? Nonono, that's wrong. Not as wrong as it was before, but still wrong. ;-)I don't understand what you mean. Just saying it is wrong doesn't say what is right :)
I tried to say below, and from your replies, it seems you understood at least part of it, so please do tell which parts you don't grok?
getSize() is supposed to be used by the views to decide what size the box should be they give to the Cell(Content)View.I don't know the issues well but this sounds right.Now, think about what your algorithm would do: Make the box big enough that the longest paragraph fits into it as a single line! *Very* wide boxes...Yes that was the purpose. Because there isn't auto LF in PP so what we wanted is what Asko coded.
But think about what it would do *for the case explained in the paragraph before*, which is the main purpose of LinebreakingCCV: in a stretch-vanishing view that shows cells as big as the content view wants them to be.
In practice, it seems that getSize() isn't used-- getHeight() is used instead. getHeight() takes a given width, does the linebreaking and computes the height necessary to layout the text.Hmm.. Might be better to extend a new PPLinebrokenCellContentView where getSize is overloaded.
You could also use a very long width string-- e.g., 60 times "X". This *would* break sometimes, but the box would be wide enough that people probably actually want the text broken. Or, alternatively, use getHeight() with an infinite width (Integer.MAX_INT will be infinite enough for your purposes). Then there would be no automatic linebreaks at all, actually.
- Benja
[Prev in Thread] | Current Thread | [Next in Thread] |