1 28 package net.sf.jasperreports.engine.base; 29 30 import java.awt.Color ; 31 import java.io.Serializable ; 32 33 import net.sf.jasperreports.engine.JRConstants; 34 import net.sf.jasperreports.engine.JRDefaultStyleProvider; 35 import net.sf.jasperreports.engine.JRElement; 36 import net.sf.jasperreports.engine.JRPrintElement; 37 import net.sf.jasperreports.engine.JRStyle; 38 import net.sf.jasperreports.engine.util.JRStyleResolver; 39 40 41 45 public class JRBasePrintElement implements JRPrintElement, Serializable 46 { 47 48 49 52 private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; 53 54 protected String key; 55 56 59 protected Byte mode = null; 60 protected int x = 0; 61 protected int y = 0; 62 protected int width = 0; 63 protected int height = 0; 64 protected Color forecolor = null; 65 protected Color backcolor = null; 66 67 protected JRDefaultStyleProvider defaultStyleProvider; 68 protected JRStyle style = null; 69 70 71 74 public JRBasePrintElement(JRDefaultStyleProvider defaultStyleProvider) 75 { 76 this.defaultStyleProvider = defaultStyleProvider; 77 } 78 79 80 83 public JRDefaultStyleProvider getDefaultStyleProvider() 84 { 85 return defaultStyleProvider; 86 } 87 88 91 public JRStyle getStyle() 92 { 93 return style; 94 } 95 96 99 public void setStyle(JRStyle style) 100 { 101 this.style = style; 102 } 103 104 107 public byte getMode() 108 { 109 return JRStyleResolver.getMode(this, JRElement.MODE_OPAQUE); 110 } 111 112 115 public Byte getOwnMode() 116 { 117 return mode; 118 } 119 120 123 public void setMode(byte mode) 124 { 125 this.mode = new Byte (mode); 126 } 127 128 131 public void setMode(Byte mode) 132 { 133 this.mode = mode; 134 } 135 136 139 public int getX() 140 { 141 return this.x; 142 } 143 144 147 public void setX(int x) 148 { 149 this.x = x; 150 } 151 152 155 public int getY() 156 { 157 return this.y; 158 } 159 160 163 public void setY(int y) 164 { 165 this.y = y; 166 } 167 168 171 public int getWidth() 172 { 173 return this.width; 174 } 175 176 179 public void setWidth(int width) 180 { 181 this.width = width; 182 } 183 184 187 public int getHeight() 188 { 189 return this.height; 190 } 191 192 195 public void setHeight(int height) 196 { 197 this.height = height; 198 } 199 200 203 public Color getForecolor() 204 { 205 return JRStyleResolver.getForecolor(this); 206 } 207 208 211 public Color getOwnForecolor() 212 { 213 return forecolor; 214 } 215 216 219 public void setForecolor(Color forecolor) 220 { 221 this.forecolor = forecolor; 222 } 223 224 227 public Color getBackcolor() 228 { 229 return JRStyleResolver.getBackcolor(this); 230 } 231 232 235 public Color getOwnBackcolor() 236 { 237 return backcolor; 238 } 239 240 243 public void setBackcolor(Color backcolor) 244 { 245 this.backcolor = backcolor; 246 } 247 248 249 250 public String getKey() 251 { 252 return key; 253 } 254 255 256 262 public void setKey(String key) 263 { 264 this.key = key; 265 } 266 267 268 } 269 | Popular Tags |