Oracle™ Business Intelligence Beans Java API Reference
Release 10
g (9.0.4)
Part number B12159_01


oracle.dss.dataView
Class HeaderAndFooterPainter

java.lang.Object
  |
  +--oracle.dss.dataView.HeaderAndFooterPainter

public class HeaderAndFooterPainter
extends java.lang.Object

A painter for headers and footers in printed views. A header or footer can display strings, a page number, or a date.

The ViewPrinter maintains six HeaderAndFooterPainter objects. It maintains HeaderAndFooterPainter objects for left, center, and right headers, and for left, center, and right footers. Headers appear at the top of the page, and footers appear at the bottom.

See Also:
ViewPrinter

Field Summary
static int DATE
          ContentType: This header or footer displays the current date.
static int NONE
          ContentType: This header or footer displays no information.
static int PAGE_NUMBER
          ContentType: This header or footer displays the physical page number.
static int STRINGS
          ContentType: This header or footer displays an array of strings.

 

Constructor Summary
HeaderAndFooterPainter(boolean header, java.awt.Font font, java.lang.String string, boolean showString, boolean showDate, boolean showPageNum)
          Deprecated. As of 1.6.0.9, replaced by HeaderAndFooterPainter(Dataview, int, Font, Object[], int)
HeaderAndFooterPainter(Dataview view, int headerOrFooterID, java.awt.Font font, java.lang.Object[] content, int contentType)
          Constructor.

 

Method Summary
 int getContentType()
          Retrieves the kind of information that this header or footer displays.
 java.awt.Font getFont()
          Retrieves the Font that specifies formatting for this header or footer.
 int getHorizontalAlignment()
          Retrieves the horizontal alignment of this header or footer.
 int getMaximumHeight()
          Retrieves the maximum height of the area for this header or footer.
 java.lang.String getString()
          Deprecated. As of 1.6.0.9, replaced by getStrings()
 java.lang.String[] getStrings()
          Retrieves the array of strings that are displayed in this header or footer.
 TokenSubstitution getTokenSubstitution()
          Retrieves the handler for token substitution in this header or footer.
 boolean isShowDate()
          Deprecated. As of 1.6.0.9, replaced by getContentType()
 boolean isShowPageNumber()
          Deprecated. As of 1.6.0.9, replaced by getContentType()
 boolean isShowString()
          Deprecated. As of 1.6.0.9, replaced by getContentType()
 void paint(java.awt.Graphics g, int x, int y, int width, int height)
          Deprecated. As of 1.6.0.9, replaced by paint(Graphics, int, int, int, int, CustomHeaderAndFooterCallback, int, int[])
 void paint(java.awt.Graphics g, int x, int y, int width, int height, CustomHeaderAndFooterCallback callback, int physPageNum, int[] hPos)
          Paints the header or footer.
 void setContentType(int contentType)
          Specifies the kind of information that this header or footer displays.
 void setFont(java.awt.Font font)
          Specifies the Font that specifies formatting for this header or footer.
 void setHorizontalAlignment(int hAlignment)
          Specifies the horizontal alignment of this header or footer.
 void setShowDate(boolean showDate)
          Deprecated. As of 1.6.0.9, replaced by setContentType(int)
 void setShowPageNumber(boolean showPageNum)
          Deprecated. As of 1.6.0.9, replaced by setContentType(int)
 void setShowString(boolean showString)
          Deprecated. As of 1.6.0.9, replaced by setContentType(int)
 void setString(java.lang.String str)
          Deprecated. As of 1.6.0.9, replaced by setStrings(String[])
 void setStrings(java.lang.String[] str)
          Specifies the array of strings to display in this header or footer.
 void setTokenSubstitution(TokenSubstitution token)
          Specifies a handler for token substitution in this header or footer.

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

NONE

public static final int NONE
ContentType: This header or footer displays no information.

DATE

public static final int DATE
ContentType: This header or footer displays the current date.

PAGE_NUMBER

public static final int PAGE_NUMBER
ContentType: This header or footer displays the physical page number.

STRINGS

public static final int STRINGS
ContentType: This header or footer displays an array of strings. Call setStrings to specify the strings that are displayed.
See Also:
setStrings(java.lang.String[])
Constructor Detail

HeaderAndFooterPainter

