Package java.awt

Examples of java.awt.MediaTracker$MediaEntry


    if (Util.isWindows()) {
      iconName = "cloud16x16.gif";
    }
    String strURL = "/data/" + iconName;
    try {
      MediaTracker tracker = new MediaTracker(frame);

      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


    // state.

    this.image = image;

    if (image != null) {
      MediaTracker tracker;
      try {
        // wait until image is fully loaded.
        // and so that paint will be instantaneous, rather than gradual
        // as
        // 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

        else{
            tempImage = Toolkit.getDefaultToolkit().createImage(tempFile.getAbsolutePath());
            myImageFileName = tempFile.getAbsolutePath();
        }
        if (tempImage == null) throw new Exception("Error reading image "+tempFile.getAbsolutePath());
        MediaTracker mt = new MediaTracker(new Panel());
        mt.addImage(tempImage, 1);
        mt.waitForAll();
        setImage(tempImage);
    }
View Full Code Here

        return m_xdImg;
    }

    public void waitForAllPictures()
    {
        MediaTracker mediaTracker = new MediaTracker(this);
        if (m_uImg != null)
            mediaTracker.addImage(m_uImg, 1);
        if (m_dImg != null)
            mediaTracker.addImage(m_dImg, 2);
        if (m_xuImg != null)
            mediaTracker.addImage(m_xuImg, 3);
        if (m_xdImg != null)
            mediaTracker.addImage(m_xdImg, 4);
        try
        {
            mediaTracker.waitForAll();
        }
        catch(InterruptedException ex)
        {}
    }
View Full Code Here

        if (image instanceof BufferedImage) {
            return (BufferedImage)image;
        }
       
        // Wait until the image is completely loaded
        MediaTracker tracker = new MediaTracker(new Component() { });
        tracker.addImage(image, 0);
        try {
            tracker.waitForAll();
        } catch (InterruptedException e) {
            throw new Fault(e);
        }
       
        // Create a BufferedImage so we can write it out later
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

  public SimpleImage loadImage(String pFilename) throws Exception {
    File file = new File(pFilename);
    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 Dimension dim   = LSystem.INSTANCE.getScreenDimension();
    final Rectangle frameBound = getGraphicsConfiguration().getBounds();
    progressBar   = new MProgressBar(0, 100);
    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

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.