Package org.apache.fop.layout

Examples of org.apache.fop.layout.TextState


    }

    public TextState getTextDecoration(FObj parent) throws FOPException {

        // TextState from parent Block/Inline
        TextState tsp = null;
        boolean found = false;

        do {
            if (parent instanceof AbstractFlow) {
                found = true;
            } else if (parent instanceof FObjMixed) {
                FObjMixed fom = (FObjMixed) parent;
                tsp = fom.getTextState();
                found = true;
            }
            parent = parent.getParent();
        } while (!found);

        TextState ts = new TextState();

        if (tsp != null) {
            ts.setUnderlined(tsp.getUnderlined());
            ts.setOverlined(tsp.getOverlined());
            ts.setLineThrough(tsp.getLineThrough());
        }

        int textDecoration = this.properties.get("text-decoration").getEnum();

        if (textDecoration == TextDecoration.UNDERLINE) {
            ts.setUnderlined(true);
        }
        if (textDecoration == TextDecoration.OVERLINE) {
            ts.setOverlined(true);
        }
        if (textDecoration == TextDecoration.LINE_THROUGH) {
            ts.setLineThrough(true);
        }
        if (textDecoration == TextDecoration.NO_UNDERLINE) {
            ts.setUnderlined(false);
        }
        if (textDecoration == TextDecoration.NO_OVERLINE) {
            ts.setOverlined(false);
        }
        if (textDecoration == TextDecoration.NO_LINE_THROUGH) {
            ts.setLineThrough(false);
        }

        return ts;
    }
View Full Code Here


    }

    public TextState getTextDecoration(FObj parent) throws FOPException {

        // TextState from parent Block/Inline
        TextState tsp = null;
        boolean found = false;

        do {
            String fname = parent.getName();
            if (fname.equals("fo:flow") || fname.equals("fo:static-content")) {
                found = true;
            } else if (fname.equals("fo:block") || fname.equals("fo:inline")) {
                FObjMixed fom = (FObjMixed) parent;
                tsp = fom.getTextState();
                found = true;
            }
            parent = parent.getParent();
        } while (!found);

        TextState ts = new TextState();

        if (tsp != null) {
            ts.setUnderlined(tsp.getUnderlined());
            ts.setOverlined(tsp.getOverlined());
            ts.setLineThrough(tsp.getLineThrough());
        }

        int textDecoration = this.properties.get("text-decoration").getEnum();

        if (textDecoration == TextDecoration.UNDERLINE) {
            ts.setUnderlined(true);
        }
        if (textDecoration == TextDecoration.OVERLINE) {
            ts.setOverlined(true);
        }
        if (textDecoration == TextDecoration.LINE_THROUGH) {
            ts.setLineThrough(true);
        }
        if (textDecoration == TextDecoration.NO_UNDERLINE) {
            ts.setUnderlined(false);
        }
        if (textDecoration == TextDecoration.NO_OVERLINE) {
            ts.setOverlined(false);
        }
        if (textDecoration == TextDecoration.NO_LINE_THROUGH) {
            ts.setLineThrough(false);
        }

        return ts;
    }
View Full Code Here

TOP

Related Classes of org.apache.fop.layout.TextState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.