1 16 package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements; 17 18 import org.apache.cocoon.components.elementprocessor.types.Attribute; 19 import org.apache.cocoon.components.elementprocessor.ElementProcessor; 20 import org.apache.cocoon.components.elementprocessor.types.NumericConverter; 21 import org.apache.cocoon.components.elementprocessor.types.NumericResult; 22 23 import java.io.IOException ; 24 25 34 public class EPRows extends BaseElementProcessor { 35 private NumericResult _default_size_pts; 36 private static final String _default_size_pts_attribute = "DefaultSizePts"; 37 38 static final String DEFAULT_SIZE_PTS = "12.8"; 40 41 44 public EPRows() { 45 super(null); 46 _default_size_pts = null; 47 } 48 49 54 public double getDefaultSizePts() throws IOException { 55 if (_default_size_pts == null) { 56 String value = getValue(_default_size_pts_attribute); 57 58 if (value == null || value.trim().equals("")) { 59 value = DEFAULT_SIZE_PTS; 60 } 61 _default_size_pts = NumericConverter.extractDouble(value); 62 } 63 return _default_size_pts.doubleValue(); 64 } 65 66 73 public void initialize(final Attribute[] attributes, 74 final ElementProcessor parent) throws IOException { 75 super.initialize(attributes, parent); 76 getSheet().setDefaultRowHeight(getDefaultSizePts()); 77 } 78 } | Popular Tags |