Package org.apache.fop.datatypes

Examples of org.apache.fop.datatypes.ColorType


        // this.properties.get("text-shadow");
        // this.properties.get("text-transform");
        // this.properties.get("word-spacing");

        // color properties
        ColorType c = this.properties.get("color").getColorType();
        float red = c.red();
        float green = c.green();
        float blue = c.blue();

        int whiteSpaceCollapse =
            this.properties.get("white-space-collapse").getEnum();
        int wrapOption = this.parent.properties.get("wrap-option").getEnum();
View Full Code Here


    }

    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

        public Property convertProperty(Property p,
                                        PropertyList propertyList, FObj fo) {
            if (p instanceof ColorTypeProperty)
                return p;
            ColorType val = p.getColorType();
            if (val != null)
                return new ColorTypeProperty(val);
            return convertPropertyDatatype(p, propertyList, fo);
        }
View Full Code Here

        BlockArea blockArea;
        blockArea = (BlockArea) area;
        boolean textDecoration;

        //color properties
        ColorType c = this.properties.get("color").getColorType();
        float red = c.red();
        float green = c.green();
        float blue = c.blue();

        int whiteSpaceCollapse = this.properties.get(
                                    "white-space-collapse").getEnum();
        int wrapOption = this.parent.properties.get("wrap-option").getEnum();
View Full Code Here

      if (colorVal < 0.0 || colorVal > 255.0) {
  throw new PropertyException("Arguments to rgb() must normalize to the range 0 to 1");
      }
      cfvals[i] = colorVal;
    }
     return new ColorTypeProperty( new ColorType(cfvals[0],
             cfvals[1],
             cfvals[2]));

  }
View Full Code Here

  }

  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

    public Property convertProperty(Property p, PropertyList propertyList,
               FObj fo) {
      if (p instanceof ColorTypeProperty)
  return p;
      ColorType val = p.getColorType();
      if (val != null)
  return new ColorTypeProperty(val);
      return convertPropertyDatatype(p, propertyList, fo);
    }
View Full Code Here

            rx += ((BlockArea)area).getStartIndent();
        }

        h = area.getContentHeight();
        int ry = this.currentYPosition;
        ColorType bg = area.getBackgroundColor();

        rx = rx - area.getPaddingLeft();
        ry = ry + area.getPaddingTop();
        w = w + area.getPaddingLeft() + area.getPaddingRight();
        h = h + area.getPaddingTop() + area.getPaddingBottom();

        // I'm not sure I should have to check for bg being null
        // but I do
        if ((bg != null) && (bg.alpha() == 0)) {
            this.addRect(rx, ry, w, h, bg.red(), bg.green(), bg.blue(),
                         bg.red(), bg.green(), bg.blue());
        }

        rx = rx - area.getBorderLeftWidth();
        ry = ry + area.getBorderTopWidth();
        w = w + area.getBorderLeftWidth() + area.getBorderRightWidth();
        h = h + area.getBorderTopWidth() + area.getBorderBottomWidth();

        BorderAndPadding bp = area.getBorderAndPadding();
        ColorType borderColor;

        if (area.getBorderTopWidth() != 0) {
            borderColor = bp.getBorderColor(BorderAndPadding.TOP);
            addLine(rx, ry, rx + w, ry, area.getBorderTopWidth(),
                    borderColor.red(), borderColor.green(),
                    borderColor.blue());
        }

        if (area.getBorderLeftWidth() != 0) {
            borderColor = bp.getBorderColor(BorderAndPadding.LEFT);
            addLine(rx, ry, rx, ry - h, area.getBorderLeftWidth(),
                    borderColor.red(), borderColor.green(),
                    borderColor.blue());
        }

        if (area.getBorderRightWidth() != 0) {
            borderColor = bp.getBorderColor(BorderAndPadding.RIGHT);
            addLine(rx + w, ry, rx + w, ry - h,
                    area.getBorderRightWidth(), borderColor.red(),
                    borderColor.green(),
                    borderColor.blue());
        }

        if (area.getBorderBottomWidth() != 0) {
            borderColor = bp.getBorderColor(BorderAndPadding.BOTTOM);
            addLine(rx, ry - h, rx + w, ry - h, area.getBorderBottomWidth(),
                    borderColor.red(), borderColor.green(),
                    borderColor.blue());
        }
    }
View Full Code Here

                return false;
            } else if (obj == this) {
                return true;
            } else {
                if (obj instanceof ColorType) {
                    ColorType other = (ColorType)obj;
                    return getRed() == other.getRed()
                            && getGreen() == other.getGreen()
                            && getBlue() == other.getBlue()
                            && getAlpha() == other.getAlpha();
                }
            }
            return false;
        }
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

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.