TextDispStr.java 3.71 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.adobe.xfa.text;

import com.adobe.xfa.text.TextDisplay;
import com.adobe.xfa.text.TextFrame;
import com.adobe.xfa.text.TextRange;
import com.adobe.xfa.text.TextSparseStream;
import com.adobe.xfa.text.TextStream;
import com.adobe.xfa.text.TraditionalFrame;
import com.adobe.xfa.ut.Rect;
import com.adobe.xfa.ut.UnitSpan;

public class TextDispStr
extends TextSparseStream {
    private TraditionalFrame mpoFrame;

    public TextDispStr() {
    }

    public TextDispStr(TextDispStr oSource) {
        super(oSource);
    }

    public TextDispStr(String sSource) {
        super(sSource);
    }

    @Override
    public boolean equals(Object object) {
        return super.equals(object);
    }

    @Override
    public int hashCode() {
        return super.hashCode();
    }

    public Rect extent() {
        return this.mpoFrame.getExtent();
    }

    public Rect runtimeExtent() {
        TextRange oRange;
        if (this.maxWidth().value() > 0 && this.maxHeight().value() > 0 || (oRange = new TextRange(this)).countField() <= 0 || oRange.countEmbed() > 0) {
            // empty if block
        }
        return this.extent();
    }

    public boolean allowOverflow() {
        return this.getTraditionalFrame().suppressWordWrap();
    }

    public void allowOverflow(boolean bNewAllow) {
        if (bNewAllow == this.allowOverflow()) {
            return;
        }
        this.getTraditionalFrame().setSuppressWordWrap(bNewAllow);
        if (this.display() != null) {
            this.display().update();
        }
    }

    public boolean justifyVPoint() {
        return this.getTraditionalFrame().alignVPoint();
    }

    public boolean justifyHPoint() {
        return this.getTraditionalFrame().alignHPoint();
    }

    public boolean unlimitedWidth() {
        return this.getTraditionalFrame().unlimitedWidth();
    }

    public boolean unlimitedHeight() {
        return this.getTraditionalFrame().unlimitedHeight();
    }

    public int combCells() {
        return this.getTraditionalFrame().combCells();
    }

    public void combCells(int nCombCells) {
        if (nCombCells == this.combCells()) {
            return;
        }
        this.getTraditionalFrame().setCombCells(nCombCells);
        if (this.display() != null) {
            this.display().update();
        }
    }

    public boolean notEqual(TextDispStr oCompare) {
        return !this.equals(oCompare);
    }

    public UnitSpan minWidth() {
        return this.getTraditionalFrame().minWidth();
    }

    public UnitSpan minHeight() {
        return this.getTraditionalFrame().minHeight();
    }

    public UnitSpan maxWidth() {
        return this.getTraditionalFrame().maxWidth();
    }

    public UnitSpan maxHeight() {
        return this.getTraditionalFrame().maxHeight();
    }

    public UnitSpan justifyHeight() {
        return this.getTraditionalFrame().alignmentHeight();
    }

    public boolean enforceJustifyHeight() {
        return this.getTraditionalFrame().enforceAlignmentHeight();
    }

    public UnitSpan justifyWidth() {
        return this.getTraditionalFrame().alignmentWidth();
    }

    public boolean enforceJustifyWidth() {
        return this.getTraditionalFrame().enforceAlignmentWidth();
    }

    @Override
    public TextFrame onLoadFrame(int nIndex) {
        assert (false);
        return null;
    }

    boolean testFitSize() {
        return this.getTraditionalFrame().testFitSize();
    }

    TraditionalFrame getTraditionalFrame() {
        assert (this.mpoFrame != null);
        return this.mpoFrame;
    }

    void setTraditionalFrame(TraditionalFrame poFrame) {
        assert (this.mpoFrame == null);
        this.mpoFrame = poFrame;
        this.appendFrameRef(poFrame);
    }
}