Package java.awt

Examples of java.awt.MediaTracker$MediaEntry


  }
 
  public Image loadImage(Image img)
  {
    MediaTracker mc = new MediaTracker(this);
    mc.addImage(img,0);

    try
    {
     mc.waitForID(0);
    } catch (InterruptedException ex)
    {
    }
    return img;
  }
View Full Code Here


    {
        Image img=null;
        if (new File(fileName).exists())
        {
            img=Toolkit.getDefaultToolkit().getImage(fileName);
            MediaTracker mc = new MediaTracker(this);
            mc.addImage(img,0);
           
            try
            {
                mc.waitForID(0);
            }
            catch (InterruptedException ex)
            {
                System.out.println(ex);
            }
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

    } else {
      Image img = getImage();
      if (img != null) {
        scaledImage = img.getScaledInstance((int) (getWidth() * zoom), (int) (getHeight() * zoom), Image.SCALE_SMOOTH);

        MediaTracker mediaTracker = new MediaTracker(new Canvas());
        mediaTracker.addImage(scaledImage, 0);
        try {
          mediaTracker.waitForID(0);
        } catch (InterruptedException ie) {
          System.err.println(ie);
        }
        mediaTracker.removeImage(scaledImage);
        myZoom = zoom;
        return scaledImage;
      }
    }

View Full Code Here

   
  }
 
  public void loadLogo() {
    String name = "logo.jpg";
    MediaTracker tracker = new MediaTracker(this);
    URL url = this.getClass().getResource(name);
    if (url == null) return;
    logo = Toolkit.getDefaultToolkit().getImage(url);
    if (logo == null) return;
    tracker.addImage(logo, System.identityHashCode(logo));
    try {
      tracker.waitForAll();
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
  }
View Full Code Here

      setPreferredSize(size);
      setMinimumSize(size);
    }

    private void loadImage() {
      MediaTracker mediaTracker = new MediaTracker(this);
      mediaTracker.addImage(image, 0);
      try {
        mediaTracker.waitForID(0);
      }
      catch (InterruptedException e) {
        logger.warn("Interrupted while waiting for splash image to load.", e);
      }
    }
View Full Code Here

        blue2.setInteractor(defaultInteractor);
        blue2.setToolTipText("Blue figure 2");

        // Create an image figure and make it draggable
        Image img = Toolkit.getDefaultToolkit().getImage(IMAGE_FILE_NAME);
        MediaTracker tracker = new MediaTracker(canvas);
        tracker.addImage(img, 0);

        try {
            tracker.waitForID(0);
        } catch (InterruptedException e) {
            System.err.println(e + "... in FigureTutorial");
        }

        ImageFigure imgFig = new ImageFigure(img);
View Full Code Here

   *
   * @param textArea The text area using this image as its background.
   */
  public ImageBackgroundPainterStrategy(RTextAreaBase textArea) {
    this.textArea = textArea;
    tracker = new MediaTracker(textArea);
    scalingHint = Image.SCALE_FAST;
  }
View Full Code Here

   private static final long serialVersionUID = 1L;
  private Image  image;

  public LogoCanvas()
  {
    MediaTracker media = new MediaTracker(this);
   
    java.io.File myPic = new java.io.File("src/org/boco/seamwebappgen/gui/SeamWebAppGen_64x64.gif");

//    System.out.println("File exists: " + myPic.exists());
//    System.out.println(System.getProperty("user.dir"));
   
    if (myPic.exists())
    {
      image = Toolkit.getDefaultToolkit().getImage("src/org/boco/seamwebappgen/gui/SeamWebAppGen_64x64.gif");
     
    }
    else
    {
      image = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource("/org/boco/seamwebappgen/gui/SeamWebAppGen_64x64.gif"));
    }
       
    media.addImage(image, 0);
   
    try
    {
      media.waitForID(0);
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
View Full Code Here

        editor1 = new WarpGridEditor();
        editor2 = new WarpGridEditor();
        editor3 = new WarpGridEditor();
        sourceImage = getToolkit().getImage(imageName1);
        destImage = getToolkit().getImage(imageName2);
        MediaTracker tracker = new MediaTracker(this);
        tracker.addImage(sourceImage, 0);
        tracker.addImage(destImage, 0);
        try {
            tracker.waitForID(0);
        } catch (InterruptedException ex) {}
        warpGrid1 = new WarpGrid(rows, cols, sourceImage.getWidth(this), sourceImage.getHeight(this));
        warpGrid2 = new WarpGrid(rows, cols, destImage.getWidth(this), destImage.getHeight(this));
        warpGrid3 = new WarpGrid(rows, cols, sourceImage.getWidth(this), sourceImage.getHeight(this));
View Full Code Here

TOP

Related Classes of java.awt.MediaTracker$MediaEntry

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.