Package java.awt

Examples of java.awt.Graphics.fillRect()


  {
    final Graphics graphics = g.create();
    graphics.setColor(current);
    graphics.fillRect(0, 0, getWidth(), getHeight() / 2);
    graphics.setColor(previous);
    graphics.fillRect(0, getHeight() / 2, getWidth(), getHeight() / 2);
    graphics.dispose();
  }
}
View Full Code Here


      return;
    }

    final Graphics graphics = gfx.create();
    graphics.setColor(value);
    graphics.fillRect(box.x, box.y, box.width, box.height);
    graphics.setColor(Color.BLACK);
    graphics.drawRect(box.x, box.y, box.width, box.height);
    graphics.dispose();
  }
View Full Code Here

    tx.scale(scalex, scaley);

    final BufferedImage mask = new BufferedImage(img.getWidth(observer), img.getHeight(observer),
        BufferedImage.TYPE_BYTE_BINARY);
    final Graphics g = mask.getGraphics();
    g.fillRect(sx1, sy1, (int) swidth, (int) sheight);
    drawImage(img, mask, tx, null, observer);
    g.dispose();
    return true;
  }
View Full Code Here

    tx.scale(scalex, scaley);

    final BufferedImage mask = new BufferedImage(img.getWidth(observer), img.getHeight(observer),
        BufferedImage.TYPE_BYTE_BINARY);
    final Graphics g = mask.getGraphics();
    g.fillRect(sx1, sy1, (int) swidth, (int) sheight);
    drawImage(img, mask, tx, null, observer);
    g.dispose();
    return true;
  }
View Full Code Here

                    h / 2 + fm.getHeight() * 2);
           
            if (api.getUpdater().getError() == null)
            {
                g.setColor(Color.black);
                g.fillRect(64, h - 64, w - 128 + 1, 5);
                g.setColor(new Color(32768));
                g.fillRect(64, h - 64, api.getUpdater().getPercentage()
                        * (w - 128) / 100, 4);
                g.setColor(new Color(2138144));
                g.fillRect(65, h - 64 + 1, api.getUpdater().getPercentage()
View Full Code Here

            if (api.getUpdater().getError() == null)
            {
                g.setColor(Color.black);
                g.fillRect(64, h - 64, w - 128 + 1, 5);
                g.setColor(new Color(32768));
                g.fillRect(64, h - 64, api.getUpdater().getPercentage()
                        * (w - 128) / 100, 4);
                g.setColor(new Color(2138144));
                g.fillRect(65, h - 64 + 1, api.getUpdater().getPercentage()
                        * (w - 128) / 100 - 2, 1);
               
View Full Code Here

                g.fillRect(64, h - 64, w - 128 + 1, 5);
                g.setColor(new Color(32768));
                g.fillRect(64, h - 64, api.getUpdater().getPercentage()
                        * (w - 128) / 100, 4);
                g.setColor(new Color(2138144));
                g.fillRect(65, h - 64 + 1, api.getUpdater().getPercentage()
                        * (w - 128) / 100 - 2, 1);
               
                g.setColor(Color.LIGHT_GRAY);
                g.setFont(new Font(null, 0, 12));
                msg = api.getUpdater().getPercentage() + "%";
View Full Code Here

    Font font = new Font(FONT_FAMILY, Font.PLAIN, FONT_SIZE);
    // 绘制图片
    Random random = new Random();
    Graphics g = image.getGraphics();
    g.setColor(getRandColor(200, 250));
    g.fillRect(1, 1, width - 1, height - 1);
    g.setColor(new Color(102, 102, 103));
    g.drawRect(0, 0, width - 1, height - 1);
    g.setFont(font);
    // 随机生成线条,让图片看起来更加杂乱
    g.setColor(getRandColor(160, 200));
View Full Code Here

    Graphics g = image.createGraphics();
    // 生成随机类
    Random random = new Random();
    // 设定背景色
    g.setColor(getRandColor(200, 250));
    g.fillRect(0, 0, WIDTH, HEIGHT);
    // 设定字体
    g.setFont(new Font("Times New Roman", Font.PLAIN, 18));

    // 随机产生155条干扰线,使图象中的认证码不易被其它程序探测到
    g.setColor(getRandColor(160, 200));
View Full Code Here

        g.setFont(g.getFont().deriveFont((float) TEXT_SIZE));
        for (VrpCustomer customer : schedule.getCustomerList()) {
            VrpLocation location = customer.getLocation();
            int x = translator.translateLongitudeToX(location.getLongitude());
            int y = translator.translateLatitudeToY(location.getLatitude());
            g.fillRect(x - 1, y - 1, 3, 3);
            g.drawString(Integer.toString(customer.getDemand()), x + 3, y - 3);
        }
        g.setColor(TangoColors.ALUMINIUM_4);
        for (VrpDepot depot : schedule.getDepotList()) {
            int x = translator.translateLongitudeToX(depot.getLocation().getLongitude());
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.