public HeaderAndFooterPainter(Dataview view,
                              int headerOrFooterID,
                              java.awt.Font font,
                              java.lang.Object[] content,
                              int contentType)
Constructor. The ViewPrinter automatically constructs this object six times, for each of the three regions in headers and footers. These painters are constructed with null for font and content. For all headers and the center footer, the contentType is STRINGS. For the left footer, the contentType is DATE. For the right footer, the contentType is PAGE_NUMBER.
Parameters:
view - The DataView that this HeaderAndFooterPainter belongs with.
headerOrFooterID - A constant that represents the location of the header or footer, and whether it is a header or footer. The constants are defined in the ViewPrinter class, and they begin with HEADER_ or FOOTER_.
font - The font for the header or footer.
content - The string or strings that will appear in the header or footer painter, when contentType is STRINGS.
contentType - A constant that represents whether content is an array of strings, the date, or the page number. Valid values are NONE, STRINGS, PAGE_NUMBER, and DATE.
See Also:
NONE, STRINGS, PAGE_NUMBER, DATE, ViewPrinter.HEADER_LEFT, ViewPrinter.HEADER_CENTER, ViewPrinter.HEADER_RIGHT, ViewPrinter.FOOTER_LEFT, ViewPrinter.FOOTER_CENTER, ViewPrinter.FOOTER_RIGHT

HeaderAndFooterPainter

public HeaderAndFooterPainter(boolean header,
                              java.awt.Font font,
                              java.lang.String string,
                              boolean showString,
                              boolean showDate,
                              boolean showPageNum)
Deprecated. As of 1.6.0.9, replaced by HeaderAndFooterPainter(Dataview, int, Font, Object[], int)
Headers and footers have been enhanced to provide more flexibility. The structure has changed.
Method Detail

setString

public void setString(java.lang.String str)
Deprecated. As of 1.6.0.9, replaced by setStrings(String[])
Headers and footers can now display more than one string.

getString

public java.lang.String getString()
Deprecated. As of 1.6.0.9, replaced by getStrings()
Headers and footers can now display more than one string.

setShowString

public void setShowString(boolean showString)
Deprecated. As of 1.6.0.9, replaced by setContentType(int)
The mechanism has changed for specifying whether the header or footer displays strings, dates, or page numbers. To specify a string to display, call setContentType, passing STRING. Then, call setStrings, passing the array of strings that you want to display.

isShowString

public boolean isShowString()
Deprecated. As of 1.6.0.9, replaced by getContentType()
The mechanism has changed for specifying whether the header or footer displays strings, dates, or page numbers. Where this method would return true if the header or footer displays a string, getContentType returns STRINGS.

setShowDate

public void setShowDate(boolean showDate)
Deprecated. As of 1.6.0.9, replaced by setContentType(int)
The mechanism has changed for specifying whether the header or footer displays strings, dates, or page numbers. To display the current date in a header or footer, call setContentType, passing DATE.

isShowDate

public boolean isShowDate()
Deprecated. As of 1.6.0.9, replaced by getContentType()
The mechanism has changed for specifying whether the header or footer displays strings, dates, or page numbers. Where this method would return true if the current header or footer displayed the date, getContentType returns DATE.

setShowPageNumber

public void setShowPageNumber(boolean showPageNum)
Deprecated. As of 1.6.0.9, replaced by setContentType(int)
The mechanism has changed for specifying whether the header or footer displays strings, dates, or page numbers. To show the current date in a header or footer, call setContentType, passing DATE.

isShowPageNumber

public boolean isShowPageNumber()
Deprecated. As of 1.6.0.9, replaced by getContentType()
The mechanism has changed for specifying whether the header or footer displays strings, dates, or page numbers. Where this method would return true if the header or footer displayed a page number, the getContentType method returns PAGE_NUMBER.

setStrings

public void setStrings(java.lang.String[] str)
Specifies the array of strings to display in this header or footer. The strings appear only when ContentType is set to STRINGS. The strings can contain keys that the TokenSubstitution will parse.
Parameters:
str - The array of strings to display.
See Also:
setContentType(int), TokenSubstitution

getStrings

