Package java.awt

Examples of java.awt.Graphics.dispose()


    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


      }

      final Graphics graphics = g.create();
      graphics.setColor(Color.getHSBColor(floats[0], floats[1], floats[2]));
      graphics.drawOval((int) ((lastPointX * getWidth()) - 2), (int) ((lastPointY * getHeight()) - 2), 4, 4);
      graphics.dispose();
    }
  }

  private float[] computeSelectedPosition()
  {
View Full Code Here

      floats[1] = 0;

      final Graphics graphics = g.create();
      graphics.setColor(Color.getHSBColor(floats[0], floats[1], floats[2]));
      graphics.drawOval(color.x - 2, color.y - 2, 4, 4);
      graphics.dispose();
    }
  }

  private Point computeSelectedPosition()
  {
View Full Code Here

  {
    final BufferedImage bimage = new BufferedImage(image.getWidth(null), image.getHeight(null),
        BufferedImage.TYPE_INT_RGB);
    final Graphics g = bimage.createGraphics();
    g.drawImage(image, 0, 0, Color.WHITE, null);
    g.dispose();


    //// This is what we try to do via reflection. Yes, reflection is ugly, but it guarantees that
    //// we dont run into strange errors just because a non-Sun-JDK is used.
    //
View Full Code Here

    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();
  }

  public String getJavaInitializationString()
  {
    return null;
View Full Code Here

    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;
  }

  protected abstract boolean drawImage(final Image img,
                                       final Image mask,
View Full Code Here

    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;
  }

  /**
   * @see Graphics#dispose()
View Full Code Here

    BufferedImage bi = new BufferedImage(viewer.getSize().width,
                       viewer.getSize().height,
                       BufferedImage.TYPE_INT_ARGB);
    Graphics g = bi.createGraphics();
    viewer.paint(g);
    g.dispose();

    try {
      File suggestedFile = generateNonExistingPngFile();
      JFileChooser fileChooser = new JFileChooserConfirmOverwrite();
      fileChooser.setCurrentDirectory(suggestedFile.getParentFile());
View Full Code Here

                gg.setPaint(new GradientPaint(new Point2D.Float(0.0F, 0.0F),
                        new Color(0, true), new Point2D.Float(0.0F, gh),
                        new Color(1610612736, true)));
                gg.fillRect(0, 0, w, gh);
            }
            g.dispose();
        }
        g2.drawImage(img, 0, 0, w * 2, h * 2, null);
    }
}
View Full Code Here

                msg = api.getUpdater().getPercentage() + "%";
                g.drawString(msg, w / 2 - fm.stringWidth(msg) / 2, h - 47);
            }
        }
       
        g.dispose();
        g2.drawImage(img, 0, 0, w * 2, h * 2, null);
    }
   
   
    public void start()
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.