Package java.awt

Examples of java.awt.GradientPaint


      int y = 0;

      if (_topColor == null || _bottomColor == null) {
        super.paintComponent(g);
      } else {
        GradientPaint paint = new GradientPaint(x, y, _topColor, x, getHeight(), _bottomColor);
        if (g instanceof Graphics2D) {
          Graphics2D g2d = (Graphics2D) g;
          g2d.setPaint(paint);
        } else {
          g.setColor(_bottomColor);
View Full Code Here


      final Graphics2D g2d = (Graphics2D) g;
      g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
          RenderingHints.VALUE_ANTIALIAS_ON);
      g2d.setBackground(backgroundColor);
      g2d.clearRect(0, 0, this.getWidth(), this.getHeight());
      final GradientPaint gp = new GradientPaint(0f, 0f, backgroundColor, 0f,
          this.getHeight() / 2.f, textColor, true);
      g2d.setPaint(gp);
      g2d.setFont(font);
      final FontMetrics metrics = g2d.getFontMetrics();
      int i = 0;
View Full Code Here

            return;
        }
        lastWidth = width;
        lastHeight = height;

        background.paint = new GradientPaint(0, 0, background.top, 0, height, background.bottom, true);
        selection.paint = new GradientPaint(0, 0, selection.top, 0, height, selection.bottom, true);
        selection.mouseOverPaint = new GradientPaint(0, 0, selection.mouseOverTopColor, 0, height, selection.mouseOverBottomColor, true);
        selection.activatedPaint = new GradientPaint(0, 0, selection.activatedTopColor, 0, height, selection.activatedBottomColor, true);
    }
View Full Code Here

        //background.bottom = new Color(47, 45, 43, 255);
        //background.top = new Color(131, 131, 131, 255);
        //background.bottom = new Color(77, 75, 73, 255);
        background.top = new Color(151, 151, 151, 255);
        background.bottom = new Color(97, 95, 93, 255);
        background.paint = new GradientPaint(0, 0, background.top, 0, 20, background.bottom, true);

        //selection.top = new Color(89, 161, 235, 153);
        //selection.bottom = new Color(37, 104, 161, 153);
        selection.top = new Color(108, 151, 194, 255);
        selection.bottom = new Color(57, 97, 131, 255);
        selection.paint = new GradientPaint(0, 0, selection.top, 0, 20, selection.bottom, true);
        selection.visibleHookWidth = 12; // the "visible hook" (mouse hook, to move the selection box)
        selection.invisibleHookMargin = 3; // let the "invisible hook" be a bit larger on the left..
        selection.minimalWidth = 16;
        selection.mouseOverTopColor = new Color(102, 195, 145, 255);
        selection.activatedTopColor = new Color(188, 118, 114, 255);
        selection.mouseOverBottomColor = new Color(60, 143, 96, 255);
        selection.activatedBottomColor = new Color(151, 79, 79, 255);
        selection.mouseOverPaint = new GradientPaint(0, 0, selection.mouseOverTopColor, 0, 20, selection.mouseOverBottomColor, true);
        selection.activatedPaint = new GradientPaint(0, 0, selection.activatedTopColor, 0, 20, selection.activatedBottomColor, true);


        shadowColor = new Color(35, 35, 35, 105);

        defaultStroke = new BasicStroke(1.0f);
View Full Code Here

  protected void paintBackground(Graphics g) {
    Color main = FlamingoUtilities.getColor(Color.gray,
        "Label.disabledForeground").brighter();
    Graphics2D g2d = (Graphics2D) g.create();
    g2d.setPaint(new GradientPaint(0, 0, FlamingoUtilities.getLighterColor(
        main, 0.9), 0, this.richTooltipPanel.getHeight(),
        FlamingoUtilities.getLighterColor(main, 0.4)));
    g2d.fillRect(0, 0, this.richTooltipPanel.getWidth(),
        this.richTooltipPanel.getHeight());
    g2d.setFont(FlamingoUtilities.getFont(this.richTooltipPanel,
View Full Code Here

    **/
    public void draw(Graphics2D g2, Point p)
    {
        int x = p.x - 25;
        int y = p.y - 25;
        GradientPaint gradient = new GradientPaint(
            x, y, Color.BLUE, x + 50, y, Color.WHITE);
        g2.setPaint(gradient);
        g2.fill(new Rectangle2D.Double(x, y, 50, 50));
        BasicStroke wideStroke = new BasicStroke(2.0f);
        g2.setColor(Color.black);
View Full Code Here

        **/
        public void draw(Graphics2D g2, Point p)
        {
            int x = p.x - 25;
            int y = p.y - 25;
            GradientPaint gradient = new GradientPaint(
                x, y, Color.RED, x + 50, y, Color.WHITE);
            g2.setPaint(gradient);
            g2.fill(new Ellipse2D.Double(x, y, 50, 50));
            BasicStroke wideStroke = new BasicStroke(2.0f);
            g2.setColor(Color.black);
View Full Code Here

    **/
    public void draw(Graphics2D g2, Point p)
    {
        int x = p.x - 25;
        int y = p.y - 25;
        GradientPaint gradient = new GradientPaint(
            x, y, Color.GREEN, x + 50, y, Color.WHITE);
        g2.setPaint(gradient);
        int[] xcoords = { x + 25, x, x + 50 };
        int[] ycoords = { y, y + 50, y + 50 };
        GeneralPath polygon = new GeneralPath(GeneralPath.WIND_EVEN_ODD, xcoords.length);
View Full Code Here

        **/
        public void draw(Graphics2D g2, Point p)
        {
            int x = p.x - 25;
            int y = p.y - 25;
            GradientPaint gradient = new GradientPaint(
                x, y, Color.GREEN, x + 50, y, Color.WHITE);
            g2.setPaint(gradient);
            int[] xcoords = { x + 25, x, x + 50 };
            int[] ycoords = { y, y + 50, y + 50 };
            GeneralPath polygon = new GeneralPath(GeneralPath.WIND_EVEN_ODD, xcoords.length);
View Full Code Here

            super.paint(g);

            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

            GradientPaint gp = new GradientPaint(180.0f, 280.0f, new Color(255, 255, 255, 255), 250.0f, 380.0f, new Color(255, 255, 0, 0));
            g2.setPaint(gp);
            for(int i = 0; i < 3; i ++ ) {
                g2.drawOval(150, 280, 100, 100);
                g2.fillOval(150, 280, 100, 100);
                g2.translate(120, 20);
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.