* Sets the size of the margin in inches.
* @param margin which margin to get
* @param size the size of the margin
*/
public void setMargin(short margin, double size) {
Margin m = getMarginRec(margin);
if (m == null) {
switch (margin) {
case Sheet.LeftMargin:
_leftMargin = new LeftMarginRecord();
m = _leftMargin;
break;
case Sheet.RightMargin:
_rightMargin = new RightMarginRecord();
m = _rightMargin;
break;
case Sheet.TopMargin:
_topMargin = new TopMarginRecord();
m = _topMargin;
break;
case Sheet.BottomMargin:
_bottomMargin = new BottomMarginRecord();
m = _bottomMargin;
break;
default :
throw new IllegalArgumentException( "Unknown margin constant: " + margin );
}
}
m.setMargin( size );
}