de.vc.jfo.pagination

## Class SimplePageMaster

- java.lang.Object
- - de.vc.xml.AbstractNode
  - - de.vc.xml.AbstractNodeWithAttributes
    - - de.vc.jfo.FormattingObject
      - - de.vc.jfo.pagination.SimplePageMaster

- All Implemented Interfaces:
    PageMaster, Node, NodeElement, java.io.Serializable, java.lang.Cloneable

      public class SimplePageMaster
      extends FormattingObject
      implements PageMaster

  The fo:simple-page-master is used in the generation of pages and specifies the geometry of the page. The page may be subdivided into up to five regions: region-body, region-before, region-after, region-start, and region-end.

  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `SimplePageMaster.PageDescription`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static SimplePageMaster.PageDescription` | `DIN_A0` Describes a DIN A0 Page.
    `static SimplePageMaster.PageDescription` | `DIN_A1` Describes a DIN A1 Page.
    `static SimplePageMaster.PageDescription` | `DIN_A2` Describes a DIN A2 Page.
    `static SimplePageMaster.PageDescription` | `DIN_A3` Describes a DIN A3 Page.
    `static SimplePageMaster.PageDescription` | `DIN_A4` Describes a DIN A4 Page.
    `static SimplePageMaster.PageDescription` | `DIN_A5` Describes a DIN A5 Page.
    `static SimplePageMaster.PageDescription` | `DIN_A6` Describes a DIN A6 Page.
    `static SimplePageMaster.PageDescription` | `DIN_C4` Describes a DIN C4 Page.

    - ### Fields inherited from class de.vc.jfo.FormattingObject

      `EMPTY_ARRAY`

    - ### Fields inherited from class de.vc.xml.AbstractNodeWithAttributes

      `MAP_TYPE_FLYWEIGHT, MAP_TYPE_HASH`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimplePageMaster()` Creates a new SimplePageMaster.
    `SimplePageMaster(Measure width, Measure height)` Creates a new SimplePageMaster.
    `SimplePageMaster(Measure width, Measure height, Measure margH, Measure margV)` Creates a new SimplePageMaster.
    `SimplePageMaster(SimplePageMaster.PageDescription pageDesc)` Creates a new SimplePageMaster.
    `SimplePageMaster(java.lang.String masterName)` Creates a new SimplePageMaster.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `addUnsafe(java.lang.Object child)` Adds a NodeElement to this FormattingObject.
    `java.lang.Object` | `clone()` Clones this element.
    `SimplePageMaster` | `cloned()`
    `Measure` | `getBodyHeight(int pageNumber)` Gets the height of the body defined (or referenced) by this PageMaster excluding Before- and AfterRegion.
    `Measure` | `getBodyWidth(int pageNumber)` Gets the width of the body defined (or referenced) by this PageMaster excluding Start- and EndRegion.
    `java.util.List` | `getElements()` Gets childreen of this node.
    `LayoutMasterSet` | `getLayoutMasterSet()`
    `Margin` | `getMargin()` Gets the margin of this fo.
    `java.lang.String` | `getMasterName()` Gets the master-name of this PageMaster.
    `Measure` | `getPageHeight()`
    `Measure` | `getPageWidth()`
    `RegionAfter` | `getRegionAfter()`
    `RegionBefore` | `getRegionBefore()`
    `RegionBody` | `getRegionBody()`
    `RegionEnd` | `getRegionEnd()`
    `RegionStart` | `getRegionStart()`
    `SimplePageMaster` | `getSimplePageMaster(int pageNumber)` Gets the SimplePageMaster of given page number.
    `SimplePageMaster[]` | `getUsedSimplePageMasters()` Gets an array of all used (referenced) simple page masters of this page master.
    `Values.WritingMode` | `getWritingMode()` Gets the writing mode of this formatting object.
    `void` | `removeRegionAfter()`
    `void` | `removeRegionBefore()`
    `void` | `removeRegionEnd()`
    `void` | `removeRegionStart()`
    `void` | `setHeight(Measure h)`
    `void` | `setMargin(Margin margin)` Sets the margin of this fo.
    `void` | `setMasterName(java.lang.String name)` Sets the master-name of this PageMaster.
    `void` | `setRegionAfter(Measure height, Measure space)` Defines the region at bottom of body (footer).
    `void` | `setRegionBefore(Measure height, Measure space)` Defines the region at top of body (header).
    `void` | `setRegionEnd(Measure width, Measure space)` Defines the region right of body.
    `void` | `setRegionStart(Measure width, Measure space)` Defines the region left of body.
    `void` | `setRegionTopSize(Measure topMargin, Measure extend, Measure bottomMargin)`
    `void` | `setWidth(Measure w)`
    `void` | `setWritingMode(Values.WritingMode mode)` Sets the writing mode for this formatting object.

    - ### Methods inherited from class de.vc.jfo.FormattingObject

      `addElement, addElement, addUnsafe, cloned, clonedList, createUniqueID, doGetAttribute, doSetAttribute, elementCount, get, getAbsolutePosition, getAccessibility, getAttributeMap, getBackground, getBorder, getDefinedAttributes, getDocument, getFont, getID, getLanguage, getLogger, getMeasureValue, getObjectValue, getObjectValue, getObjectValue, getObjectValue, getOrphans, getPadding, getParentFO, getRelativePosition, getWidows, hasBorder, hasID, hasPadding, isEmpty, isHyphenation, removeElement, removeElement, replaceElement, setAbsolutePosition, setAccessibility, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setBackground, setBorder, setElement, setFont, setHyphenation, setID, setLanguage, setLanguage, setOrphans, setPadding, setRelativePosition, setWidows`

    - ### Methods inherited from class de.vc.xml.AbstractNodeWithAttributes

      `getDefaultMapType, setDefaultMapType`

    - ### Methods inherited from class de.vc.xml.AbstractNode

      `addAttributeChangeListener, addElements, addElements, clearEqualAttributes, clearInheratedAttribute, clearInheratedAttributes, clearValue, contains, contains, copyAttributes, createID, findFirstNodeWithText, findNode, findNodesWithText, fire, fireSaxEvents, firstElement, getAttrAsBoolean, getAttrAsInteger, getAttrAsString, getAttrAsString, getAttribute, getAttribute, getAttributeMap, getContentText, getContentText, getDefinedAttributes, getElements, getElements, getElements, getFirstElement, getIndex, getLocalName, getNamespacePrefix, getNamespacePrefixes, getNamespaceURI, getParent, getParent, getParent, getParentOrThis, getQName, getRoot, hasEqualAttrs, indexOf, lastElement, liftInheritedAttribute, removeAttributeChangeListener, setAttribute, setAttributes, setAttrIfNotNull, setEnableAttributeChangeEvent, setNamespace, setParent, setQName, setUndefinedAttributes, writeTo, writeTo, writeTo, writeTo`

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

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

    - ### Methods inherited from interface de.vc.xml.Node

      `addAttributeChangeListener, addElement, addElement, clearInheratedAttribute, clearInheratedAttributes, clearValue, contains, fireSaxEvents, firstElement, getAttrAsString, getAttrAsString, getAttribute, getAttribute, getAttributeMap, getContentText, getDefinedAttributes, getElements, getLocalName, getNamespacePrefix, getNamespacePrefixes, getNamespaceURI, getQName, getRoot, indexOf, isEmpty, lastElement, removeAttributeChangeListener, removeElement, removeElement, replaceElement, setAttribute, setAttributes, setElement, setNamespace`

    - ### Methods inherited from interface de.vc.xml.NodeElement

      `getParent, setParent, writeTo`

