[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.tools.gef] Re: draw2d.text indent strategy
|
> At this point I am only interested in the presentation (and not any
> interaction).
>
> The goal is to have a programmable strategy for indenting. At this point
we
> certainly can see situations where the first line of a "paragraph"
> (TextFlow) is indented and the remaining are not (which does not lend
itself
> to only a MarginBorder for example). We're also envisioning other
> strategies such as the first line of a flow being left justified and any
new
> lines being indented.
Out of curiousity, what type of editor is this for?
>
> > If you just want a nested block with a border, you should be able to
> > handle
> > this at the BlockFigure or its layout. Perhaps in setupBlock, the
> > recommended width should substract insets.getWidth()
>
> I've poked around a bit at the BlockFlowLayout level and I have gotten
> indenting to work mininally (such as in BlockFlowLayout.layoutLine()
setting
> currentLine.x to Insets.left to start and doing the necessary shrinking of
> the recommended width). But this is only step one.
> I keep running into a wall whenever I attempt to modify setupLine() to
> change the initial 'x' position of a line. It seems that LineBox.commit()
> and contiguousCommit() just aren't designed to do anything but start at
the
> parent's 'x'. Things are just screaming to have a reference to the
> FlowFigure in LineBox so that I can determine any indent offset.
Thoughts?
I think that LineBox and boxes in general need to support "padding" and
"insets". For first line indentation, the LineBox would have left insets >
0. The BlockFlow is creating the LineBoxes, so I don't see why
back-pointers are needed or for LineBox to become anything more than a
struct (ok, with convenience methods). Padding would be space outside of
the content. Sometimes padding will not be additive. For example, if a
block requires 10 pixels below, and the next block requires 20 above, then
just 20 pixels will separate the blocks content areas.
Inline Borders would be special borders with 6 types of "sides": TLBR, and
right-continued, and left-continued.