package net.sf.jasperreports.crosstabs.design;

import net.sf.jasperreports.crosstabs.JRCrosstabRowGroup;

public class JRDesignCrosstabRowGroup extends JRDesignCrosstabGroup implements JRCrosstabRowGroup {
  private static final long serialVersionUID = 10200L;
  
  public static final String PROPERTY_POSITION = "position";
  
  public static final String PROPERTY_WIDTH = "width";
  
  protected int width;
  
  protected byte position = 1;
  
  public byte getPosition() {
    return this.position;
  }
  
  public void setPosition(byte position) {
    byte old = this.position;
    this.position = position;
    getEventSupport().firePropertyChange("position", old, this.position);
  }
  
  public int getWidth() {
    return this.width;
  }
  
  public void setWidth(int width) {
    int old = this.width;
    this.width = width;
    getEventSupport().firePropertyChange("width", old, this.width);
  }
  
  public void setHeader(JRDesignCellContents header) {
    super.setHeader(header);
    setCellOrigin(this.header, new JRCrosstabOrigin(getParent(), (byte)3, getName(), null));
  }
  
  public void setTotalHeader(JRDesignCellContents totalHeader) {
    super.setTotalHeader(totalHeader);
    setCellOrigin(this.totalHeader, new JRCrosstabOrigin(getParent(), (byte)4, getName(), null));
  }
  
  void setParent(JRDesignCrosstab parent) {
    super.setParent(parent);
    setCellOrigin(this.header, new JRCrosstabOrigin(getParent(), (byte)3, getName(), null));
    setCellOrigin(this.totalHeader, new JRCrosstabOrigin(getParent(), (byte)4, getName(), null));
  }
}
