Package java.awt

Examples of java.awt.GradientPaint


    int width = getWidth();
    int height = getHeight();

    // Create the gradient paint
    GradientPaint paint =
        new GradientPaint((float)width / 3, 0, getBackground(), width, height, UIManager.getColor("List.selectionBackground"), false);

    g2d.setPaint(paint);
    g2d.fillRect(0, 0, width, height);
  }
View Full Code Here


        new Font("Sans Serif", Font.BOLD, 18),
    };
    paintSteady = new Paint[colorBase.length];
    for (int i = 0; i < colorBase.length; i++) {
      Color hue = colorBase[i];
      paintSteady[i] = new GradientPaint(0.0f, 0.0f, derive(hue, 0),
          0.0f, fadeStop, hue);
    }
   
    URL url = AboutCredits.class.getClassLoader().getResource(HENDRIX_PATH);
    Image hendrixLogo = null;
View Full Code Here

        paint = paintSteady;
      } else {
        paint = new Paint[colorBase.length];
        for (int i = 0; i < paint.length; i++) {
          Color hue = colorBase[i];
          paint[i] = new GradientPaint(0.0f, 0.0f, derive(hue, a),
            0.0f, fadeStop, hue);
        }
      }
      yPos = initY;
    } else if (offs < MILLIS_FREEZE + maxY * MILLIS_PER_PIXEL) {
View Full Code Here

    super.paint(graphics);
    final Graphics2D g2 = (Graphics2D) graphics;

    int w = getWidth();
    int h = 70;
    GradientPaint gradient = new GradientPaint(0, 0, new Color(255, 255, 255, 255), 2, h, new Color(255, 255, 255, 0), false);
    g2.setPaint(gradient);
    g2.fillRect(0, 0, w, h);

    gradient = new GradientPaint(0, getHeight() - h, new Color(255, 255, 255, 0), 2, getHeight(), new Color(255, 255, 255, 255), false);
    g2.setPaint(gradient);
    g2.fillRect(0, getHeight() - h, w, h);
  }
View Full Code Here

        Color c1 = new Color(UIManager.getDefaults().getColor(
            "Tree.selectionBackground").getRGB());
        c1 = c1.darker();

        g2.setPaint(new GradientPaint(0, 0, c1, getWidth(), 0, new Color(255,
            255, 255, 0)));

        // Paint under the JLabel's text
        g2.fillRect(0, 0, getWidth(), mGhostImage.getHeight());
View Full Code Here

        cb.setColorStroke(color);
      }
    }
    else if (paint instanceof GradientPaint)
    {
      final GradientPaint gp = (GradientPaint) paint;
      final Point2D p1 = gp.getPoint1();
      transform.transform(p1, p1);
      final Point2D p2 = gp.getPoint2();
      transform.transform(p2, p2);
      final Color c1 = gp.getColor1();
      final Color c2 = gp.getColor2();
      final PdfShading shading = PdfShading.simpleAxial(cb.getPdfWriter(), (float) p1.getX(), normalizeY(
          (float) p1.getY()), (float) p2.getX(), normalizeY((float) p2.getY()), c1, c2);
      final PdfShadingPattern pat = new PdfShadingPattern(shading);
      if (fill)
      {
View Full Code Here

     */
    public static Paint getGradientPaintForShape(Shape shape, Paint paint) {
        if (paint instanceof Color) {
            Color color = (Color) paint;
            Rectangle rect = shape.getBounds();
            paint = new GradientPaint((float) rect.getWidth() * .3f, (float) rect.getHeight() * .3f, color.brighter()
                    .brighter(), (float) rect.getWidth() * .7f, (float) rect.getHeight() * .7f, color.darker()
                    .darker());
        }
        return paint;
    }
View Full Code Here

        viewRect.width = getWidth() - (i.right + viewRect.x);
        viewRect.height = getHeight() - (i.bottom + viewRect.y);
       
        // paint gradient
        Graphics2D g2 = (Graphics2D)g;
        Paint gradient = new GradientPaint(
            0, 0, fromColor,
            viewRect.width, viewRect.height, toColor );
        g2.setPaint( gradient );
        g2.fillRect( viewRect.x, viewRect.y,
            viewRect.width, viewRect.height );
View Full Code Here

    // Set all the colors we support
    Paint backgroundPaint = jrPlot.getOwnBackcolor() == null ? ChartThemesConstants.TRANSPARENT_PAINT : jrPlot.getOwnBackcolor();
    chartPlot.setBackgroundPaint(backgroundPaint);

    GradientPaint gp =
      new GradientPaint(
        new Point(), Color.LIGHT_GRAY,
        new Point(), Color.BLACK,
        false
        );
   
View Full Code Here

      RectangleInsets padding = title.getPadding();
      double bottomPadding = Math.max(padding.getBottom(), 15d);
      title.setPadding(padding.getTop(), padding.getLeft(), bottomPadding, padding.getRight());
    }

    GradientPaint gp = (GradientPaint)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.BACKGROUND_PAINT);

    jfreeChart.setBackgroundPaint(new GradientPaint(0f, 0f, gp.getColor1(), 0f, getChart().getHeight() * 0.7f, gp.getColor2(), false));
  }
View Full Code Here

TOP

Related Classes of java.awt.GradientPaint

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.