lt.monarch.print
Interface HeaderFooterRenderer


public interface HeaderFooterRenderer

Implementation of this interface can be used together with ChartPrintable to render headers and footers on each printed page. ChartPrintable#setHeaderFooterRenderer(HeaderFooterRenderer) method respectively can be used to assign the header/footer renderer to printable.


Method Summary
Modifier and Type Method and Description
 int getPreferredFooterHeight(AbstractGraphics g, int imageableWidth)
          Returns preferred height of footer, in 1/72nds of an inch (corresponds to 1 pixel on screen).
 int getPreferredHeaderHeight(AbstractGraphics g, int imageableWidth)
          Returns preferred height of header, in 1/72nds of an inch (corresponds to 1 pixel on screen).
 void renderFooter(AbstractGraphics g, int pageIndex, java.awt.Rectangle bounds)
          Renders footer for given page.
 void renderHeader(AbstractGraphics g, int pageIndex, java.awt.Rectangle bounds)
          Renders header for given page.
 

Method Detail

getPreferredHeaderHeight

int getPreferredHeaderHeight(AbstractGraphics g,
                             int imageableWidth)
Returns preferred height of header, in 1/72nds of an inch (corresponds to 1 pixel on screen). Height of header is the same for each page of printout. Zero or negative number can be returned to indicate absence of header.

Parameters:
g - graphics context.
imageableWidth - the width, in 1/72nds of an inch (corresponds to 1 pixel on screen), of the imageable area of the page.
Returns:
preferred height of header.

getPreferredFooterHeight

int getPreferredFooterHeight(AbstractGraphics g,
                             int imageableWidth)
Returns preferred height of footer, in 1/72nds of an inch (corresponds to 1 pixel on screen). Height of footer is the same for each page of printout. Zero or negative number can be returned to indicate absence of footer.

Parameters:
g - graphics context.
imageableWidth - the width, in 1/72nds of an inch (corresponds to 1 pixel on screen), of the imageable area of the page.
Returns:
preferred height of footer.

renderHeader

void renderHeader(AbstractGraphics g,
                  int pageIndex,
                  java.awt.Rectangle bounds)
Renders header for given page.

Parameters:
g - graphics context.
pageIndex - index of page (starts from 0).
bounds - rectangle into which header should be rendered.

renderFooter

void renderFooter(AbstractGraphics g,
                  int pageIndex,
                  java.awt.Rectangle bounds)
Renders footer for given page.

Parameters:
g - graphics context.
pageIndex - index of page (starts from 0).
bounds - rectangle into which footer should be rendered.