Package java.awt

Examples of java.awt.Graphics2D.drawRect()


                    LineBorder lineBorder = (LineBorder) textFieldBorder;
                    g.setColor(lineBorder.getLineColor());
                } else {
                    g.setColor(UIUtil.getBorderColor());
                }
                g.drawRect(1, 1, width - 3, height - 3);
                g.setColor(UIUtil.getPanelBackground());
                g.drawRect(0, 0, width-1, height-1);
            }
            g.translate(-x, -y);
            config.restore();
View Full Code Here


                } else {
                    g.setColor(UIUtil.getBorderColor());
                }
                g.drawRect(1, 1, width - 3, height - 3);
                g.setColor(UIUtil.getPanelBackground());
                g.drawRect(0, 0, width-1, height-1);
            }
            g.translate(-x, -y);
            config.restore();

        }
View Full Code Here

            int h = getHeight();

            g2.clearRect(0, 0, w, h);
           
            g2.setPaint(Color.black);
            g2.drawRect(0, 0, w - 1, h - 1);
           
            for (Vector2D point : points) {
                Vector2D p = transform(point, w, h);
                double[] arr = p.toArray();
                g2.draw(new Rectangle2D.Double(arr[0] - 1, arr[1] - 1, 2, 2));
View Full Code Here

            int h = getHeight();

            g2.clearRect(0, 0, w, h);
           
            g2.setPaint(Color.black);
            g2.drawRect(0, 0, w - 1, h - 1);
           
            int index = 0;
            Color[] colors = new Color[] { Color.red, Color.blue, Color.green.darker() };
            for (Cluster<DoublePoint> cluster : clusters) {
                g2.setPaint(colors[index++]);
View Full Code Here

            if (!transparentPageBackground) {
                graphics.setColor(Color.white);
                graphics.fillRect(0, 0, pageWidth, pageHeight);
            }
            graphics.setColor(Color.black);
            graphics.drawRect(-1, -1, pageWidth + 2, pageHeight + 2);
            graphics.drawLine(pageWidth + 2, 0, pageWidth + 2, pageHeight + 2);
            graphics.drawLine(pageWidth + 3, 1, pageWidth + 3, pageHeight + 3);
            graphics.drawLine(0, pageHeight + 2, pageWidth + 2, pageHeight + 2);
            graphics.drawLine(1, pageHeight + 3, pageWidth + 3, pageHeight + 3);
View Full Code Here

        imageOffset = 0;
      } else if (imageOffset == -1) {
        imageOffset = getIconLabelStart();
      }
      g2d.setColor(getBorderSelectionColor());
      g2d.drawRect(imageOffset, 0, getWidth() - 1 - imageOffset, getHeight() - 1);
    } else if (_selected) {
      g2d.setColor(getBorderSelectionColor());
      g2d.drawRect(imageOffset, 0, getWidth() - 1 - imageOffset, getHeight() - 1);
    }
    // call paintChildren and not paint so we don't
View Full Code Here

      }
      g2d.setColor(getBorderSelectionColor());
      g2d.drawRect(imageOffset, 0, getWidth() - 1 - imageOffset, getHeight() - 1);
    } else if (_selected) {
      g2d.setColor(getBorderSelectionColor());
      g2d.drawRect(imageOffset, 0, getWidth() - 1 - imageOffset, getHeight() - 1);
    }
    // call paintChildren and not paint so we don't
    // erase everyting we've already done.
    //super.paintComponent(g);
    paintChildren(g);
View Full Code Here

    // 设定字体
    g.setFont(mFont);

    // 画边框
    g.setColor(getRandColor(0, 20)); // ---2
    g.drawRect(0, 0, width - 1, height - 1);

    // 随机产生干扰线,使图象中的认证码不易被其它程序探测到
    for (int i = 0; i < count; i++) {
      g.setColor(getRandColor(150, 200)); // ---3
      int x = random.nextInt(width - lineWidth - 1) + 1; // 保证画在边框之内
View Full Code Here

          }
          Graphics2D g = targetImg.createGraphics();
          //draw incoming buffered image to target buffered image
          g.drawImage(srcImg, null, EXIF_SIZE_SIDE, EXIF_SIZE_HEAD);
          //draw decorative white lines
          g.drawRect(EXIF_SIZE_SIDE-1, EXIF_SIZE_HEAD-1, srcImg.getWidth()+1, srcImg.getHeight()+1);
          g.setFont(vo.getParams().getExifFont());
        g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
            RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
          String appendInfo = getPrintableExifInfo(vo);
          if(!StringUtil.isNullOrBlank(appendInfo)){
View Full Code Here

            graphics.setStroke(b_stroke);

            if ((arcwidth != 0) || (archeight != 0)) {
                graphics.drawRoundRect(0, 0, width, height, arcwidth, archeight);
            } else {
                graphics.drawRect(0, 0, width, height);
            }
        }

        if (!fill.equals("transparent")) {
            graphics.setColor(ColorMapper.getColorByName(fill));
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.