1 16 17 package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements; 18 19 import org.apache.cocoon.components.elementprocessor.types.NumericConverter; 20 import org.apache.cocoon.components.elementprocessor.types.NumericResult; 21 22 import java.io.IOException ; 23 24 32 public class EP_Right extends BaseElementProcessor { 33 private static final String _points_attribute = "Points"; 34 private static final String _pref_unit_attribute = "PrefUnit"; 35 private NumericResult _points; 36 private NumericResult _pref_unit; 37 38 41 public EP_Right() { 42 super(null); 43 _points = null; 44 _pref_unit = null; 45 } 46 47 52 53 double getPoints() throws IOException { 54 if (_points == null) { 55 _points = NumericConverter.extractDouble(getValue(_points_attribute)); 56 } 57 return _points.doubleValue(); 58 } 59 60 65 66 int getPrefUnit() throws IOException { 67 if (_pref_unit == null) { 68 _pref_unit = PrintUnits.extractPrintUnits(getValue(_pref_unit_attribute)); 69 } 70 return _pref_unit.intValue(); 71 } 72 73 77 public void endProcessing() throws IOException { 78 this.getSheet().setRightMargin(getPoints()); 79 } 80 } | Popular Tags |