Package org.apache.fop.datatypes

Examples of org.apache.fop.datatypes.ColorType


            float descender = fm.getDescender(fontsize) / 1000f;
            float capHeight = fm.getCapHeight(fontsize) / 1000f;
            float halfLineWidth = (descender / -8f) / 2f;
            float endx = (startx + inline.getIPD()) / 1000f;
            if (inline.hasUnderline()) {
                ColorType ct = (ColorType) inline.getTrait(Trait.UNDERLINE_COLOR);
                float y = baseline - descender / 2f;
                drawBorderLine(startx / 1000f, (y - halfLineWidth) / 1000f,
                        endx, (y + halfLineWidth) / 1000f,
                        true, true, Constants.EN_SOLID, ct);
            }
            if (inline.hasOverline()) {
                ColorType ct = (ColorType) inline.getTrait(Trait.OVERLINE_COLOR);
                float y = (float)(baseline - (1.1 * capHeight));
                drawBorderLine(startx / 1000f, (y - halfLineWidth) / 1000f,
                        endx, (y + halfLineWidth) / 1000f,
                        true, true, Constants.EN_SOLID, ct);
            }
            if (inline.hasLineThrough()) {
                ColorType ct = (ColorType) inline.getTrait(Trait.LINETHROUGH_COLOR);
                float y = (float)(baseline - (0.45 * capHeight));
                drawBorderLine(startx / 1000f, (y - halfLineWidth) / 1000f,
                        endx, (y + halfLineWidth) / 1000f,
                        true, true, Constants.EN_SOLID, ct);
            }
