protected JRFillTextElement(JRFillTextElement textElement, JRFillCloneFactory factory) {
    super(textElement, factory);

    reportFont = textElement.reportFont;

    lineBox = textElement.getLineBox().clone(this);
  }
Exemplo n.º 2
0
  protected boolean prepare(int availableHeight, boolean isOverflow) throws JRException {
    boolean willOverflow = false;

    super.prepare(availableHeight, isOverflow);

    if (!isToPrint()) {
      return willOverflow;
    }

    boolean isToPrint = true;
    boolean isReprinted = false;

    if (isOverflow && isAlreadyPrinted() && !isPrintWhenDetailOverflows()) {
      isToPrint = false;
    }

    if (isToPrint && isPrintWhenExpressionNull() && !isPrintRepeatedValues()) {
      if ((!isPrintInFirstWholeBand() || !getBand().isFirstWholeOnPageColumn())
          && (getPrintWhenGroupChanges() == null
              || !getBand().isNewGroup(getPrintWhenGroupChanges()))
          && (!isOverflow || !isPrintWhenDetailOverflows())) {
        isToPrint = false;
      }
    }

    if (isToPrint && availableHeight < getRelativeY() + getHeight()) {
      isToPrint = false;
      willOverflow = true;
    }

    if (isToPrint
        && isOverflow
        &&
        // (isAlreadyPrinted() || !isPrintRepeatedValues())
        (isPrintWhenDetailOverflows()
            && (isAlreadyPrinted() || (!isAlreadyPrinted() && !isPrintRepeatedValues())))) {
      isReprinted = true;
    }

    resetTextChunk();

    if (isToPrint) {
      chopTextElement(0);
    }

    setToPrint(isToPrint);
    setReprinted(isReprinted);

    return willOverflow;
  }