1 28 package net.sf.jasperreports.engine.fill; 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.JRException; 35 import net.sf.jasperreports.engine.JRExpressionCollector; 36 import net.sf.jasperreports.engine.JRLine; 37 import net.sf.jasperreports.engine.JRPrintElement; 38 import net.sf.jasperreports.engine.JRPrintLine; 39 import net.sf.jasperreports.engine.JRStyle; 40 import net.sf.jasperreports.engine.xml.JRXmlWriter; 41 42 43 47 public class JRFillLine extends JRFillGraphicElement implements JRLine 48 { 49 50 51 54 protected JRFillLine( 55 JRBaseFiller filler, 56 JRLine line, 57 JRFillObjectFactory factory 58 ) 59 { 60 super(filler, line, factory); 61 } 62 63 64 protected JRFillLine(JRFillLine line, JRFillCloneFactory factory) 65 { 66 super(line, factory); 67 } 68 69 70 73 public byte getDirection() 74 { 75 return ((JRLine)this.parent).getDirection(); 76 } 77 78 81 public void setDirection(byte direction) 82 { 83 } 84 85 88 protected JRTemplateLine getJRTemplateLine() 89 { 90 JRStyle style = getStyle(); 91 JRTemplateLine template = (JRTemplateLine) getTemplate(style); 92 if (template == null) 93 { 94 template = new JRTemplateLine(filler.getJasperPrint().getDefaultStyleProvider(), this); 95 registerTemplate(style, template); 96 } 97 return template; 98 } 99 100 101 104 protected void evaluate( 105 byte evaluation 106 ) throws JRException 107 { 108 this.reset(); 109 110 this.evaluatePrintWhenExpression(evaluation); 111 112 setValueRepeating(true); 113 } 114 115 116 119 protected JRPrintElement fill() 120 { 121 JRPrintLine printLine = null; 122 123 printLine = new JRTemplatePrintLine(this.getJRTemplateLine()); 124 printLine.setX(this.getX()); 125 printLine.setY(this.getRelativeY()); 126 printLine.setWidth(getWidth()); 127 printLine.setHeight(this.getStretchHeight()); 128 129 return printLine; 130 } 131 132 133 136 public JRChild getCopy(JRAbstractObjectFactory factory) 137 { 138 return factory.getLine(this); 139 } 140 141 144 public void collectExpressions(JRExpressionCollector collector) 145 { 146 collector.collect(this); 147 } 148 149 152 public void writeXml(JRXmlWriter xmlWriter) throws IOException 153 { 154 xmlWriter.writeLine(this); 155 } 156 157 160 protected void resolveElement (JRPrintElement element, byte evaluation) 161 { 162 } 164 165 166 public JRCloneable createClone(JRFillCloneFactory factory) 167 { 168 return new JRFillLine(this, factory); 169 } 170 171 } 172 | Popular Tags |