View Full Code Here


        //Determine position
        int rx = currentIPPosition + area.getBorderAndPaddingWidthStart();
        int bl = currentBPPosition + area.getOffset() + area.getBaselineOffset();

        useFont(fontname, fontsize);
        ColorType ct = (ColorType)area.getTrait(Trait.COLOR);
        if (ct != null) {
            try {
                useColor(ct);
            } catch (IOException ioe) {
                handleIOTrouble(ioe);
View Full Code Here

        float startx = (currentIPPosition + area.getBorderAndPaddingWidthStart()) / 1000f;
        float starty = (currentBPPosition + area.getOffset()) / 1000f;
        float endx = (currentIPPosition + area.getBorderAndPaddingWidthStart()
                        + area.getIPD()) / 1000f;
        float ruleThickness = area.getRuleThickness() / 1000f;
        ColorType col = (ColorType)area.getTrait(Trait.COLOR);

        try {
            switch (style) {
                case EN_SOLID:
                case EN_DASHED:
View Full Code Here

        // This assumes that *all* CIDFonts use a /ToUnicode mapping
        Typeface tf = (Typeface) fontInfo.getFonts().get(fontName);
        boolean useMultiByte = tf.isMultiByte();
       
        updateFont(fontName, size, pdf);
        ColorType ct = (ColorType) text.getTrait(Trait.COLOR);
        updateColor(ct, true, pdf);

        // word.getOffset() = only height of text itself
        // currentBlockIPPosition: 0 for beginning of line; nonzero
        //  where previous line area failed to take up entire allocated space
View Full Code Here

        float startx = (currentIPPosition + area.getBorderAndPaddingWidthStart()) / 1000f;
        float starty = (currentBPPosition + area.getOffset()) / 1000f;
        float endx = (currentIPPosition + area.getBorderAndPaddingWidthStart()
                        + area.getIPD()) / 1000f;
        float ruleThickness = area.getRuleThickness() / 1000f;
        ColorType col = (ColorType)area.getTrait(Trait.COLOR);

        switch (style) {
            case EN_SOLID:
            case EN_DASHED:
            case EN_DOUBLE:
View Full Code Here

        //boolean isBorderPresent = false;
        CommonBorderPaddingBackground border = fobj.getCommonBorderPaddingBackground();

        // Cell background color
        ColorType color = border.backgroundColor;
        if (color == null) {
            //If there is no background-color specified for the cell,
            //then try to read it from table-row or table-header.
            CommonBorderPaddingBackground brd = null;
           
            if (fobj.getParent() instanceof TableRow) {
                TableRow parentRow = (TableRow)fobj.getParent();
                brd = parentRow.getCommonBorderPaddingBackground();
                color = brd.backgroundColor;
            } else if (fobj.getParent() instanceof TableHeader) {
                TableHeader parentHeader = (TableHeader)fobj.getParent();
                brd = parentHeader.getCommonBorderPaddingBackground();
                color = brd.backgroundColor;
            }
           
            if (color == null
                    && fobj.getParent() != null
                    && fobj.getParent().getParent() != null
                    && fobj.getParent().getParent().getParent() instanceof Table) {

                Table table = (Table)fobj.getParent().getParent().getParent();
                brd = table.getCommonBorderPaddingBackground();
                color = brd.backgroundColor;
            }
           
           
        }
        if ((color != null)
                && (color.getAlpha() != 0
                        || color.getRed() != 0
                        || color.getGreen() != 0
                        || color.getBlue() != 0)) {
            attrib.set(ITableAttributes.CELL_COLOR_BACKGROUND, color);
        }

        BorderAttributesConverter.makeBorder(border, CommonBorderPaddingBackground.BEFORE,
                attrib, ITableAttributes.CELL_BORDER_TOP);
View Full Code Here

            float width, float height) {

        // saves the graphics state in a stack
        state.push();

        ColorType ct = new ColorTypeProperty(0.7f, 0.7f, 0.7f);
        state.updateColor(ct, true, null);
        state.updateStroke(0.4f, EN_SOLID);
        state.getGraph().draw(
                new Rectangle2D.Float(startx, starty, width, height));
View Full Code Here

        float y = currentBPPosition + text.getOffset() + text.getBaselineOffset(); // baseline

        Font font = getFontFromArea(text);
        state.updateFont(font.getFontName(), font.getFontSize(), null);

        ColorType ct = (ColorType) text.getTrait(Trait.COLOR);
        state.updateColor(ct, false, null);

        String s = text.getText();
        state.getGraph().drawString(s, x / 1000f, y / 1000f);
View Full Code Here

        if (hasTextDeco) {
            state.updateStroke((fs.getDescender() / (-8 * 1000f)),
                    Constants.EN_SOLID);
            float endIPD = startIPD + inline.getIPD();
            if (inline.hasUnderline()) {
                ColorType ct = (ColorType) inline
                        .getTrait(Trait.UNDERLINE_COLOR);
                state.updateColor(ct, false, null);
                float y = baseline - fs.getDescender() / 2;
                line.setLine(startIPD / 1000f, y / 1000f, endIPD / 1000f,
                        y / 1000f);
                state.getGraph().draw(line);
            }
            if (inline.hasOverline()) {
                ColorType ct = (ColorType) inline
                        .getTrait(Trait.OVERLINE_COLOR);
                state.updateColor(ct, false, null);
                float y = (float) (baseline - (1.1 * fs.getCapHeight()));
                line.setLine(startIPD / 1000f, y / 1000f, endIPD / 1000f,
                        y / 1000f);
                state.getGraph().draw(line);
            }
            if (inline.hasLineThrough()) {
                ColorType ct = (ColorType) inline
                        .getTrait(Trait.LINETHROUGH_COLOR);
                state.updateColor(ct, false, null);
                float y = (float) (baseline - (0.45 * fs.getCapHeight()));
                line.setLine(startIPD / 1000f, y / 1000f, endIPD / 1000f,
                        y / 1000f);
View Full Code Here

        float startx = (currentIPPosition + area.getBorderAndPaddingWidthStart()) / 1000f;
        float starty = ((currentBPPosition + area.getOffset()) / 1000f);
        float endx = (currentIPPosition + area.getBorderAndPaddingWidthStart()
                + area.getIPD()) / 1000f;

        ColorType ct = (ColorType) area.getTrait(Trait.COLOR);
        state.updateColor(ct, true, null);

        line.setLine(startx, starty, endx, starty);
        float thickness = area.getRuleThickness() / 1000f;
View Full Code Here

TOP

Related Classes of org.apache.fop.datatypes.ColorType

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.