first commit
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
package net.sf.jasperreports.engine.design;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import net.sf.jasperreports.engine.JRCommonGraphicElement;
|
||||
import net.sf.jasperreports.engine.JRDefaultStyleProvider;
|
||||
import net.sf.jasperreports.engine.JRGraphicElement;
|
||||
import net.sf.jasperreports.engine.JRPen;
|
||||
import net.sf.jasperreports.engine.JRPenContainer;
|
||||
import net.sf.jasperreports.engine.base.JRBasePen;
|
||||
import net.sf.jasperreports.engine.util.JRPenUtil;
|
||||
import net.sf.jasperreports.engine.util.JRStyleResolver;
|
||||
|
||||
public abstract class JRDesignGraphicElement extends JRDesignElement implements JRGraphicElement {
|
||||
private static final long serialVersionUID = 10200L;
|
||||
|
||||
protected JRPen linePen;
|
||||
|
||||
protected Byte fill;
|
||||
|
||||
private Byte pen;
|
||||
|
||||
protected JRDesignGraphicElement(JRDefaultStyleProvider defaultStyleProvider) {
|
||||
super(defaultStyleProvider);
|
||||
this.linePen = (JRPen)new JRBasePen((JRPenContainer)this);
|
||||
}
|
||||
|
||||
public JRPen getLinePen() {
|
||||
return this.linePen;
|
||||
}
|
||||
|
||||
public byte getPen() {
|
||||
return JRPenUtil.getPenFromLinePen(this.linePen);
|
||||
}
|
||||
|
||||
public Byte getOwnPen() {
|
||||
return JRPenUtil.getOwnPenFromLinePen(this.linePen);
|
||||
}
|
||||
|
||||
public void setPen(byte pen) {
|
||||
setPen(new Byte(pen));
|
||||
}
|
||||
|
||||
public void setPen(Byte pen) {
|
||||
JRPenUtil.setLinePenFromPen(pen, this.linePen);
|
||||
}
|
||||
|
||||
public byte getFill() {
|
||||
return JRStyleResolver.getFill((JRCommonGraphicElement)this);
|
||||
}
|
||||
|
||||
public Byte getOwnFill() {
|
||||
return this.fill;
|
||||
}
|
||||
|
||||
public void setFill(byte fill) {
|
||||
setFill(new Byte(fill));
|
||||
}
|
||||
|
||||
public void setFill(Byte fill) {
|
||||
Object old = this.fill;
|
||||
this.fill = fill;
|
||||
getEventSupport().firePropertyChange("fill", old, this.fill);
|
||||
}
|
||||
|
||||
public Float getDefaultLineWidth() {
|
||||
return JRPen.LINE_WIDTH_1;
|
||||
}
|
||||
|
||||
public Color getDefaultLineColor() {
|
||||
return getForecolor();
|
||||
}
|
||||
|
||||
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
|
||||
in.defaultReadObject();
|
||||
if (this.linePen == null) {
|
||||
this.linePen = (JRPen)new JRBasePen((JRPenContainer)this);
|
||||
JRPenUtil.setLinePenFromPen(this.pen, this.linePen);
|
||||
this.pen = null;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user