Package java.awt

Examples of java.awt.Graphics2D.fillRect()


        int w = (int) Math.ceil(bounds.getWidth());
        int h = (int) Math.ceil(bounds.getHeight()) + 2;
        BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB); //for example;
        Graphics2D g = image.createGraphics();
        g.setColor(Color.WHITE);
        g.fillRect(0, 0, w, h);
        g.setColor(Color.BLACK);
        g.setFont(font);
        Object antiAliased = isAntiAliased
                ? RenderingHints.VALUE_TEXT_ANTIALIAS_ON : RenderingHints.VALUE_TEXT_ANTIALIAS_OFF;
        g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, antiAliased);
View Full Code Here


    BufferedImage image = gc.createCompatibleImage(ICON_WIDTH, ICON_WIDTH, Transparency.OPAQUE);
   
    // Active, not selected
    Graphics2D g = image.createGraphics();
    g.setColor(style.getForeground());
    g.fillRect(0, 0, ICON_WIDTH, ICON_WIDTH);
    g.setClip(0, 0, ICON_WIDTH, ICON_WIDTH);
    border.paintBorder(null, g, 0, 0, ICON_WIDTH, ICON_WIDTH);
    g.dispose();
    defaultIcon = new ImageIcon(image);
   
View Full Code Here

   
    // Inactive, not selected
    image2 = gc.createCompatibleImage(ICON_WIDTH, ICON_WIDTH, Transparency.OPAQUE);
    g = image2.createGraphics();
    g.setColor(style.getShadowColor());
    g.fillRect(0, 0, ICON_WIDTH, ICON_WIDTH);
    g.setClip(0, 0, ICON_WIDTH, ICON_WIDTH);
    border.paintBorder(null, g, 0, 0, ICON_WIDTH, ICON_WIDTH);
    g.dispose();
    disabledIcon = new ImageIcon(image2);
   
View Full Code Here

   
    Graphics2D g = image.createGraphics();
    template.draw(g, 0, 0);
    g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f));
    g.setColor(color);
    g.fillRect(0, 0, width, height);
    g.dispose();
   
    return image;
  }
 
View Full Code Here

    if (style != null) {
      style.getBackground().draw(g, 0, 0);
      g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f));
    }
    g.setColor(Color.WHITE);
    g.fillRect(0, 0, TITLEBAR_HEIGHT, TITLEBAR_HEIGHT);
    g.dispose();
   
    return image;
  }
 
View Full Code Here

        }

        //Draw brackground if any:
        if (background != null) {
            g.setColor(background);
            g.fillRect(0, 0, startPixel, height);
            g.fillRect(endPixel + 1, 0, width - endPixel - 1, height);
        }

        //Draw time interval fill:
        g.setColor(fill);
View Full Code Here

        //Draw brackground if any:
        if (background != null) {
            g.setColor(background);
            g.fillRect(0, 0, startPixel, height);
            g.fillRect(endPixel + 1, 0, width - endPixel - 1, height);
        }

        //Draw time interval fill:
        g.setColor(fill);
        g.fillRect(startPixel + 1, 0, endPixel - startPixel - 2, height);
View Full Code Here

            g.fillRect(endPixel + 1, 0, width - endPixel - 1, height);
        }

        //Draw time interval fill:
        g.setColor(fill);
        g.fillRect(startPixel + 1, 0, endPixel - startPixel - 2, height);

        //Draw borders:
        g.setColor(border);
        g.drawLine(startPixel, 0, startPixel, height);
        g.drawLine(endPixel - 1, 0, endPixel - 1, height);
View Full Code Here

                if (rect == null)
                    rect = new Rectangle(0, 0, dim.width, dim.height);
                if (!bPrint)
                {
                    g2d.setColor(Main.m_settings.getImgViewBackColor());
                    g2d.fillRect((int)rect.getX(), (int)rect.getY(), (int)rect.getWidth(), (int)rect.getHeight());
                }
                g2d.drawImage(m_img, rect.x, rect.y, rect.x + rect.width, rect.y + rect.height, rect.x, rect.y, rect.x + rect.width, rect.y + rect.height, this);
                return true;
            }
            else
View Full Code Here

        //and let the client scale it down.
        BufferedImage retval =
            new BufferedImage( width*scaling, height*scaling, BufferedImage.TYPE_BYTE_INDEXED );
        Graphics2D graphics = (Graphics2D)retval.getGraphics();
        graphics.setColor( Color.WHITE );
        graphics.fillRect(0,0,width*scaling, height*scaling);
        graphics.scale( scaling, scaling );
        PageDrawer drawer = new PageDrawer();
        drawer.drawPage( graphics, this, pageDimension );
       
       
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.