public java.lang.String[] getStrings()
Retrieves the array of strings that are displayed in this header or footer. The strings appear only when the getContentType method returns STRINGS. The strings can contain keys that the TokenSubstitution will parse.
Returns:
The array of strings that are displayed in this header or footer.
See Also:
setContentType(int), TokenSubstitution

setContentType

public void setContentType(int contentType)
Specifies the kind of information that this header or footer displays.
Parameters:
contentType - A constant that represents the kind of information to display.
See Also:
NONE, STRINGS, PAGE_NUMBER, DATE

getContentType

public int getContentType()
Retrieves the kind of information that this header or footer displays.
Returns:
A constant that represents the kind of information in this header or footer.
See Also:
NONE, STRINGS, PAGE_NUMBER, DATE

setHorizontalAlignment

public void setHorizontalAlignment(int hAlignment)
Specifies the horizontal alignment of this header or footer.
Parameters:
hAlignment - A swing constant that represents the horizontal alignment for this header or footer.
See Also:
SwingConstants.LEFT, SwingConstants.CENTER, SwingConstants.RIGHT

getHorizontalAlignment

public int getHorizontalAlignment()
Retrieves the horizontal alignment of this header or footer.
Returns:
A swing constant that represents the horozontal alignment for this header or footer.
See Also:
SwingConstants.LEFT, SwingConstants.CENTER, SwingConstants.RIGHT

setFont

public void setFont(java.awt.Font font)
Specifies the Font that specifies formatting for this header or footer.
Parameters:
font - The Font for this header or footer.

getFont

public java.awt.Font getFont()
Retrieves the Font that specifies formatting for this header or footer.
Returns:
The Font for this header or footer.

getMaximumHeight

public int getMaximumHeight()
Retrieves the maximum height of the area for this header or footer.
Returns:
The maximum height of the area for this header or footer, in pixels.

paint

public void paint(java.awt.Graphics g,
                  int x,
                  int y,
                  int width,
                  int height)
Deprecated. As of 1.6.0.9, replaced by paint(Graphics, int, int, int, int, CustomHeaderAndFooterCallback, int, int[])
The replacement paint method supports the CustomHeaderAndFooterCallback, which allows you to display different headers and footers on different pages of a print job.

Application code should not have any calls to either paint method, because the ViewPrinter calls paint.


paint

public void paint(java.awt.Graphics g,
                  int x,
                  int y,
                  int width,
                  int height,
CustomHeaderAndFooterCallback callback,
                  int physPageNum,
                  int[] hPos)
Paints the header or footer. The ViewPrinter calls this method. Application developers should not need to call it.
Parameters:
g - The graphics object to which the header or footer should be painted.
x - The starting x position, in the graphics object, where the painting should begin.
y - The starting y position, in the graphics object, where the painting should begin.
width - The width available for header or footer, in pixels.
height - The height available for header or footer, in pixels.
callback - An implementation of the CustomHeaderAndFooterCallback interface, which has been registered with the ViewPrinter by calling ViewPrinter.setCustomHeaderAndFooterCallback.
physNum - The current physical page.
hPos - The current logical page.
See Also:
ViewPrinter.setCustomHeaderAndFooterCallback(oracle.dss.dataView.CustomHeaderAndFooterCallback), ViewPrinter.setHeadersAndFootersUsingCallback(int)

setTokenSubstitution

public void setTokenSubstitution(TokenSubstitution token)
Specifies a handler for token substitution in this header or footer. Token substitution handlers make it possible for users to insert tokens (such as a token for the current dimension member) in the headers and footers of a printed view. The default TokenSubstitution on this header or footer is null; To support token substitution, you must call this method to specify a TokenSubstitution.
Parameters:
token - The token substitution handler for this header or footer.

getTokenSubstitution

public TokenSubstitution getTokenSubstitution()
Retrieves the handler for token substitution in this header or footer. Token substitution handlers make it possible for users to insert tokens (such as a token for the current dimension member) in the headers and footers of a printed view. The default TokenSubstitution on this header or footer is null; to support token substitution, you must set a TokenSubstitution by calling setTokenSubstitution.
Returns:
The token substitution handler for this header or footer. By default, this is null.
See Also:
TokenSubstitution

Oracle™ Business Intelligence Beans Java API Reference
Release 10
g (9.0.4)
Part number B12159_01


Copyright © 2003, Oracle. All Rights Reserved.