Class InlineFlow

All Implemented Interfaces:
IFigure
Direct Known Subclasses:
TextFlow

public class InlineFlow extends FlowFigure
A FlowFigure represented by multiple LineBox fragments. An InlineFlow's parent must be either a BlockFlow or another InlineFlow.

An InlineFlow may contain other InlineFlow figures.

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

Since:
2.0
  • Constructor Details

    • InlineFlow

      public InlineFlow()
  • Method Details

    • addLeadingWordRequirements

      public boolean addLeadingWordRequirements(int[] width)
      Iterates over the children to find the width before a line-break is encountered.
      Overrides:
      addLeadingWordRequirements in class FlowFigure
      Parameters:
      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 or not a line-break was found
      See Also:
    • containsPoint

      public boolean containsPoint(int x, int y)
      Extended to return false if the point is not also contained by at least one fragment.
      Specified by:
      containsPoint in interface IFigure
      Overrides:
      containsPoint in class Figure
      Parameters:
      x - the relative x coordinate
      y - the relative y coordinate
      Returns:
      true if a fragment contains the given point
      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:
    • getFragments

      public List<? extends FlowBox> getFragments()
      Returns the FlowBox fragments contained in this InlineFlow. The returned list should not be modified.
      Returns:
      The fragments
    • paintBorder

      protected void paintBorder(Graphics graphics)
      Overridden to paint a FlowBorder if present, and draw selection. The border is painted first, followed by selection which is generally done in XOR, which still allows the border to be seen.
      Overrides:
      paintBorder in class Figure
      Parameters:
      graphics - the graphics
      See Also:
    • paintSelection

      protected void paintSelection(Graphics graphics)
      Renders the XOR selection rectangles to the graphics.
      Parameters:
      graphics - the graphics to paint on
      Since:
      3.1
    • 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:
    • setBorder

      public void setBorder(Border border)
      Overridden to assert that only FlowBorder is used. null is still a valid value as well.
      Specified by:
      setBorder in interface IFigure
      Overrides:
      setBorder in class Figure
      Parameters:
      border - null or a FlowBorder
      See Also: