Class CustomPageDefinition

    • Constructor Detail

      • CustomPageDefinition

        public CustomPageDefinition()
        Creates a new (initialy empty and therefore invalid) page definition.
    • Method Detail

      • addPageFormat

        public void addPageFormat​(PageFormat format,
                                  float x,
                                  float y)
        Adds a new page format to the page definition.
        format - the page format
        x - the x-position to where the imageable-x of the pageformat is mapped.
        y - the y-position to where the imageable-y of the pageformat is mapped.
      • getPageCount

        public int getPageCount()
        Returns the number of physical pages in the logical page definition.
        Specified by:
        getPageCount in interface PageDefinition
        the number of physical pages.
      • getPageFormat

        public PageFormat getPageFormat​(int pos)
        Returns the page format for the given page number. The page format contains local coordinates - that means that the point (0,0) denotes the upper left corner of this returned page format and not global coordinates.
        Specified by:
        getPageFormat in interface PageDefinition
        pos - the position of the pageformat within the page
        the given pageformat.
      • getPagePosition

        public Rectangle2D getPagePosition​(int index)
        Describes the internal position of the given page within the logical page. The logical page does not include any page margins, the printable area for a page starts at (0,0).
        Specified by:
        getPagePosition in interface PageDefinition
        index - the index of the page.
        the position of the page (within the global page).
      • getWidth

        public float getWidth()
        Returns the total width of the page definition.
        Specified by:
        getWidth in interface PageDefinition
        the total width of the page definition.
      • getHeight

        public float getHeight()
        Returns the total height of the page definition.
        Specified by:
        getHeight in interface PageDefinition
        the total height of the page definition.
      • equals

        public boolean equals​(Object obj)
        Checks whether the given object is equal to this one.
        equals in class Object
        obj - the other object.
        true, if the other object is equal, false otherwise.
      • hashCode

        public int hashCode()
        Computes the hashcode of this page definition.
        hashCode in class Object
        the hashcode.