private void setPaneAttributes(Pane pane,
Element element,
MCSAttributes attributes) {
final String destinationArea = pane.getDestinationArea();
Styles styles = attributes.getStyles();
PropertyValues propertyValues = styles.getPropertyValues();
// Handle dimensions first
// Themes don't override pane widths and heights
String width = calculatePaneWidth(pane, propertyValues, element);
String height = calculatePaneHeight(pane, propertyValues, element);
String borderWidth = convertToCharCount(propertyValues.getComputedValue(
StylePropertyDetails.BORDER_TOP_WIDTH));
element.setAttribute(VDXMLConstants.WIDTH_ATTRIBUTE, width);
element.setAttribute(VDXMLConstants.HEIGHT_ATTRIBUTE, height);
if (destinationArea != null) {
element.setAttribute(
VDXMLConstants.PSEUDO_DESTINATION_AREA_ATTRIBUTE,
destinationArea);
if ((NAVIGATION_DESTINATION.equals(destinationArea)) &&
(helpZonePane != null)) {
element.setAttribute(
VDXMLConstants.PSEUDO_HAS_HELP_ZONE_ATTRIBUTE,
"true");
}
}
if (borderWidth != null) {
element.setAttribute(VDXMLConstants.PSEUDO_BORDER_ATTRIBUTE,
borderWidth);
addColourAttribute(
element, propertyValues.getComputedValue(
StylePropertyDetails.BORDER_TOP_COLOR),
getFormatName(pane, attributes),
VDXMLConstants.PSEUDO_BORDER_COLOUR_ATTRIBUTE);
}
// The help zone "pane" doesn't want any further style attributes and
// doesn't define a "display context" (so don't store the style
// properties)
if (pane != helpZonePane) {
addColourAttribute(element,propertyValues.getComputedValue(
StylePropertyDetails.COLOR),
getFormatName(pane, attributes),
VDXMLConstants.TEXT_COLOUR_ATTRIBUTE);
addGridAttributes(element, attributes, pane);