Package java.awt

Examples of java.awt.LinearGradientPaint


                final float fStep = 1.0f / (COL_ROBOT.length-1);
                final float[] fractions = new float[COL_ROBOT.length];
                for (int i = 1; i < fractions.length; ++i) {
                    fractions[i] = fractions[i - 1] + fStep;
                }
                thePaint = new LinearGradientPaint(0, 0, 0, this.height, fractions, COL_ROBOT, MultipleGradientPaint.CycleMethod.REPEAT);
            } else {
                thePaint = new GradientPaint(0, 0, COL_ROBOT[this.goal.robotNumber], 0, this.height, Color.DARK_GRAY);
            }
            g2d.setPaint(thePaint);
            final Shape outerShape = new Rectangle2D.Double(0, 0, this.width, this.height);
View Full Code Here


                final float fStep = 1.0f / (COL_ROBOT.length-1);
                final float[] fractions = new float[COL_ROBOT.length];
                for (int i = 1; i < fractions.length; ++i) {
                    fractions[i] = fractions[i - 1] + fStep;
                }
                thePaint = new LinearGradientPaint(0, 0, 0, this.height, fractions, COL_ROBOT, MultipleGradientPaint.CycleMethod.REPEAT);
            } else {
                thePaint = new GradientPaint(0, 0, COL_ROBOT[this.goal.robotNumber], 0, this.height, Color.DARK_GRAY);
            }
            g2d.setPaint(thePaint);
            final Shape outerShape = new Rectangle2D.Double(0, 0, this.width, this.height);
View Full Code Here

                final float fStep = 1.0f / (COL_ROBOT.length-1);
                final float[] fractions = new float[COL_ROBOT.length];
                for (int i = 1; i < fractions.length; ++i) {
                    fractions[i] = fractions[i - 1] + fStep;
                }
                thePaint = new LinearGradientPaint(0, 0, 0, this.height, fractions, COL_ROBOT, MultipleGradientPaint.CycleMethod.REPEAT);
            } else {
                thePaint = new GradientPaint(0, 0, COL_ROBOT[this.goal.robotNumber], 0, this.height, Color.DARK_GRAY);
            }
            g2d.setPaint(thePaint);
            final Shape outerShape = new Rectangle2D.Double(0, 0, this.width, this.height);
View Full Code Here

                final float fStep = 1.0f / (COL_ROBOT.length-1);
                final float[] fractions = new float[COL_ROBOT.length];
                for (int i = 1; i < fractions.length; ++i) {
                    fractions[i] = fractions[i - 1] + fStep;
                }
                thePaint = new LinearGradientPaint(0, 0, 0, this.height, fractions, COL_ROBOT, MultipleGradientPaint.CycleMethod.REPEAT);
            } else {
                thePaint = new GradientPaint(0, 0, COL_ROBOT[this.goal.robotNumber], 0, this.height, Color.DARK_GRAY);
            }
            g2d.setPaint(thePaint);
            final Shape outerShape = new Rectangle2D.Double(0, 0, this.width, this.height);
View Full Code Here

                final float fStep = 1.0f / (COL_ROBOT.length-1);
                final float[] fractions = new float[COL_ROBOT.length];
                for (int i = 1; i < fractions.length; ++i) {
                    fractions[i] = fractions[i - 1] + fStep;
                }
                thePaint = new LinearGradientPaint(0, 0, 0, this.height, fractions, COL_ROBOT, MultipleGradientPaint.CycleMethod.REPEAT);
            } else {
                thePaint = new GradientPaint(0, 0, COL_ROBOT[this.goal.robotNumber], 0, this.height, Color.DARK_GRAY);
            }
            g2d.setPaint(thePaint);
            final Shape outerShape = new Rectangle2D.Double(0, 0, this.width, this.height);
View Full Code Here

                        final float fStep = 1.0f / (COL_ROBOT.length-1);
                        final float[] fractions = new float[COL_ROBOT.length];
                        for (int i = 1; i < fractions.length; ++i) {
                            fractions[i] = fractions[i - 1] + fStep;
                        }
                        thePaint = new LinearGradientPaint(vWallWidth*2, hWallWidth*2, vWallWidth*2, height-1-hWallWidth*2, fractions, COL_ROBOT, MultipleGradientPaint.CycleMethod.REPEAT);
                    } else {
                        thePaint = new GradientPaint(0, 0, COL_ROBOT[goal.robotNumber], 0, height-1, Color.DARK_GRAY);
                    }
                    g2d.setPaint(thePaint);
                    final Shape outerShape = new Rectangle2D.Double(
View Full Code Here

                    Color color = Color.decode(JSONSerializer.getString(stop, COLOR_KEY));
                    colors[i] = color;
                }

                paint = new LinearGradientPaint(startX, startY, endX, endY, fractions, colors);
                break;
            }

            case RADIAL_GRADIENT: {
                float centerX = JSONSerializer.getFloat(value, CENTER_X_KEY);
View Full Code Here

      case GRADIENT_DIAGONAL1:
      case GRADIENT_DIAGONAL2:
      case GRADIENT_HORIZONTAL:
      case GRADIENT_VERTICAL:
        if (version16)
          paint = new LinearGradientPaint(x0, y0, x1, y1,
              createFractions(style), createColors(style));
        else
          paint = new GradientPaint(x0, y0, style.getFillColor(0),
              x1, y1, style.getFillColor(1));
        break;
View Full Code Here

                        center.getX(), center.getY(), radius, false,
                        CycleMethod.NO_CYCLE, stops);
                this.gc.setStroke(rg);
                this.gc.setFill(rg);
            } else if (paint instanceof LinearGradientPaint) {
                LinearGradientPaint lgp = (LinearGradientPaint) paint;
                Point2D start = lgp.getStartPoint();
                Point2D end = lgp.getEndPoint();
                LinearGradient lg = new LinearGradient(start.getX(),
                        start.getY(), end.getX(), end.getY(), false,
                        CycleMethod.NO_CYCLE, stops);
                this.gc.setStroke(lg);
                this.gc.setFill(lg);
View Full Code Here

                    Color color = Color.decode(JSONSerializer.getString(stop, COLOR_KEY));
                    colors[i] = color;
                }

                paint = new LinearGradientPaint(startX, startY, endX, endY, fractions, colors);
                break;
            }

            case RADIAL_GRADIENT: {
                float centerX = JSONSerializer.getFloat(value, CENTER_X_KEY);
View Full Code Here

TOP

Related Classes of java.awt.LinearGradientPaint

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.