if (text instanceof String)
lines = ((String)text).split("\n"); //$NON-NLS-1$
else if (text instanceof String[])
lines = (String[])text;
else
throw new PrinterException(Messages.getString("TablePrinter.38")); //$NON-NLS-1$
for(int i = 0; i < lines.length; i++) {
lines[i] = MessageFormat.format(lines[i],objs);
}
}
TextBox tb = new TextBox(lines,
getTextRectangle(graphics,lines,font),
font,
(Color)options.get(HEADER_COLOUR),
((Boolean)options.get(CENTER_HEADER)).booleanValue());
setOption(HEADER_TEXTBOX,tb);
}
// do the page footer
// fetch the formatted footer text, if any
if ((text = options.get(PAGE_FOOTER))!= null) {
// get any specified font
Font font = (Font)options.get(PAGEFOOTER_FONT);
String[] lines = new String[1];
if (text instanceof MessageFormat) {
lines[0] = ((MessageFormat)text).format(objs);
} else {
if (text instanceof String)
lines = ((String)text).split("\n"); //$NON-NLS-1$
else if (text instanceof String[])
lines = (String[])text;
else
throw new PrinterException(Messages.getString("TablePrinter.40")); //$NON-NLS-1$
for(int i = 0; i < lines.length; i++) {
lines[i] = MessageFormat.format(lines[i],objs);
}
}
TextBox tb = new TextBox(lines,
getTextRectangle(graphics,lines,font),
font,
(Color)options.get(PAGEFOOTER_COLOUR),
((Boolean)options.get(CENTER_PAGEFOOTER)).booleanValue());
setOption(PAGEFOOTER_TEXTBOX,tb);
}
// do the table footer
if ((text = options.get(TABLE_FOOTER)) != null) {
// get any specified font
Font font = (Font)options.get(TABLEFOOTER_FONT);
String[] lines = new String[1];
if (text instanceof String)
lines = ((String)text).split("\n"); //$NON-NLS-1$
else if (text instanceof String[])
lines = (String[])text;
else if (text instanceof MessageFormat) {
lines[0] = ((MessageFormat)text).format(objs);
}
else
throw new PrinterException(Messages.getString("TablePrinter.42")); //$NON-NLS-1$
for(int i = 0; i < lines.length; i++) {
lines[i] = MessageFormat.format(lines[i],objs);
}