Class LayoutMasterProperties.Builder

  • Enclosing class:
    LayoutMasterProperties

    public static class LayoutMasterProperties.Builder
    extends Object
    Configuration class for a ConfigurableLayoutMaster.
    • Constructor Detail

      • Builder

        public Builder​(int pageWidth,
                       int pageHeight)
        Creates a new builder for layout master properties with the specified width and height.
        Parameters:
        pageWidth - the page width, in characters
        pageHeight - the page height, in characters
    • Method Detail

      • innerMargin

        public LayoutMasterProperties.Builder innerMargin​(int value)
        Sets the inner margin, that is to say the margin closest to the binding edge of the page.
        Parameters:
        value - the inner margin, in characters
        Returns:
        returns this builder
      • outerMargin

        public LayoutMasterProperties.Builder outerMargin​(int value)
        Sets the outer margin, that is to say the margin opposite to the binding edge of the page.
        Parameters:
        value - the outer margin, in characters
        Returns:
        returns this builder
      • rowSpacing

        public LayoutMasterProperties.Builder rowSpacing​(float value)
        Sets the row spacing, that is to say the distance between two consecutive rows of text.
        Parameters:
        value - the row spacing, in character heights
        Returns:
        returns this builder
        Throws:
        IllegalArgumentException - if the value is <1
      • duplex

        public LayoutMasterProperties.Builder duplex​(boolean value)
        Sets the duplex property, in other words whether to use both sides of a sheet or not. If set to true, both sides of a sheet should be used. If set to false, only one side of a sheet should be used.
        Parameters:
        value - the value
        Returns:
        returns this builder
      • build

        public LayoutMasterProperties build()
        Creates a new LayoutMasterProperties based on the current state of the builder.
        Returns:
        returns a new instance