public class InlineFlowLayout extends FlowContainerLayout
InlineFlow
figures.
WARNING: This class is not intended to be subclassed by clients.
Constructor and Description |
---|
InlineFlowLayout(FlowFigure flow)
Creates a new InlineFlowLayout with the given FlowFigure.
|
Modifier and Type | Method and Description |
---|---|
void |
addLine(CompositeBox box)
Adds the given box as a line below the current line.
|
protected void |
createNewLine()
Used by getCurrentLine().
|
void |
endLine()
The current line should be committed if it is occupied, and then set to
null . |
protected void |
flush()
Called after
FlowContainerLayout.layoutChildren() when all children have been laid
out. |
boolean |
getContinueOnSameLine()
InlineFlowLayout gets this information from its context.
|
void |
getWidthLookahead(FlowFigure child,
int[] result)
This method looks ahead for line-breaks.
|
boolean |
isCurrentLineOccupied() |
void |
preLayout()
Clears out all fragments prior to the call to layoutChildren().
|
void |
setContinueOnSameLine(boolean value)
InlineFlow passes this information to its context.
|
protected void |
setupLine(LineBox line)
Initializes the given LineBox.
|
addToCurrentLine, cleanup, getRemainingLineWidth, layout, layoutChildren
getConstraint, getContext, getFlowFigure, getMinimumSize, getPreferredSize, invalidate, layout, remove, setConstraint, setFlowContext
public InlineFlowLayout(FlowFigure flow)
flow
- The FlowFigurepublic void addLine(CompositeBox box)
box
- the box to addprotected void createNewLine()
FlowContainerLayout
createNewLine
in class FlowContainerLayout
FlowContainerLayout.createNewLine()
public void endLine()
FlowContext
null
. Otherwise, do nothing.FlowContext.endLine()
protected void flush()
FlowContainerLayout
FlowContainerLayout.layoutChildren()
when all children have been laid
out. This method exists to flush the last line.flush
in class FlowContainerLayout
FlowContainerLayout.flush()
public boolean getContinueOnSameLine()
true
if the next fragment should be placed on the
current lineFlowContext.getContinueOnSameLine()
public void getWidthLookahead(FlowFigure child, int[] result)
FlowContext
child
- the search will occur starting from the figure after the given
childresult
- the width before the next line-break (if one's found; all the
width, otherwise) will be added on to the first int in the
given arrayFlowContext.getWidthLookahead(FlowFigure, int[])
public boolean isCurrentLineOccupied()
isCurrentLineOccupied
in interface FlowContext
isCurrentLineOccupied
in class FlowContainerLayout
true
if the current line contains any fragmentsFlowContainerLayout.isCurrentLineOccupied()
public void preLayout()
preLayout
in class FlowContainerLayout
public void setContinueOnSameLine(boolean value)
value
- true
indicates that the first fragment of the
next TextFlow should be laid out on the current line, and not
a new oneFlowContext.setContinueOnSameLine(boolean)
protected void setupLine(LineBox line)
line
- The LineBox to initialize.Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.