public class BlockFlowLayout extends FlowContainerLayout
BlockFlow figures.
WARNING: This class is not intended to be subclassed by clients.
| Constructor and Description |
|---|
BlockFlowLayout(BlockFlow blockFlow)
Creates a new BlockFlowLayout with the given BlockFlow.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addCurrentLine()
Align the line horizontally and then commit it.
|
void |
addLine(CompositeBox box)
Adds an entire line into the context.
|
void |
blockContentsChanged()
Marks the blocks contents as changed.
|
protected void |
cleanup()
Flush anything pending and free all temporary data used during layout.
|
protected void |
createNewLine()
Used by getCurrentLine().
|
protected void |
endBlock()
Called by flush(), adds the BlockBox associated with this BlockFlowLayout
to the current line and then ends the line.
|
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. |
protected BlockFlow |
getBlockFlow()
Returns the BlockFlow associated with this BlockFlowLayout
|
boolean |
getContinueOnSameLine()
This method is used to convey layout state to different FlowFigures.
|
void |
getWidthLookahead(FlowFigure child,
int[] result)
This method looks ahead for line-breaks.
|
protected void |
preLayout()
Called before layoutChildren() to setup any necessary state.
|
void |
setContinueOnSameLine(boolean value)
This method is used to convey layout state to different FlowFigures.
|
protected void |
setupBlock()
sets up the single block that contains all of the lines.
|
addToCurrentLine, getRemainingLineWidth, isCurrentLineOccupied, layout, layoutChildrengetConstraint, getContext, getFlowFigure, getMinimumSize, getPreferredSize, invalidate, layout, remove, setConstraint, setFlowContextpublic BlockFlowLayout(BlockFlow blockFlow)
blockFlow - the BlockFlowprotected void addCurrentLine()
public void addLine(CompositeBox box)
FlowContextbox - the line being addedFlowContext.addLine(CompositeBox)public void blockContentsChanged()
protected void cleanup()
FlowContainerLayoutcleanup in class FlowContainerLayoutFlowContainerLayout.cleanup()protected void createNewLine()
FlowContainerLayoutcreateNewLine in class FlowContainerLayoutFlowContainerLayout.createNewLine()protected void endBlock()
public void endLine()
FlowContextnull. Otherwise, do nothing.FlowContext.endLine()protected void flush()
FlowContainerLayoutFlowContainerLayout.layoutChildren() when all children have been laid
out. This method exists to flush the last line.flush in class FlowContainerLayoutFlowContainerLayout.flush()protected final BlockFlow getBlockFlow()
public boolean getContinueOnSameLine()
FlowContexttrue if the next fragment should be placed on the
current lineFlowContext.getContinueOnSameLine()public void getWidthLookahead(FlowFigure child, int[] result)
FlowContextchild - 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[])protected void preLayout()
FlowContainerLayoutpreLayout in class FlowContainerLayoutFlowContainerLayout.preLayout()public void setContinueOnSameLine(boolean value)
FlowContextvalue - 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 setupBlock()
Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.