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_Top 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_Top() { 42 super(null); 43 _points = null; 44 _pref_unit = null; 45 } 46 47 52 double getPoints() throws IOException { 53 if (_points == null) { 54 _points = NumericConverter.extractDouble(getValue(_points_attribute)); 55 } 56 return _points.doubleValue(); 57 } 58 59 64 65 int getPrefUnit() throws IOException { 66 if (_pref_unit == null) { 67 _pref_unit = PrintUnits.extractPrintUnits(getValue(_pref_unit_attribute)); 68 } 69 return _pref_unit.intValue(); 70 } 71 72 76 public void endProcessing() throws IOException { 77 this.getSheet().setTopMargin(getPoints()); 78 } 79 } | Popular Tags |