Package java.awt

Examples of java.awt.Graphics2D.fillRect()


        int middleY = height / 2;

        g.setBackground(OMColor.clear);
        g.setPaint(OMColor.clear);
        g.fillRect(0, 0, width, height);
        g.setPaint(Color.black);
        g.setStroke(stroke);
        g.drawLine(0, middleY, width, middleY);

        int upTip = (int) ((float) height * .25);
 
View Full Code Here


        BufferedImage bigImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
        Graphics2D g = (Graphics2D) bigImage.getGraphics();

        g.setBackground(OMColor.clear);
        g.setPaint(OMColor.clear);
        g.fillRect(0, 0, width, height);
        g.setPaint(Color.black);
        g.setStroke(stroke);
        if (horizontalOrientation) {
            g.drawLine(0, height / 2, width, height / 2);
        } else {
View Full Code Here

        BufferedImage bigImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
        Graphics2D g = (Graphics2D) bigImage.getGraphics();

        g.setBackground(OMColor.clear);
        g.setPaint(OMColor.clear);
        g.fillRect(0, 0, width, height);
        g.setPaint(Color.black);
        g.setStroke(stroke);
        if (horizontalOrientation) {
            g.drawLine(0, height / 2, width, height / 2);
        } else {
View Full Code Here

      BufferedImage bigImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
      Graphics2D g = (Graphics2D) bigImage.getGraphics();
     
      g.setBackground(OMColor.clear);
      g.setPaint(OMColor.clear);
      g.fillRect(0, 0, width, height);
     
      g.setPaint(background);
      g.fillRect(0, 0, width, height);
      if (matting != null) {
        BasicStroke mattedStroke=new BasicStroke(((BasicStroke) stroke).getLineWidth() + 2f);
View Full Code Here

      g.setBackground(OMColor.clear);
      g.setPaint(OMColor.clear);
      g.fillRect(0, 0, width, height);
     
      g.setPaint(background);
      g.fillRect(0, 0, width, height);
      if (matting != null) {
        BasicStroke mattedStroke=new BasicStroke(((BasicStroke) stroke).getLineWidth() + 2f);
        g.setStroke(mattedStroke);
        g.setPaint(matting);
        g.drawLine(0,height/2,width,height/2);
View Full Code Here

            }

            BufferedImage bi = new BufferedImage(8, 8, BufferedImage.TYPE_INT_ARGB);
            Graphics2D big = bi.createGraphics();
            big.setColor(new Color(0, true)); // clear
            big.fillRect(0, 0, 8, 8);
            big.setPaint(fillPaint);

            if (fillPatternString.equalsIgnoreCase(LPC_HORIZONTAL_PATTERN)) {
                big.draw(new Line2D.Double(0, 0, 7, 0));
                big.draw(new Line2D.Double(0, 4, 7, 4));
View Full Code Here

                big.draw(new Line2D.Double(0, 7, 7, 0));
                big.draw(new Line2D.Double(0, 3, 3, 0));
                big.draw(new Line2D.Double(4, 7, 7, 4));
            } else {
                // default to solid
                big.fillRect(0, 0, 8, 8);
            }

            Rectangle r = new Rectangle(0, 0, 8, 8);
            TexturePaint texturePaint = new TexturePaint(bi, r);
View Full Code Here

     */
    public static ImageIcon getPaletteIcon(Paint paint, int width, int height) {
        BufferedImage bufferedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
        Graphics2D graphics = (Graphics2D) bufferedImage.getGraphics();
        graphics.setPaint(paint);
        graphics.fillRect(0, 0, width, height);

        return new ImageIcon(bufferedImage);
    }

    /**
 
View Full Code Here

        g.setBackground(OMColor.clear);

        if (attributes.enableFillPaintChoice) {
            g.setPaint(attributes.fillPaint);
            g.fillRect(0, 0, width, height);
        }

        if (attributes.matted) {
            BasicStroke mattedStroke = new BasicStroke(((BasicStroke) attributes.stroke).getLineWidth() + 2f);
            g.setStroke(mattedStroke);
View Full Code Here

    protected void paintComponent(Graphics g) {
        Graphics2D g2d = (Graphics2D) g;
        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

        g2d.setColor(this.getBackground());
        g2d.fillRect(0, 0, getWidth(), getHeight());
       
        if (icon != null) {
            int centerX = ((super.getWidth() - icon.getIconWidth()) / 2);
            int centerY = ((super.getHeight() - icon.getIconHeight()) / 2);
            g2d.drawImage(icon.getImage(), centerX, centerY, this);
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.