1 28 package net.sf.jasperreports.engine.base; 29 30 import java.io.IOException ; 31 32 import net.sf.jasperreports.engine.JRAbstractObjectFactory; 33 import net.sf.jasperreports.engine.JRChild; 34 import net.sf.jasperreports.engine.JRConstants; 35 import net.sf.jasperreports.engine.JRExpressionCollector; 36 import net.sf.jasperreports.engine.JRLine; 37 import net.sf.jasperreports.engine.xml.JRXmlWriter; 38 39 40 45 public class JRBaseLine extends JRBaseGraphicElement implements JRLine 46 { 47 48 49 52 private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; 53 54 57 protected byte direction = DIRECTION_TOP_DOWN; 58 59 60 68 protected JRBaseLine(JRLine line, JRBaseObjectFactory factory) 69 { 70 super(line, factory); 71 72 direction = line.getDirection(); 73 } 74 75 76 79 public void setWidth(int width) 80 { 81 if (width == 0) 82 { 83 width = 1; 84 } 85 86 super.setWidth(width); 87 } 88 89 92 public byte getDirection() 93 { 94 return direction; 95 } 96 97 100 public void setDirection(byte direction) 101 { 102 this.direction = direction; 103 } 104 105 108 public JRChild getCopy(JRAbstractObjectFactory factory) 109 { 110 return factory.getLine(this); 111 } 112 113 116 public void collectExpressions(JRExpressionCollector collector) 117 { 118 collector.collect(this); 119 } 120 121 124 public void writeXml(JRXmlWriter xmlWriter) throws IOException 125 { 126 xmlWriter.writeLine(this); 127 } 128 129 130 } 131 | Popular Tags |