Eclipse Draw2d
3.0

org.eclipse.draw2d.text
Interface FlowContext

All Known Implementing Classes:
FlowContainerLayout

public interface FlowContext

The context that a FlowFigureLayout uses to perform its layout.

WARNING: This interface is not intended to be implemented by clients. It exists to define the API between the layout and its context.


Method Summary
 void addToCurrentLine(FlowBox box)
          Adds the given box into the current line.
 void endLine()
          The current line should be committed if it is occupied, and then set to null.
 boolean getContinueOnSameLine()
          This method is used to convey layout state to different FlowFigures.
 LineBox getCurrentLine()
          Obtains the current line, creating a new line if there is no current line.
 int getCurrentY()
          Returns the current Y value.
 boolean getWordWidthFollowing(FlowFigure child, int[] width)
          This method looks ahead for line-breaks.
 boolean isCurrentLineOccupied()
           
 void setContinueOnSameLine(boolean value)
          This method is used to convey layout state to different FlowFigures.
 

Method Detail

addToCurrentLine

public void addToCurrentLine(FlowBox box)
Adds the given box into the current line.

Parameters:
box - the FlowBox to add

endLine

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


getContinueOnSameLine

public boolean getContinueOnSameLine()
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
Since:
3.1
See Also:
setContinueOnSameLine(boolean)

getCurrentLine

public LineBox getCurrentLine()
Obtains the current line, creating a new line if there is no current line.

Returns:
the current line

getCurrentY

public int getCurrentY()
Returns the current Y value.

Returns:
the current Y value

getWordWidthFollowing

public boolean getWordWidthFollowing(FlowFigure child,
                                     int[] width)
This method looks ahead for line-breaks. When laying out, this method can be used to determine the next line-break across multiple figures.

Parameters:
child - the search will occur starting from the figure after the given child
width - 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 array
Returns:
boolean indicating whether a line-break was found
Since:
3.1

isCurrentLineOccupied

public boolean isCurrentLineOccupied()
Returns:
true if the current line contains any fragments

setContinueOnSameLine

public void setContinueOnSameLine(boolean value)
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
Since:
3.1
See Also:
getContinueOnSameLine()

Eclipse Draw2d
3.0

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