package net.sf.jasperreports.engine.base;

import net.sf.jasperreports.engine.JRBreak;
import net.sf.jasperreports.engine.JRElement;
import net.sf.jasperreports.engine.JRExpressionCollector;
import net.sf.jasperreports.engine.JRVisitor;

public class JRBaseBreak extends JRBaseElement implements JRBreak {
  private static final long serialVersionUID = 10200L;
  
  public static final String PROPERTY_TYPE = "type";
  
  protected byte type = 1;
  
  protected JRBaseBreak(JRBreak breakElement, JRBaseObjectFactory factory) {
    super((JRElement)breakElement, factory);
    this.type = breakElement.getType();
  }
  
  public int getX() {
    return 0;
  }
  
  public int getHeight() {
    return 1;
  }
  
  public byte getType() {
    return this.type;
  }
  
  public void setType(byte type) {
    byte old = this.type;
    this.type = type;
    getEventSupport().firePropertyChange("type", old, this.type);
  }
  
  public void collectExpressions(JRExpressionCollector collector) {
    collector.collect(this);
  }
  
  public void visit(JRVisitor visitor) {
    visitor.visitBreak(this);
  }
}
