Class BlockFlow

All Implemented Interfaces:
IFigure
Direct Known Subclasses:
FlowPage

public class BlockFlow extends FlowFigure
A FlowFigure represented by a single BlockBox containing one or more lines. A BlockFlow is a creator of LineBoxes, which its children require during layout. A BlockFlow can be thought of as a foundation for a paragraph.

BlockFlows must be parented by a FlowFigure. FlowPage can be used as a "root" block and can be parented by normal Figures.

Only FlowFigures can be added to a BlockFlow.

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

Since:
2.1
  • Constructor Details

    • BlockFlow

      public BlockFlow()
      Constructs a new BlockFlow.
  • Method Details

    • contributeBidi

      protected void contributeBidi(BidiProcessor proc)
      BlockFlows contribute a paragraph separator so as to keep the Bidi state of the text on either side of this block from affecting each other. Since each block is like a different paragraph, it does not contribute any actual text to its containing block.
      Overrides:
      contributeBidi in class FlowFigure
      Parameters:
      proc - the BidiProcessor to which contributions should be made
      See Also:
    • createDefaultFlowLayout

      protected FlowFigureLayout createDefaultFlowLayout()
      Description copied from class: FlowFigure
      Creates the default layout manager
      Specified by:
      createDefaultFlowLayout in class FlowFigure
      Returns:
      The default layout
      See Also:
    • getBlockBox

      protected BlockBox getBlockBox()
      Returns the BlockBox associated with this.
      Returns:
      This BlockFlow's BlockBox
    • getHorizontalAligment

      public int getHorizontalAligment()
      Returns the effective horizontal alignment. This method will never return PositionConstants.NONE. If the value is none, it will return the inherited alignment. If no alignment was inherited, it will return the default alignment (PositionConstants.LEFT).
      Returns:
      the effective alignment
    • getLocalOrientation

      public int getLocalOrientation()
      Returns the orientation set on this block.
      Returns:
      LTR, RTL or NONE
      Since:
      3.1
      See Also:
    • getLocalHorizontalAlignment

      public int getLocalHorizontalAlignment()
      Returns the horizontal alignment set on this block.
      Returns:
      LEFT, RIGHT, ALWAYS_LEFT, ALWAYS_RIGHT, NONE
      Since:
      3.1
      See Also:
    • getOrientation

      public int getOrientation()
      Returns this block's Bidi orientation. If none was set on this block, it will inherit the one from its containing block. If there is no containing block, it will return the default orientation (SWT.RIGHT_TO_LEFT if mirrored; SWT.LEFT_TO_RIGHT otherwise).
      Returns:
      SWT.RIGHT_TO_LEFT or SWT.LEFT_TO_RIGHT
      Since:
      3.1
      See Also:
    • paintBorder

      public void paintBorder(Graphics graphics)
      Description copied from class: Figure
      Paints the border associated with this Figure, if one exists.
      Overrides:
      paintBorder in class Figure
      Parameters:
      graphics - The Graphics used to paint
      See Also:
    • postValidate

      public void postValidate()
      Description copied from class: FlowFigure
      Called after validate has occurred. This is used to update the bounds of the FlowFigure to encompass its new flow boxed created during validate.
      Specified by:
      postValidate in class FlowFigure
      See Also:
    • revalidate

      public void revalidate()
      Description copied from interface: IFigure
      Invalidates this figure and revalidates() its parent. If a figure does not have a parent, it will request a validation from it UpdateManager. Calling this method does not guarantee that a repaint will occur.
      Specified by:
      revalidate in interface IFigure
      Overrides:
      revalidate in class Figure
      See Also:
    • revalidateBidi

      protected void revalidateBidi(IFigure origin)
      A Block will invalidate the Bidi state of all its children, so that it is re-evaluated when this block is next validated.
      Overrides:
      revalidateBidi in class FlowFigure
      Parameters:
      origin - the figure that was revalidated
      See Also:
    • setHorizontalAligment

      public void setHorizontalAligment(int value)
      Sets the horitontal aligment of the block. Valid values are:
      Parameters:
      value - the aligment
      See Also:
    • setOrientation

      public void setOrientation(int orientation)
      Sets the orientation for this block. Orientation can be one of: NONE is used to indicate that orientation should be inherited from the encompassing block.
      Parameters:
      orientation - LTR, RTL or NONE
      Since:
      3.1
      See Also:
    • useLocalCoordinates

      protected boolean useLocalCoordinates()
      Description copied from class: Figure
      Returns true if this Figure uses local coordinates. This means its children are placed relative to this Figure's top-left corner.
      Overrides:
      useLocalCoordinates in class Figure
      Returns:
      true if this Figure uses local coordinates
      See Also:
    • validate

      public void validate()
      Re-evaluate the Bidi state of all the fragments if it has been invalidated.
      Specified by:
      validate in interface IFigure
      Overrides:
      validate in class Figure
      See Also: