// javadoc inherited
public void render(final FormatRendererContext context, final FormatInstance instance)
throws RendererException {
try {
if (!instance.isEmpty()) {
Segment segment = (Segment)instance.getFormat();
SegmentInstance segmentInstance = (SegmentInstance) instance;
SegmentAttributes attributes = segmentInstance.getAttributes();
if (logger.isDebugEnabled()) {
logger.debug("Segment.writeOutput() for "
+ attributes.getName());
}
String value;
int ivalue;
value = (String) segment.getAttribute(
FormatConstants.BORDER_COLOUR_ATTRIBUTE);
attributes.setBorderColor(value);
value = (String) segment.getAttribute(
FormatConstants.FRAME_BORDER_ATTRIBUTE);
attributes.setFrameBorder("true".equalsIgnoreCase(value));
value =
(String)segment.getAttribute(FormatConstants.RESIZE_ATTRIBUTE);
attributes.setResize("true".equalsIgnoreCase(value));
value = (String) segment.getAttribute(
FormatConstants.SCROLLING_ATTRIBUTE);
if (value == null ||
value.equals(FormatConstants.SCROLLING_VALUE_AUTOMATIC)) {
attributes.setScrolling(
SegmentAttributes.SCROLLING_AUTOMATIC);
} else if (value.equals(FormatConstants.SCROLLING_VALUE_NO)) {
attributes.setScrolling(SegmentAttributes.SCROLLING_NO);
} else if (value.equals(FormatConstants.SCROLLING_VALUE_YES)) {
attributes.setScrolling(SegmentAttributes.SCROLLING_YES);
} else {
if (logger.isDebugEnabled()) {
logger.debug("Unknown scrolling type of " + value);
}
}
value = (String) segment.getAttribute(
FormatConstants.MARGIN_HEIGHT_ATTRIBUTE);
try {
ivalue = Integer.parseInt(value);
} catch (NumberFormatException nfe) {
ivalue = 0;
}
attributes.setMarginHeight(ivalue);
value = (String) segment.getAttribute(
FormatConstants.MARGIN_WIDTH_ATTRIBUTE);
try {
ivalue = Integer.parseInt(value);
} catch (NumberFormatException nfe) {
ivalue = 0;