Package java.awt

Examples of java.awt.MediaTracker.waitForID()


             */
        }
       
        final int handle = image.hashCode();
        mediaTracker.addImage(image, handle);
        try {mediaTracker.waitForID(handle);} catch (final InterruptedException e) {}
       
        return image;
    }

}
View Full Code Here


      Image i2 = orig.getScaledInstance(destWidth, destHeight, Image.SCALE_SMOOTH);
      MediaTracker tracker = new MediaTracker(comp);
      tracker.addImage(i2, 0);
      try {
        tracker.waitForID(0);
      } catch (InterruptedException e) {
        e.printStackTrace();
      }

      // Log.log("ServletExtension: i2 size : "+i2.getWidth(comp)+"x"+i2.getHeight(comp));
View Full Code Here

        if(urls[i] != null) {
          images[i] = frame.getToolkit().getImage(urls[i]);
          tracker.addImage(images[i], 0);
        }
      }
      tracker.waitForID(0);

      if (null!=images[0]) frame.setIconImage(images[0]);
      // Set the dock icon.
      if(null!=images[1] && bMacOS) {
        try {
View Full Code Here

      URL url = getClass().getResource(strURL);

      if(url != null) {
        Image image = frame.getToolkit().getImage(url);
        tracker.addImage(image, 0);
        tracker.waitForID(0);

        frame.setIconImage(image);
      } else {
      }
    } catch (Exception e) {
View Full Code Here

        // the image arrives.
        // MediaTracker notifies of progress via our
        // Component.ImageObsever interface
        tracker = new MediaTracker(this);
        tracker.addImage(image, 0);
        tracker.waitForID(0);
      } catch (final InterruptedException e) {
        //load completed
      }
      setPreferredSize(new Dimension(image.getWidth(this), image.getHeight(this)));
    }
View Full Code Here

  private SimpleImage getImage(String pName) throws Exception {
    byte[] imgData = getImagedata(pName);
    Image fileImg = Toolkit.getDefaultToolkit().createImage(imgData);
    MediaTracker tracker = new MediaTracker(frame);
    tracker.addImage(fileImg, 0);
    tracker.waitForID(0);
    int width = fileImg.getWidth(null);
    int height = fileImg.getHeight(null);
    BufferedImage bImg = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
    Graphics g = bImg.getGraphics();
    g.drawImage(fileImg, 0, 0, null);
View Full Code Here

  private SimpleImage getImage(String pName) throws Exception {
    byte[] imgData = getImagedata(pName);
    Image fileImg = Toolkit.getDefaultToolkit().createImage(imgData);
    MediaTracker tracker = new MediaTracker(this);
    tracker.addImage(fileImg, 0);
    tracker.waitForID(0);
    int width = fileImg.getWidth(null);
    int height = fileImg.getHeight(null);
    BufferedImage bImg = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
    Graphics g = bImg.getGraphics();
    g.drawImage(fileImg, 0, 0, null);
View Full Code Here

    if (!file.exists())
      throw new FileNotFoundException(pFilename);
    Image fileImg = Toolkit.getDefaultToolkit().createImage(pFilename);
    MediaTracker tracker = new MediaTracker(owner);
    tracker.addImage(fileImg, 0);
    tracker.waitForID(0);
    int width = fileImg.getWidth(null);
    int height = fileImg.getHeight(null);
    BufferedImage bImg = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
    Graphics g = bImg.getGraphics();
    g.drawImage(fileImg, 0, 0, null);
View Full Code Here

    private void createMainPanel(final JTabbedPane tabbedPane) {
    try {
      final Image i = Toolkit.getDefaultToolkit().getImage(getClass().getClassLoader().getResource("res/LaTeXDrawSmall.png"));//$NON-NLS-1$
      final MediaTracker tracker = new MediaTracker(this);
        tracker.addImage(i,0);
        try { tracker.waitForID(0); }
        catch(final InterruptedException e) { BadaboomCollector.INSTANCE.add(e); }

      final JPanel panel       = new JPanel();
      final JEditorPane editorPane   = new JEditorPane();
      initEditorPane(editorPane);
View Full Code Here

    final Image img     = Toolkit.getDefaultToolkit().getImage(
              getClass().getClassLoader().getResource("res/LaTeXDrawSmall.png"));//$NON-NLS-1$
    final MediaTracker tracker=new MediaTracker(this);
    tracker.addImage(img,0);

    try { tracker.waitForID(0); }
    catch(final InterruptedException e) { BadaboomCollector.INSTANCE.add(e); }

    canvas = new DisplayCanvas(img);

    setLayout(new BorderLayout());
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.