* @see Sheet#BottomMargin
* @see Sheet#HeaderMargin
* @see Sheet#FooterMargin
*/
public void setMargin(short margin, double size) {
CTPageMargins pageMargins = worksheet.isSetPageMargins() ?
worksheet.getPageMargins() : worksheet.addNewPageMargins();
switch (margin) {
case LeftMargin:
pageMargins.setLeft(size);
break;
case RightMargin:
pageMargins.setRight(size);
break;
case TopMargin:
pageMargins.setTop(size);
break;
case BottomMargin:
pageMargins.setBottom(size);
break;
case HeaderMargin:
pageMargins.setHeader(size);
break;
case FooterMargin:
pageMargins.setFooter(size);
break;
default :
throw new IllegalArgumentException( "Unknown margin constant: " + margin );
}
}