- - ### Field Detail

    - #### DIN_A0

          public static SimplePageMaster.PageDescription DIN_A0

      Describes a DIN A0 Page. Margins around 100 mm.

    - #### DIN_A1

          public static SimplePageMaster.PageDescription DIN_A1

      Describes a DIN A1 Page. Margins around 70 mm.

    - #### DIN_A2

          public static SimplePageMaster.PageDescription DIN_A2

      Describes a DIN A2 Page. Margins around 50 mm.

    - #### DIN_A3

          public static SimplePageMaster.PageDescription DIN_A3

      Describes a DIN A3 Page. Margins around 35 mm.

    - #### DIN_A4

          public static SimplePageMaster.PageDescription DIN_A4

      Describes a DIN A4 Page. Margins around 25 mm.

    - #### DIN_A5

          public static SimplePageMaster.PageDescription DIN_A5

      Describes a DIN A5 Page. Margins around 17.5 mm.

    - #### DIN_A6

          public static SimplePageMaster.PageDescription DIN_A6

      Describes a DIN A6 Page. Margins around 12.5 mm.

    - #### DIN_C4

          public static SimplePageMaster.PageDescription DIN_C4

      Describes a DIN C4 Page. Margins around 5 mm.

  - ### Constructor Detail

    - #### SimplePageMaster

          public SimplePageMaster()

      Creates a new SimplePageMaster. Master-Name will be generated automatically.

    - #### SimplePageMaster

          public SimplePageMaster(SimplePageMaster.PageDescription pageDesc)

      Creates a new SimplePageMaster. Master-Name will be generated automatically.
      Parameters:
        `pageDesc` - PageDescription

    - #### SimplePageMaster

          public SimplePageMaster(java.lang.String masterName)

      Creates a new SimplePageMaster.
      Parameters:
        `masterName` - Master-Name.

    - #### SimplePageMaster

          public SimplePageMaster(Measure width,
                          Measure height)

      Creates a new SimplePageMaster.
      Parameters:
        `width` - Width of page.
        `height` - Height of page.

    - #### SimplePageMaster

          public SimplePageMaster(Measure width,
                          Measure height,
                          Measure margH,
                          Measure margV)

      Creates a new SimplePageMaster.
      Parameters:
        `width` - Width of page.
        `height` - Height of page.
        `margH` - Margins horizontal (left and right).
        `margV` - Margin vertical (top und bottom).

  - ### Method Detail

    - #### getSimplePageMaster

          public SimplePageMaster getSimplePageMaster(int pageNumber)

      Gets the SimplePageMaster of given page number.
      Specified by:
        `getSimplePageMaster` in interface `PageMaster`
      Parameters:
        `pageNumber` - Page number.
      Returns:
        Simple page master of given page.

    - #### clone

          public java.lang.Object clone()
                                 throws java.lang.CloneNotSupportedException

      Description copied from interface: `NodeElement`
      Clones this element. Should return a deep copy!
      Specified by:
        `clone` in interface `NodeElement`
      Overrides:
        `clone` in class `FormattingObject`
      Returns:
        Clone.
      Throws:
        `java.lang.CloneNotSupportedException`

    - #### cloned

          public SimplePageMaster cloned()

    - #### getLayoutMasterSet

          public LayoutMasterSet getLayoutMasterSet()

    - #### getMargin

          public Margin getMargin()

      Gets the margin of this fo. Is never null.
      Overrides:
        `getMargin` in class `FormattingObject`
      Returns:
        Margin.

    - #### setMargin

          public void setMargin(Margin margin)

      Sets the margin of this fo.
      Overrides:
        `setMargin` in class `FormattingObject`
      Parameters:
        `margin` - Margin.

    - #### getMasterName

          public java.lang.String getMasterName()

      Description copied from interface: `PageMaster`
      Gets the master-name of this PageMaster.
      Specified by:
        `getMasterName` in interface `PageMaster`
      Returns:
        MasterName.

    - #### setWidth

          public void setWidth(Measure w)

    - #### setHeight

          public void setHeight(Measure h)

    - #### getPageWidth

          public Measure getPageWidth()

    - #### getPageHeight

          public Measure getPageHeight()

    - #### getRegionBefore

          public RegionBefore getRegionBefore()

    - #### getRegionAfter

          public RegionAfter getRegionAfter()

    - #### getRegionEnd

          public RegionEnd getRegionEnd()

    - #### getRegionStart

          public RegionStart getRegionStart()

    - #### getRegionBody

          public RegionBody getRegionBody()

    - #### removeRegionStart

          public void removeRegionStart()

    - #### removeRegionEnd

          public void removeRegionEnd()

    - #### removeRegionBefore

          public void removeRegionBefore()

    - #### removeRegionAfter

          public void removeRegionAfter()

    - #### setMasterName

          public void setMasterName(java.lang.String name)

      Description copied from interface: `PageMaster`
      Sets the master-name of this PageMaster.
      Specified by:
        `setMasterName` in interface `PageMaster`
      Parameters:
        `name` - MasterName.

    - #### setRegionAfter

          public void setRegionAfter(Measure height,
                            Measure space)

      Defines the region at bottom of body (footer).
      Parameters:
        `height` - Height of region-after.
        `space` - Space between body and region-after.

    - #### setRegionBefore

          public void setRegionBefore(Measure height,
                             Measure space)

      Defines the region at top of body (header).
      Parameters:
        `height` - Height of region-before.
        `space` - Space between body and region-before.

    - #### setRegionStart

          public void setRegionStart(Measure width,
                            Measure space)

      Defines the region left of body.
      Parameters:
        `width` - Width of region-start.
        `space` - Space between body and region-start.

    - #### setRegionEnd

          public void setRegionEnd(Measure width,
                          Measure space)

      Defines the region right of body.
      Parameters:
        `width` - Width of region-end.
        `space` - Space between body and region-end.

    - #### getBodyWidth

          public Measure getBodyWidth(int pageNumber)

      Description copied from interface: `PageMaster`
      Gets the width of the body defined (or referenced) by this PageMaster excluding Start- and EndRegion.
      Specified by:
        `getBodyWidth` in interface `PageMaster`
      Parameters:
        `pageNumber` - Number of page in PageSequence relative to point where is PageMaster is used.
      Returns:
        Width of body.

    - #### getBodyHeight

          public Measure getBodyHeight(int pageNumber)

      Description copied from interface: `PageMaster`
      Gets the height of the body defined (or referenced) by this PageMaster excluding Before- and AfterRegion.
      Specified by:
        `getBodyHeight` in interface `PageMaster`
      Parameters:
        `pageNumber` - Number of page in PageSequence relative to point where is PageMaster is used.
      Returns:
        Height of body.

    - #### setRegionTopSize

          public void setRegionTopSize(Measure topMargin,
                              Measure extend,
                              Measure bottomMargin)

    - #### getUsedSimplePageMasters

          public SimplePageMaster[] getUsedSimplePageMasters()

      Description copied from interface: `PageMaster`
      Gets an array of all used (referenced) simple page masters of this page master. If this page master is a simple page master then itself is returned.
      Specified by:
        `getUsedSimplePageMasters` in interface `PageMaster`
      Returns:
        SimplePageMaster[] Array of used simple page masters.

    - #### getWritingMode

          public Values.WritingMode getWritingMode()

      Gets the writing mode of this formatting object. If no writing mode is specified the default writing mode LR-TB is returned.
      Returns:
        Writing mode.

    - #### setWritingMode

          public void setWritingMode(Values.WritingMode mode)

      Sets the writing mode for this formatting object.
      Parameters:
        `mode` - Writing mode.

    - #### getElements

          public java.util.List getElements()

      Description copied from class: `AbstractNode`
      Gets childreen of this node. A child is typical an instance of `NodeElement` or `String`.
      Specified by:
        `getElements` in interface `Node`
      Specified by:
        `getElements` in class `AbstractNode`
      Returns:
        Childreen.

    - #### addUnsafe

          public boolean addUnsafe(java.lang.Object child)

      Description copied from class: `FormattingObject`
      Adds a NodeElement to this FormattingObject. You must ensure, that this FormattingObject can contain given element.
      Overrides:
        `addUnsafe` in class `FormattingObject`
      Parameters:
        `child` - Element.
      Returns:
        `false` if this FO is unable to add object.

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