Package java.awt

Examples of java.awt.Graphics.fillRect()


      private BufferedImage createImage(ImageRequest request, String text) {
          BufferedImage image = new BufferedImage(request.getWidth(), request.getHeight(), BufferedImage.TYPE_BYTE_INDEXED);
          Graphics graphics = image.createGraphics();
          graphics.setColor(Color.YELLOW);
          graphics.fillRect(0,0,image.getWidth(),image.getHeight());
          Font serif = new Font("serif", Font.PLAIN, 30);
          graphics.setFont(serif);
          graphics.setColor(Color.BLUE);
          graphics.drawString(text, 10, 50);
          return image;
View Full Code Here


    public synchronized void process(float[] pLeft, float[] pRight, float pFrameRateRatioHint)
    {
        if (displayMode == DISPLAY_MODE_OFF) return;
        Graphics wGrp = getDoubleBuffer().getGraphics();
        wGrp.setColor(getBackground());
        wGrp.fillRect(0, 0, getSize().width, getSize().height);
        switch (displayMode)
        {
            case DISPLAY_MODE_SCOPE:
                drawScope(wGrp, stereoMerge(pLeft, pRight));
                break;
View Full Code Here

    //Draw cell bodies
    for (int r=0;r<rows;r++){
     for(int c=0;c<cols;c++){
       myGraphics.setColor(displayColors[control.getDataFromRC(r,c)]);
       myGraphics.fillRect((int)(c*columnWidth+1),(int)(r*rowHeight+1),(int)(columnWidth),(int)(rowHeight));
     }
    }
    // Draw minor gridlines
    myGraphics.setColor(Color.gray);
    for (int r=0;r<rows;r++){
View Full Code Here

        // Fill in the image with the surrounding color
        Graphics g = paintContext.getPaintGraphics();
        Color oldColor = g.getColor();
        g.setColor(paintContext.getSurroundingColor());
        g.fillRect(0, 0, width, height);
        g.setColor(oldColor);

        // Paint the image
        painter.paint(paintContext, g, 0, 0, width, height);
View Full Code Here

    // our wrapped painter
    Graphics offscreenG = _getInitializedGraphics(context, buffer);

    // Fill in the background - including the extra 1 pixel at the top
    offscreenG.setColor(context.getPaintBackground());
    offscreenG.fillRect(0, 0, width, height + 1);

    // Reset for text rendering
    offscreenG.setColor(g.getColor());
    offscreenG.translate(-x, -y);
View Full Code Here

    Color surroundingColor = (Color)requestedProperties.get(
                                      ImageConstants.SURROUNDING_COLOR_KEY);
    if (surroundingColor != null)
    {
      g.setColor(surroundingColor);
      g.fillRect(0, 0, width, height);
    }

    g.drawImage(colorizedIcon, 0, 0, loader);

    // Free up resources used by any images we created
View Full Code Here

    // Get the Graphics object to use to draw into the image
    Graphics g = image.getGraphics();

    // Clear out the image
    g.setColor(Color.white);
    g.fillRect(0, 0, width, height);

    // Render our glyphs
    g.setColor(Color.black);
    g.setFont(new Font("Dialog", Font.PLAIN, 12));
View Full Code Here

    gfx.setColor(fillColor);
    FontMetrics fm = textArea.getPainter().getFontMetrics();
    int newY = y - (fm.getHeight() - CompositionTextManager.COMPOSING_UNDERBAR_HEIGHT);
    int paintHeight = fm.getHeight();
    int paintWidth = (int) composedTextLayout.getBounds().getWidth();
    gfx.fillRect(x, newY, paintWidth, paintHeight);
  }

  private Point getCaretLocation() {
    Point loc = new Point();
    TextAreaPainter painter = textArea.getPainter();
View Full Code Here

     */
    private BufferedImage createImage(ImageRequest request, String text) {
        BufferedImage image = new BufferedImage(request.getWidth(), request.getHeight(), BufferedImage.TYPE_BYTE_INDEXED);
        Graphics graphics = image.createGraphics();
        graphics.setColor(Color.YELLOW);
        graphics.fillRect(0, 0, image.getWidth(), image.getHeight());
        Font serif = new Font("serif", Font.PLAIN, 30);
        graphics.setFont(serif);
        graphics.setColor(Color.BLUE);
        graphics.drawString(text, 10, 50);
        return image;
View Full Code Here

  protected void paintComponent(final Graphics g)
  {
    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

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.