Package java.awt

Examples of java.awt.Graphics2D.fillRect()


    BufferedImage img = new BufferedImage(25, 15, BufferedImage.TYPE_INT_RGB);

    Graphics2D g = GraphicsEnvironment.getLocalGraphicsEnvironment().createGraphics(img);

    g.setColor(Color.WHITE);
    g.fillRect(1, 1, 23, 13);
    g.setColor(mColor);
    g.fillRect(1, 1, 23, 13);
    g.setColor(Color.BLACK);
    g.drawRect(0, 0, 24, 14);
   
View Full Code Here


    Graphics2D g = GraphicsEnvironment.getLocalGraphicsEnvironment().createGraphics(img);

    g.setColor(Color.WHITE);
    g.fillRect(1, 1, 23, 13);
    g.setColor(mColor);
    g.fillRect(1, 1, 23, 13);
    g.setColor(Color.BLACK);
    g.drawRect(0, 0, 24, 14);
   
    ImageIcon icon = new ImageIcon(img);
View Full Code Here

    super();
   
    BufferedImage image = new BufferedImage(22, 22, BufferedImage.TYPE_INT_ARGB);
    Graphics2D g2 = image.createGraphics();
    g2.setColor(new Color(255,0,0,0));
    g2.fillRect(0, 0, 22, 22);
   
    g2.setColor(getForeground());
    g2.drawLine(0, 11, 22, 11);
    setIcon(new ImageIcon(image));
  }
View Full Code Here

    // 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

    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

    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);
  }

  /**
   * Creates a scroller. The Text has to be HTML
   * @param text HTML that is displayed in the scroller
View Full Code Here

    BufferedImage im = new BufferedImage(width, height, type);

    Graphics2D g2 = im.createGraphics();
    if (backgroundColor != null) {
      g2.setColor(backgroundColor);
      g2.fillRect(0, 0 , width, height);
    }

    g2.drawImage(image, null, null);
    g2.dispose();
View Full Code Here

    ic = scaleIcon(ic, width, height);

    Graphics2D g = img.createGraphics();

    g.setColor(Color.WHITE);
    g.fillRect(1, 1, 40, 20);

    int x = 1 + 20 - ic.getIconWidth() / 2;
    int y = 1 + 10 - ic.getIconHeight() / 2;

    ic.paintIcon(null, g, x, y);
View Full Code Here

        Color c = Settings.propProgramTableColorOnAirDark.getColor();
        grp.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), (int)(c.getAlpha()*mProgramImportance/10.)));

        int fillWidth = progressX - borderWidth;
        if (fillWidth > 0) {
          grp.fillRect(borderWidth, borderWidth, fillWidth, height - borderWidth);
        }
        c = Settings.propProgramTableColorOnAirLight.getColor();
        grp.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), (int)(c.getAlpha()*mProgramImportance/10.)));

        fillWidth = width - progressX - borderWidth * 2;
 
View Full Code Here

        c = Settings.propProgramTableColorOnAirLight.getColor();
        grp.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), (int)(c.getAlpha()*mProgramImportance/10.)));

        fillWidth = width - progressX - borderWidth * 2;
        if (fillWidth > 0) {
          grp.fillRect(progressX, borderWidth, fillWidth, height - borderWidth);
        }

      } else {
        // vertical filling panel
        int progressY = 0;
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.