Package java.awt

Examples of java.awt.Graphics2D.fillRect()


    }

    public void showColor(Color color) {
        Graphics2D g = createGraphics();
        g.setColor(color);
        g.fillRect(0, 0, canvas.getWidth(), canvas.getHeight());
        releaseGraphics(g);
    }
    public void showColor(CvScalar color) {
        showColor(new Color((int)color.red(), (int)color.green(), (int)color.blue()));
    }
View Full Code Here


        "Label.disabledForeground").brighter();
    Graphics2D g2d = (Graphics2D) g.create();
    g2d.setPaint(new GradientPaint(0, 0, FlamingoUtilities.getLighterColor(
        main, 0.9), 0, this.richTooltipPanel.getHeight(),
        FlamingoUtilities.getLighterColor(main, 0.4)));
    g2d.fillRect(0, 0, this.richTooltipPanel.getWidth(),
        this.richTooltipPanel.getHeight());
    g2d.setFont(FlamingoUtilities.getFont(this.richTooltipPanel,
        "Ribbon.font", "Button.font", "Panel.font"));
    g2d.dispose();
  }
View Full Code Here

    private static void createCheckerPaint() {
        int k = 4;
        BufferedImage bi = new BufferedImage(2 * k, 2 * k, BufferedImage.TYPE_INT_RGB);
        Graphics2D g = bi.createGraphics();
        g.setColor(Color.white);
        g.fillRect(0, 0, 2 * k, 2 * k);
        g.setColor(Color.lightGray);
        g.fillRect(0, 0, k, k);
        g.fillRect(k, k, k, k);
        checkerPaint = new TexturePaint(bi, new Rectangle(0, 0, bi.getWidth(), bi.getHeight()));
    }
View Full Code Here

        BufferedImage bi = new BufferedImage(2 * k, 2 * k, BufferedImage.TYPE_INT_RGB);
        Graphics2D g = bi.createGraphics();
        g.setColor(Color.white);
        g.fillRect(0, 0, 2 * k, 2 * k);
        g.setColor(Color.lightGray);
        g.fillRect(0, 0, k, k);
        g.fillRect(k, k, k, k);
        checkerPaint = new TexturePaint(bi, new Rectangle(0, 0, bi.getWidth(), bi.getHeight()));
    }

    /** The "frame" includes the trackRect and possible some extra padding.
View Full Code Here

        Graphics2D g = bi.createGraphics();
        g.setColor(Color.white);
        g.fillRect(0, 0, 2 * k, 2 * k);
        g.setColor(Color.lightGray);
        g.fillRect(0, 0, k, k);
        g.fillRect(k, k, k, k);
        checkerPaint = new TexturePaint(bi, new Rectangle(0, 0, bi.getWidth(), bi.getHeight()));
    }

    /** The "frame" includes the trackRect and possible some extra padding.
     * For example, the frame might be the rounded rectangle enclosing the
View Full Code Here

  @Override
  protected void paintComponent(Graphics g) {
    Graphics2D gg = (Graphics2D)g;
    gg.setColor(Color.LIGHT_GRAY);
    gg.fillRect(0, 0, getWidth(), getHeight());

    if (background != null) {
      TexturePaint paint = new TexturePaint(background, new Rectangle(0, 0, background.getWidth(), background.getHeight()));
      gg.setPaint(paint);
      gg.fillRect(0, 0, getWidth(), getHeight());
View Full Code Here

    gg.fillRect(0, 0, getWidth(), getHeight());

    if (background != null) {
      TexturePaint paint = new TexturePaint(background, new Rectangle(0, 0, background.getWidth(), background.getHeight()));
      gg.setPaint(paint);
      gg.fillRect(0, 0, getWidth(), getHeight());
      gg.setPaint(null);
    }

    if (image != null && !useRegion) {
      float panelRatio = (float)getWidth() / (float)getHeight();
View Full Code Here

    if (!title.equals("")) {
      int[] xs = {0, titleW, titleW + titleHeight, 0};
      int[] ys = {0, 0, titleHeight, titleHeight};
      gg.fillPolygon(xs, ys, 4);
      gg.fillRect(0, titleHeight, width, height);
      gg.setColor(c.getForeground());
      gg.drawString(title, 10, titleHeight - titleDescent);
    } else {
      gg.fillRect(0, 0, width, height);
    }
View Full Code Here

      gg.fillPolygon(xs, ys, 4);
      gg.fillRect(0, titleHeight, width, height);
      gg.setColor(c.getForeground());
      gg.drawString(title, 10, titleHeight - titleDescent);
    } else {
      gg.fillRect(0, 0, width, height);
    }
   
    gg.dispose();
  }
View Full Code Here

    protected void paintComponent(Graphics g) {
      Graphics2D gg = (Graphics2D) g;

      if (bgPaint != null) {
        gg.setPaint(bgPaint);
        gg.fillRect(0, 0, getWidth(), getHeight());
        gg.setPaint(null);
      }

      vialSprite.draw(gg);
    }
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.