Eclipse Draw2d
3.0

org.eclipse.draw2d.text
Class BlockFlowLayout

java.lang.Object
  extended byorg.eclipse.draw2d.AbstractLayout
      extended byorg.eclipse.draw2d.text.FlowFigureLayout
          extended byorg.eclipse.draw2d.text.FlowContainerLayout
              extended byorg.eclipse.draw2d.text.BlockFlowLayout
All Implemented Interfaces:
FlowContext, LayoutManager
Direct Known Subclasses:
PageFlowLayout

public class BlockFlowLayout
extends FlowContainerLayout

The layout for BlockFlow figures.

WARNING: This class is not intended to be subclassed by clients.

Since:
2.1

Field Summary
 
Fields inherited from class org.eclipse.draw2d.text.FlowContainerLayout
currentLine
 
Fields inherited from class org.eclipse.draw2d.text.FlowFigureLayout
context, invalid
 
Fields inherited from class org.eclipse.draw2d.AbstractLayout
isObservingVisibility, preferredSize
 
Constructor Summary
BlockFlowLayout(BlockFlow blockFlow)
          Creates a new BlockFlowLayout with the given BlockFlow.
 
Method Summary
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 getConsumeSpaceOnNewLine()
          This method is used to convey layout state to different FlowFigures.
 boolean getContinueOnSameLine()
          This method is used to convey layout state to different FlowFigures.
 int getCurrentY()
          Returns the current Y value.
protected  void layoutLine()
          Align the line horizontally and then commit it.
protected  void preLayout()
          Called before layoutChildren() to setup any necessary state.
 void setConsumeSpaceOnNewLine(boolean eat)
          This method is used to convey layout state to different FlowFigures.
 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.
protected  void setupLine(LineBox line)
          Override to setup the line's x, remaining, and available width.
 
Methods inherited from class org.eclipse.draw2d.text.FlowContainerLayout
addToCurrentLine, getCurrentLine, getWordWidthFollowing, isCurrentLineOccupied, layout, layoutChildren
 
Methods inherited from class org.eclipse.draw2d.text.FlowFigureLayout
calculatePreferredSize, getFlowFigure, invalidate, layout, setFlowContext
 
Methods inherited from class org.eclipse.draw2d.AbstractLayout
calculatePreferredSize, getBorderPreferredSize, getConstraint, getMinimumSize, getMinimumSize, getPreferredSize, getPreferredSize, invalidate, isObservingVisibility, remove, setConstraint, setObserveVisibility
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockFlowLayout

public BlockFlowLayout(BlockFlow blockFlow)
Creates a new BlockFlowLayout with the given BlockFlow.

Parameters:
blockFlow - the BlockFlow
Method Detail

cleanup

protected void cleanup()
Description copied from class: FlowContainerLayout
Flush anything pending and free all temporary data used during layout.

Overrides:
cleanup in class FlowContainerLayout
See Also:
FlowContainerLayout.cleanup()

getConsumeSpaceOnNewLine

public boolean getConsumeSpaceOnNewLine()
Description copied from interface: FlowContext
This method is used to convey layout state to different FlowFigures. This state is cleared when a fragments is added to the current line and once the layout is complete.

Returns:
true if leading whitespace should be consumed on the newline
See Also:
FlowContext.getConsumeSpaceOnNewLine()

getContinueOnSameLine

public boolean getContinueOnSameLine()
Description copied from interface: FlowContext
This method is used to convey layout state to different FlowFigures. This state is cleared when a fragment is added to the current line and once the layout is complete.

Returns:
true if the next fragment should be placed on the current line
See Also:
FlowContext.getContinueOnSameLine()

createNewLine

protected void createNewLine()
Description copied from class: FlowContainerLayout
Used by getCurrentLine().

Specified by:
createNewLine in class FlowContainerLayout
See Also:
FlowContainerLayout.createNewLine()

endBlock

protected void endBlock()
Called by flush(), adds the BlockBox associated with this BlockFlowLayout to the current line and then ends the line.


endLine

public void endLine()
Description copied from interface: FlowContext
The current line should be committed if it is occupied, and then set to null. Otherwise, do nothing.

See Also:
FlowContext.endLine()

flush

protected void flush()
Description copied from class: FlowContainerLayout
Called after FlowContainerLayout.layoutChildren() when all children have been laid out. This method exists to flush the last line.

Specified by:
flush in class FlowContainerLayout
See Also:
FlowContainerLayout.flush()

getBlockFlow

protected final BlockFlow getBlockFlow()
Returns the BlockFlow associated with this BlockFlowLayout

Returns:
the BlockFlow

getCurrentY

public int getCurrentY()
Description copied from interface: FlowContext
Returns the current Y value.

Returns:
the current Y value
See Also:
FlowContext.getCurrentY()

layoutLine

protected void layoutLine()
Align the line horizontally and then commit it.


preLayout

protected void preLayout()
Description copied from class: FlowContainerLayout
Called before layoutChildren() to setup any necessary state.

Specified by:
preLayout in class FlowContainerLayout
See Also:
FlowContainerLayout.preLayout()

setConsumeSpaceOnNewLine

public void setConsumeSpaceOnNewLine(boolean eat)
Description copied from interface: FlowContext
This method is used to convey layout state to different FlowFigures. This state is cleared when a fragment is added and once the layout is complete.

Parameters:
eat - true indicates that the next TextFlow to be laid out should not display its first whitespace character (if it has one), if it is being placed on a new line
See Also:
FlowContext.setConsumeSpaceOnNewLine(boolean)

setContinueOnSameLine

public void setContinueOnSameLine(boolean value)
Description copied from interface: FlowContext
This method is used to convey layout state to different FlowFigures. This state is cleared when a fragment is added and once the layout is complete.

Parameters:
value - true indicates that the first fragment of the next TextFlow should be laid out on the current line, and not a new one
See Also:
FlowContext.setContinueOnSameLine(boolean)

setupBlock

protected void setupBlock()
sets up the single block that contains all of the lines.


setupLine

protected void setupLine(LineBox line)
Override to setup the line's x, remaining, and available width.

Parameters:
line - the LineBox to set up

Eclipse Draw2d
3.0

Copyright (c) IBM Corp. and others 2000, 2004. All Rights Reserved.