Package org.apache.fop.datatypes

Examples of org.apache.fop.datatypes.ColorType


  }

  public ColorType getColorType() {
    // Convert numeric value to color ???
    // Convert to hexadecimal and then try to make it into a color?
    return new ColorType((float)0.0, (float)0.0, (float)0.0);
  }
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

        //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

     * @param bl the Block object the properties are read from
     * @param rtfAttr the RtfAttributes object the attributes are written to
     */
    private static void attrBackgroundColor(CommonBorderPaddingBackground bpb,
                RtfAttributes rtfAttr) {
        ColorType fopValue = bpb.backgroundColor;
        int rtfColor = 0;
        /* FOP uses a default background color of "transparent", which is
           actually a transparent black, which is generally not suitable as a
           default here. Changing FOP's default to "white" causes problems in
           PDF output, so we will look for the default here & change it to
           "auto". */
        if ((fopValue == null)
                || ((fopValue.getRed() == 0)
                && (fopValue.getGreen() == 0)
                && (fopValue.getBlue() == 0)
                && (fopValue.getAlpha() == 0))) {
            return;
        } else {
            rtfColor = convertFOPColorToRTF(fopValue);
        }

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

        String name = (String) text.getTrait(Trait.FONT_NAME);
        int size = ((Integer) text.getTrait(Trait.FONT_SIZE)).intValue();
        state.updateFont(name, size, 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

        String name = (String) ch.getTrait(Trait.FONT_NAME);
        int size = ((Integer) ch.getTrait(Trait.FONT_SIZE)).intValue();
        state.updateFont(name, size, null);

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

        String s = ch.getChar();
        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

        // String startText = useMultiByte ? "<FEFF" : "(";
        String startText = useMultiByte ? "<" : "(";
        String endText = useMultiByte ? "> " : ") ";

        updateFont(name, size, pdf);
        ColorType ct = (ColorType) ch.getTrait(Trait.COLOR);
        if (ct != null) {
            updateColor(ct, true, pdf);
        }

        // word.getOffset() = only height of text itself
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.