Examples of CycleMethodEnum


Examples of org.apache.batik.ext.awt.MultipleGradientPaint.CycleMethodEnum

      throws IllegalArgumentException {
    Point2D startPoint = paint.getStartPoint();
    Point2D endPoint = paint.getEndPoint();
    float[] fractions = paint.getFractions();
    Color[] colors = paint.getColors();
    CycleMethodEnum cycleMethod = paint.getCycleMethod();
    ColorSpaceEnum colorSpace = paint.getColorSpace();
    AffineTransform transform = paint.getTransform();

    float previousFraction = -1.0f;
    for (float currentFraction : fractions) {
View Full Code Here

Examples of org.apache.batik.ext.awt.MultipleGradientPaint.CycleMethodEnum

    Point2D centerPoint = paint.getCenterPoint();
    float radius = paint.getRadius();
    Point2D focusPoint = paint.getFocusPoint();
    float[] fractions = paint.getFractions();
    Color[] colors = paint.getColors();
    CycleMethodEnum cycleMethod = paint.getCycleMethod();
    ColorSpaceEnum colorSpace = paint.getColorSpace();
    AffineTransform transform = paint.getTransform();

    float previousFraction = -1.0f;
    for (float currentFraction : fractions) {
View Full Code Here

Examples of org.apache.batik.ext.awt.MultipleGradientPaint.CycleMethodEnum

          int offset) {
        Point2D startPoint = paint.getStartPoint();
        Point2D endPoint = paint.getEndPoint();
        float[] fractions = paint.getFractions();
        Color[] colors = paint.getColors();
        CycleMethodEnum cycleMethod = paint.getCycleMethod();
        ColorSpaceEnum colorSpace = paint.getColorSpace();
        AffineTransform transform = paint.getTransform();

        StringBuffer fractionsRep = new StringBuffer();
        if (fractions == null) {
          fractionsRep.append("null");
        } else {
          String sep = "";
          fractionsRep.append("new float[] {");
          for (float fraction : fractions) {
            fractionsRep.append(sep);
            fractionsRep.append(fraction + "f");
            sep = ",";
          }
          fractionsRep.append("}");
        }

        StringBuffer colorsRep = new StringBuffer();
        if (fractions == null) {
          colorsRep.append("null");
        } else {
          String sep = "";
          colorsRep.append("new Color[] {");
          for (Color color : colors) {
            colorsRep.append(sep);
            colorsRep.append("new Color(" + color.getRed() + ", "
                + color.getGreen() + ", " + color.getBlue()
                + ", " + color.getAlpha() + ")");
            sep = ",";
          }
          colorsRep.append("}");
        }

        String cycleMethodRep = null;
        if (cycleMethod == MultipleGradientPaint.NO_CYCLE) {
          cycleMethodRep = "MultipleGradientPaint.CycleMethod.NO_CYCLE";
        }
        if (cycleMethod == MultipleGradientPaint.REFLECT) {
          cycleMethodRep = "MultipleGradientPaint.CycleMethod.REFLECT";
        }
        if (cycleMethod == MultipleGradientPaint.REPEAT) {
          cycleMethodRep = "MultipleGradientPaint.CycleMethod.REPEAT";
        }

        String colorSpaceRep = null;
        if (colorSpace == MultipleGradientPaint.SRGB) {
          colorSpaceRep = "MultipleGradientPaint.ColorSpaceType.SRGB";
        }
        if (colorSpace == MultipleGradientPaint.LINEAR_RGB) {
          colorSpaceRep = "MultipleGradientPaint.ColorSpaceType.LINEAR_RGB";
        }

        double[] transfMatrix = new double[6];
        transform.getMatrix(transfMatrix);

        pw
            .println("paint = new LinearGradientPaint(new Point2D.Double("
                + startPoint.getX()
                + ", "
                + startPoint.getY()
                + "), new Point2D.Double("
                + endPoint.getX()
                + ", "
                + endPoint.getY()
                + "), "
                + fractionsRep.toString()
                + ", "
                + colorsRep.toString()
                + ", "
                + cycleMethodRep
                + ", "
                + colorSpaceRep
                + ", new AffineTransform("
                + transfMatrix[0]
                + "f, "
                + transfMatrix[1]
                + "f, "
                + transfMatrix[2]
                + "f, "
                + transfMatrix[3]
                + "f, "
                + transfMatrix[4]
                + "f, "
                + transfMatrix[5] + "f));");

        // offset(offset);
        // pw.println("LinearGradientPaint");
        // // offset(offset + 1);
        // pw.println("START : " + paint.getStartPoint());
        // // offset(offset + 1);
        // pw.println("END : " + paint.getEndPoint());
        // // offset(offset + 1);
        // pw.println("FRACTIONS : " + paint.getFractions());
        // // offset(offset + 1);
        // pw.println("CYCLE_METHOD : " + paint.getCycleMethod());
        // // offset(offset + 1);
        // pw.println("COLOR_SPACE : " + paint.getColorSpace());
        // // offset(offset + 1);
        // pw.println("GRADIENT_TRANSFORM : " + paint.getTransform());
      }

      private void dumpPaint(PrintWriter pw, RadialGradientPaint paint,
          int offset) {
        // offset(offset);
        Point2D centerPoint = paint.getCenterPoint();
        float radius = paint.getRadius();
        Point2D focusPoint = paint.getFocusPoint();
        float[] fractions = paint.getFractions();
        Color[] colors = paint.getColors();
        CycleMethodEnum cycleMethod = paint.getCycleMethod();
        ColorSpaceEnum colorSpace = paint.getColorSpace();
        AffineTransform transform = paint.getTransform();

        StringBuffer fractionsRep = new StringBuffer();
        if (fractions == null) {
View Full Code Here

Examples of org.apache.batik.ext.awt.MultipleGradientPaint.CycleMethodEnum

            int offset) {
          Point2D startPoint = paint.getStartPoint();
          Point2D endPoint = paint.getEndPoint();
          float[] fractions = paint.getFractions();
          Color[] colors = paint.getColors();
          CycleMethodEnum cycleMethod = paint.getCycleMethod();
          ColorSpaceEnum colorSpace = paint.getColorSpace();
          AffineTransform transform = paint.getTransform();

          StringBuffer fractionsRep = new StringBuffer();
          if (fractions == null) {
            fractionsRep.append("null");
          } else {
            String sep = "";
            fractionsRep.append("new float[] {");
            for (float fraction : fractions) {
              fractionsRep.append(sep);
              fractionsRep.append(fraction + "f");
              sep = ",";
            }
            fractionsRep.append("}");
          }

          StringBuffer colorsRep = new StringBuffer();
          if (fractions == null) {
            colorsRep.append("null");
          } else {
            String sep = "";
            colorsRep.append("new Color[] {");
            for (Color color : colors) {
              colorsRep.append(sep);
              colorsRep.append("new Color(" + color.getRed() + ", "
                  + color.getGreen() + ", " + color.getBlue()
                  + ", " + color.getAlpha() + ")");
              sep = ",";
            }
            colorsRep.append("}");
          }

          String cycleMethodRep = null;
          if (cycleMethod == MultipleGradientPaint.NO_CYCLE) {
            cycleMethodRep = "MultipleGradientPaint.CycleMethod.NO_CYCLE";
          }
          if (cycleMethod == MultipleGradientPaint.REFLECT) {
            cycleMethodRep = "MultipleGradientPaint.CycleMethod.REFLECT";
          }
          if (cycleMethod == MultipleGradientPaint.REPEAT) {
            cycleMethodRep = "MultipleGradientPaint.CycleMethod.REPEAT";
          }

          String colorSpaceRep = null;
          if (colorSpace == MultipleGradientPaint.SRGB) {
            colorSpaceRep = "MultipleGradientPaint.ColorSpaceType.SRGB";
          }
          if (colorSpace == MultipleGradientPaint.LINEAR_RGB) {
            colorSpaceRep = "MultipleGradientPaint.ColorSpaceType.LINEAR_RGB";
          }

          double[] transfMatrix = new double[6];
          transform.getMatrix(transfMatrix);

          pw
              .println("paint = new LinearGradientPaint(new Point2D.Double("
                  + startPoint.getX()
                  + ", "
                  + startPoint.getY()
                  + "), new Point2D.Double("
                  + endPoint.getX()
                  + ", "
                  + endPoint.getY()
                  + "), "
                  + fractionsRep.toString()
                  + ", "
                  + colorsRep.toString()
                  + ", "
                  + cycleMethodRep
                  + ", "
                  + colorSpaceRep
                  + ", new AffineTransform("
                  + transfMatrix[0]
                  + "f, "
                  + transfMatrix[1]
                  + "f, "
                  + transfMatrix[2]
                  + "f, "
                  + transfMatrix[3]
                  + "f, "
                  + transfMatrix[4]
                  + "f, "
                  + transfMatrix[5] + "f));");

          // offset(offset);
          // pw.println("LinearGradientPaint");
          // // offset(offset + 1);
          // pw.println("START : " + paint.getStartPoint());
          // // offset(offset + 1);
          // pw.println("END : " + paint.getEndPoint());
          // // offset(offset + 1);
          // pw.println("FRACTIONS : " + paint.getFractions());
          // // offset(offset + 1);
          // pw.println("CYCLE_METHOD : " + paint.getCycleMethod());
          // // offset(offset + 1);
          // pw.println("COLOR_SPACE : " + paint.getColorSpace());
          // // offset(offset + 1);
          // pw.println("GRADIENT_TRANSFORM : " + paint.getTransform());
        }

        private void dumpPaint(PrintWriter pw, RadialGradientPaint paint,
            int offset) {
          // offset(offset);
          Point2D centerPoint = paint.getCenterPoint();
          float radius = paint.getRadius();
          Point2D focusPoint = paint.getFocusPoint();
          float[] fractions = paint.getFractions();
          Color[] colors = paint.getColors();
          CycleMethodEnum cycleMethod = paint.getCycleMethod();
          ColorSpaceEnum colorSpace = paint.getColorSpace();
          AffineTransform transform = paint.getTransform();

          StringBuffer fractionsRep = new StringBuffer();
          if (fractions == null) {
View Full Code Here

Examples of org.apache.batik.ext.awt.MultipleGradientPaint.CycleMethodEnum

     
 
    private CycleMethodEnum getSpreadMethod(Element paintElement){
      String s = new String();
        //SPREADMETHOD 'spreadMethod' attribute - default is pad
        CycleMethodEnum spreadMethod = MultipleGradientPaint.NO_CYCLE;
        s = SVGUtilities.getChainableAttributeNS(paintElement, null, SVG_SPREAD_METHOD_ATTRIBUTE, ctx);
        if (s.length() != 0) {
//            spreadMethod = AbstractSVGGradientElementBridge.convertSpreadMethod(paintElement, s, ctx);
            if (SVG_REPEAT_VALUE.equals(s)) {
              spreadMethod =  MultipleGradientPaint.REPEAT;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.