de.vc.jfo.writing

## Class FlowWriter

- java.lang.Object
- - de.vc.jfo.writing.FlowWriter

-     public class FlowWriter
      extends java.lang.Object

  The FlowWriter writes elements of flows and blocks.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FlowWriter(Block block)` Creates a new flow-writer.
    `FlowWriter(BlockContainer bc)` Creates a new flow-writer.
    `FlowWriter(Flow flow)` Creates a new flow-writer.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `endTable()` Ends a table.
    `CellStyle` | `getCellStyle()` Gets the style of table cells.
    `TableCell` | `getCurrentTableCell()` Gets the current table cell when writing in a table.
    `FlowStyle` | `getFlowStyle()` Gets the style this FlowWriter uses to format paragraphs and text.
    `void` | `newParagraph()` Starts a new paragraph.
    `void` | `newParagraph(int spaceBefore)` Starts a new paragraph.
    `void` | `newParagraph(int spaceBefore, Values.Alignment alignment)` Starts a new paragraph.
    `void` | `newParagraph(Measure spaceBefore)` Starts a new paragraph.
    `void` | `newParagraph(Measure spaceBefore, Measure spaceAfter)` Starts a new paragraph.
    `void` | `newParagraph(Values.Alignment alignment)` Starts a new paragraph.
    `void` | `nextTableCell()` Jumps into the next table cell of a table row.
    `void` | `nextTableRow()` Jumps into the next table row
    `void` | `pageBreak()` Starts a new page.
    `void` | `setCellStyle(CellStyle style)` Sets the style of table cells.
    `void` | `setFlowStyle(FlowStyle style)` Sets the style this FlowWriter uses to format paragraphs and text.
    `void` | `startTable(Measure[] columnWidths)` Starts a table.
    `void` | `startTable(Measure[] columnWidths, java.lang.String[] header, int headerBorderW)` Starts a table
    `void` | `startTable(Measure[] columnWidths, java.lang.String[] header, int hdBorderWidth, java.awt.Color hdBorderColor)` Starts a table.
    `void` | `startTable(Measure[] columnWidths, TableFooter footer)` Starts a table.
    `void` | `startTable(Measure[] columnWidths, TableHeader header)` Starts a table.
    `void` | `startTable(Measure[] columnWidths, TableHeader header, TableFooter footer)` Starts a table.
    `void` | `write(BlockElement element)` Writes an BlockGroupMember into Flow.
    `void` | `write(InlineElement element)` Writes an InlineElement into current Paragraph (Block).
    `void` | `write(java.lang.String text)` Writes some text.
    `void` | `write(java.lang.String text, FontSupport.Style fontStyle)` Writes some text with given font style.
    `void` | `write(java.lang.String text, FontSupport.Weight fontWeight)` Writes some text with given font weight.
    `void` | `write(java.lang.String text, int fontSize)` Writes some text with given font size.
    `void` | `write(java.lang.String text, int fontSize, FontSupport.Style fontStyle)` Writes some text with given font style.
    `void` | `write(java.lang.String text, int fontSize, FontSupport.Weight fontWeight)` Writes some text with given font weight.
    `void` | `write(java.lang.String text, int fontSize, FontSupport.Weight fontWeight, FontSupport.Style fontStyle)` Writes some text with given font style.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FlowWriter

          public FlowWriter(Flow flow)

      Creates a new flow-writer.
      Parameters:
        `flow` - Flow.

    - #### FlowWriter

          public FlowWriter(Block block)

      Creates a new flow-writer.
      Parameters:
        `block` - Block.

    - #### FlowWriter

          public FlowWriter(BlockContainer bc)

      Creates a new flow-writer.
      Parameters:
        `bc` - BlockContainer.

  - ### Method Detail

    - #### getFlowStyle

          public FlowStyle getFlowStyle()

      Gets the style this FlowWriter uses to format paragraphs and text.
      Returns:
        Style.

    - #### setFlowStyle

          public void setFlowStyle(FlowStyle style)

      Sets the style this FlowWriter uses to format paragraphs and text.
      Parameters:
        `style` - New Style.

    - #### getCellStyle

          public CellStyle getCellStyle()

      Gets the style of table cells.
      Returns:
        Style of table cells.

    - #### setCellStyle

          public void setCellStyle(CellStyle style)

      Sets the style of table cells.
      Parameters:
        `style` - Style of table cells.

    - #### write

          public void write(java.lang.String text)

      Writes some text.
      Parameters:
        `text` - Text.

    - #### write

          public void write(java.lang.String text,
                   int fontSize)

      Writes some text with given font size.
      Parameters:
        `text` - Text.
        `fontSize` - New font size. (applied to style)

    - #### write

          public void write(java.lang.String text,
                   FontSupport.Weight fontWeight)

      Writes some text with given font weight.
      Parameters:
        `text` - Text.
        `fontWeight` - New font weight. (applied to style)

    - #### write

          public void write(java.lang.String text,
                   FontSupport.Style fontStyle)

      Writes some text with given font style.
      Parameters:
        `text` - Text.
        `fontStyle` - New font style. (applied to style)

    - #### write

          public void write(java.lang.String text,
                   int fontSize,
                   FontSupport.Weight fontWeight)

      Writes some text with given font weight.
      Parameters:
        `text` - Text.
        `fontSize` - New font size. (applied to style)
        `fontWeight` - New font weight. (applied to style)

    - #### write

          public void write(java.lang.String text,
                   int fontSize,
                   FontSupport.Style fontStyle)

      Writes some text with given font style.
      Parameters:
        `text` - Text.
        `fontSize` - New font size. (applied to style)
        `fontStyle` - New font style. (applied to style)

    - #### write

          public void write(java.lang.String text,
                   int fontSize,
                   FontSupport.Weight fontWeight,
                   FontSupport.Style fontStyle)

      Writes some text with given font style.
      Parameters:
        `text` - Text.
        `fontSize` - New font size. (applied to style)
        `fontWeight` - New font weight. (applied to style)
        `fontStyle` - New font style. (applied to style)

    - #### write

          public void write(InlineElement element)

      Writes an InlineElement into current Paragraph (Block). The current Style-Settings of this FlowWriter are ignored!
      Parameters:
        `element` - InlineElement.

    - #### write

          public void write(BlockElement element)

      Writes an BlockGroupMember into Flow. The current Style-Settings of this FlowWriter are ignored!
      Parameters:
        `element` - BlockGroupMember.

    - #### newParagraph

          public void newParagraph()

      Starts a new paragraph.

    - #### newParagraph

          public void newParagraph(Values.Alignment alignment)

      Starts a new paragraph.
      Parameters:
        `alignment` - New alignment (applied to style).

    - #### pageBreak

          public void pageBreak()

      Starts a new page.

    - #### newParagraph

          public void newParagraph(int spaceBefore)

      Starts a new paragraph.
      Parameters:
        `spaceBefore` - Space before new paragraph in points (applied to style).

    - #### newParagraph

          public void newParagraph(int spaceBefore,
                          Values.Alignment alignment)

      Starts a new paragraph.
      Parameters:
        `spaceBefore` - Space before new paragraph in points (applied to style).
        `alignment` - Text alignment. (applied to style).

    - #### newParagraph

          public void newParagraph(Measure spaceBefore)

      Starts a new paragraph.
      Parameters:
        `spaceBefore` - Space before new paragraph (applied to style).

    - #### newParagraph

          public void newParagraph(Measure spaceBefore,
                          Measure spaceAfter)

      Starts a new paragraph.
      Parameters:
        `spaceBefore` - Space before new paragraph (applied to style).
        `spaceAfter` - Space after new paragraph (applied to style).

    - #### startTable

          public void startTable(Measure[] columnWidths,
                        TableHeader header)

      Starts a table.
      Parameters:
        `columnWidths` - Width of table columns.
        `header` - Table header.

    - #### startTable

          public void startTable(Measure[] columnWidths,
                        java.lang.String[] header,
                        int headerBorderW)

      Starts a table
      Parameters:
        `columnWidths` - Width of table columns
        `header` - Column headers.
        `headerBorderW` - Width of header border in points.

    - #### startTable

          public void startTable(Measure[] columnWidths,
                        java.lang.String[] header,
                        int hdBorderWidth,
                        java.awt.Color hdBorderColor)

      Starts a table.
      Parameters:
        `columnWidths` - Width of table columns
        `header` - Column headers.
        `hdBorderWidth` - Width of headers border in points.
        `hdBorderColor` - Color of headers border.

    - #### startTable

          public void startTable(Measure[] columnWidths,
                        TableFooter footer)

      Starts a table.
      Parameters:
        `columnWidths` - Width of table columns.
        `footer` - Table footer.

    - #### startTable

          public void startTable(Measure[] columnWidths,
                        TableHeader header,
                        TableFooter footer)

      Starts a table.
      Parameters:
        `columnWidths` - Width of table columns.
        `header` - Table header.
        `footer` - Table footer.

    - #### startTable

          public void startTable(Measure[] columnWidths)

      Starts a table. Don't forget to finish table with endTable().
      Parameters:
        `columnWidths` - Width of table columns

    - #### endTable

          public void endTable()

      Ends a table.

    - #### nextTableCell

          public void nextTableCell()

      Jumps into the next table cell of a table row.

    - #### nextTableRow

          public void nextTableRow()

      Jumps into the next table row

    - #### getCurrentTableCell

          public TableCell getCurrentTableCell()

      Gets the current table cell when writing in a table. Calling this methode outside a table will cause a RuntimeException.
      Returns:
        Current table cell.

© 2003-2011 by Sascha Schmidt (vision-cloud.de). All Rights Reserved.