1 28 package net.sf.jasperreports.engine.fill; 29 30 import net.sf.jasperreports.engine.JRException; 31 import net.sf.jasperreports.engine.JRGraphicElement; 32 import net.sf.jasperreports.engine.util.JRStyleResolver; 33 34 35 39 public abstract class JRFillGraphicElement extends JRFillElement implements JRGraphicElement 40 { 41 42 43 46 protected JRFillGraphicElement( 47 JRBaseFiller filler, 48 JRGraphicElement graphicElement, 49 JRFillObjectFactory factory 50 ) 51 { 52 super(filler, graphicElement, factory); 53 } 54 55 56 protected JRFillGraphicElement( 57 JRFillGraphicElement graphicElement, 58 JRFillCloneFactory factory 59 ) 60 { 61 super(graphicElement, factory); 62 } 63 64 65 68 public byte getPen() 69 { 70 return JRStyleResolver.getPen(this, PEN_1_POINT); 71 } 72 73 76 public Byte getOwnPen() 77 { 78 return ((JRGraphicElement)this.parent).getOwnPen(); 79 } 80 81 84 public void setPen(byte pen) 85 { 86 } 87 88 91 public void setPen(Byte pen) 92 { 93 } 94 95 98 public byte getFill() 99 { 100 return JRStyleResolver.getFill(this, FILL_SOLID); 101 } 102 103 106 public Byte getOwnFill() 107 { 108 return ((JRGraphicElement)this.parent).getOwnFill(); 109 } 110 111 114 public void setFill(byte fill) 115 { 116 } 117 118 121 public void setFill(Byte fill) 122 { 123 } 124 125 126 129 public void rewind() 130 { 131 } 132 133 134 137 protected boolean prepare( 138 int availableStretchHeight, 139 boolean isOverflow 140 ) throws JRException 141 { 142 boolean willOverflow = false; 143 144 super.prepare(availableStretchHeight, isOverflow); 145 146 if (!this.isToPrint()) 147 { 148 return willOverflow; 149 } 150 151 boolean isToPrint = true; 152 boolean isReprinted = false; 153 154 if (isOverflow && this.isAlreadyPrinted() && !this.isPrintWhenDetailOverflows()) 155 { 156 isToPrint = false; 157 } 158 159 if ( 160 isToPrint && 161 this.isPrintWhenExpressionNull() && 162 !this.isPrintRepeatedValues() 163 ) 164 { 165 if ( 166 ( !this.isPrintInFirstWholeBand() || !this.getBand().isFirstWholeOnPageColumn() ) && 167 ( this.getPrintWhenGroupChanges() == null || !this.getBand().isNewGroup(this.getPrintWhenGroupChanges()) ) && 168 ( !isOverflow || !this.isPrintWhenDetailOverflows() ) 169 ) 170 { 171 isToPrint = false; 172 } 173 } 174 175 if ( 176 isToPrint && 177 availableStretchHeight < this.getRelativeY() - this.getY() - this.getBandBottomY() 178 ) 179 { 180 isToPrint = false; 181 willOverflow = true; 182 } 183 184 if ( 185 isToPrint && 186 isOverflow && 187 (this.isPrintWhenDetailOverflows() && (this.isAlreadyPrinted() || (!this.isAlreadyPrinted() && !this.isPrintRepeatedValues()))) 189 ) 190 { 191 isReprinted = true; 192 } 193 194 this.setToPrint(isToPrint); 195 this.setReprinted(isReprinted); 196 197 return willOverflow; 198 } 199 200 201 } 202 | Popular Tags |