Package java.awt

Examples of java.awt.MediaTracker$TrackingImage


    private static BufferedImage convertToBufferedImage(Image image) throws IOException {
        if (image instanceof BufferedImage) {
            return (BufferedImage)image;
        } else {
            /*not sure how this is used*/
            MediaTracker tracker = new MediaTracker(null);
            tracker.addImage(image, 0);
            try {
                tracker.waitForAll();
            } catch (InterruptedException e) {
                throw new IOException(e.getMessage());
            }
            BufferedImage bufImage = new BufferedImage(
                                                       image.getWidth(null),
View Full Code Here


                if (! saveDir.equals("")) {
                    fileOnly = FileUtils.addFolder(saveDir, fileOnly);
                }

                newImage = Toolkit.getDefaultToolkit().getImage(fileOnly);
                tracker = new MediaTracker(this);
                tracker.addImage(newImage, 0);
                tracker.waitForAll();
                imageHeight = newImage.getHeight(this);
                imageWwidth = newImage.getWidth(this);
                if ((imageHeight <= 0) || (imageWwidth <= 0)) {
                    newImage = Toolkit.getDefaultToolkit().getImage(brokenImageString);
                    tracker = new MediaTracker(this);
                    tracker.addImage(newImage, 0);
                    tracker.waitForAll();
                    imageHeight = newImage.getHeight(this);
                    imageWwidth = newImage.getWidth(this);
                    logger.error("loadImage() BROKEN IMAGE - failed to load: " + fileOnly);
                    isBroken = true;
                }
                else {
                    isBroken = false;
                }

                if (! isBroken) {
                    logger.debug("loadImage() ...finished loading image from URL.");
                }
            }
            catch (InterruptedException ie) {
                logger.error("loadImage() FAILED TO LOAD IMAGE - Image problem", ie);
                isBroken = true;
            }
        // image from file
        }
        else {
            try {
                newImage = Toolkit.getDefaultToolkit().getImage(imageFileName);
                tracker = new MediaTracker(this);
                tracker.addImage(newImage, 0);
                tracker.waitForAll();
                imageHeight = newImage.getHeight(this);
                imageWwidth = newImage.getWidth(this);
                if ((imageHeight <= 0) || (imageWwidth <= 0)) {
View Full Code Here

     * take within that area.
     */
    public void init() {
  String s;

  tracker = new MediaTracker(this);
  parseHighlight(getParameter("highlight"));
  introTune = getParameter("startsound");
  baseImage = getImage(getDocumentBase(), getParameter("img"));
  Vector areaVec = new Vector();
  int num = 1;
View Full Code Here

        out.write(b);
      }
      in.close();
      byte[] data = out.toByteArray();
      java.awt.Image awtImage = Toolkit.getDefaultToolkit().createImage(data);
      MediaTracker mediaTracker = new MediaTracker(new Frame());
      mediaTracker.addImage(awtImage, 0);
      try
      {
        mediaTracker.waitForID(0);
      }
      catch (InterruptedException ie)
      {
        return null;
      }
View Full Code Here

    Image image = toolkit.getImage(fileName);
    if (frame == null)
    {
      frame = new Frame();
    }
    MediaTracker mt = new MediaTracker(frame);
    mt.addImage(image, 0);
    try
    {
      mt.waitForID(0);
    }
    catch (InterruptedException e)
    {
      return null;
    }
View Full Code Here

        }
    }

    private synchronized void waitForImage(java.awt.Image image) {
        if (mediaTracker == null)
            mediaTracker = new MediaTracker(new PdfGraphics2D.FakeComponent());
        mediaTracker.addImage(image, 0);
        try {
            mediaTracker.waitForID(0);
        }
        catch (InterruptedException e) {
View Full Code Here

    public Icono()
    {
        width = -1;
        height = -1;
        tracker = new MediaTracker(this);
    }
View Full Code Here

    public Icono(URL url)
    {
        width = -1;
        height = -1;
        tracker = new MediaTracker(this);
        imageLocation = url;
        image = Toolkit.getDefaultToolkit().getImage(url);
        loadImage(image);
    }
View Full Code Here

    public Icono(Image image1)
    {
        width = -1;
        height = -1;
        tracker = new MediaTracker(this);
        image = image1;
        loadImage(image);
    }
View Full Code Here

    public Icono(InputStream inputstream)
        throws IOException
    {
        width = -1;
        height = -1;
        tracker = new MediaTracker(this);
        byte abyte0[] = new byte[1024];
        ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
        int i;
        while((i = inputstream.read(abyte0)) > 0)
            bytearrayoutputstream.write(abyte0, 0, i);
View Full Code Here

TOP

Related Classes of java.awt.MediaTracker$TrackingImage

Copyright © 2018 www.massapicom. 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.