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_Left 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 42 public EP_Left() { 43 super(null); 44 _points = null; 45 _pref_unit = null; 46 } 47 48 53 54 double getPoints() throws IOException { 55 if (_points == null) { 56 _points = NumericConverter.extractDouble(getValue(_points_attribute)); 57 } 58 return _points.doubleValue(); 59 } 60 61 66 67 int getPrefUnit() throws IOException { 68 if (_pref_unit == null) { 69 _pref_unit = PrintUnits.extractPrintUnits(getValue(_pref_unit_attribute)); 70 } 71 return _pref_unit.intValue(); 72 } 73 74 78 public void endProcessing() throws IOException { 79 this.getSheet().setLeftMargin(getPoints()); 80 } 81 } | Popular Tags |