Package java.awt

Examples of java.awt.MediaTracker$MediaEntry


     */
    public synchronized void reset() {
        loaded = false;
        started = false;

        tracker = new MediaTracker(comp);
        hexTileset.reset();
    }
View Full Code Here


    /**
     * Ensures that Images is completely loaded
     */
    public static boolean setImage(Image im, JComponent c) {
        boolean b = true;
        MediaTracker mt = new MediaTracker(c);
        mt.addImage(im, 0);
        try {
            mt.waitForID(0);
        } catch (InterruptedException e) {
            System.out.println("Error while image loading."); //$NON-NLS-1$
            b = false;
        }
        if (mt.isErrorID(0)) {
            System.out.println("Could Not load Image."); //$NON-NLS-1$
            b = false;
        }
        return b;
    }
View Full Code Here

     * Ensures that Images is completely loaded
     */

    public static boolean setImage(Image im, Component c) {
        boolean b = true;
        MediaTracker mt = new MediaTracker(c);
        mt.addImage(im, 0);
        try {
            mt.waitForID(0);
        } catch (InterruptedException e) {
            System.out.println("Error while image loading."); //$NON-NLS-1$
            b = false;
        }
        if (mt.isErrorID(0)) {
            System.out.println("Could Not load Image."); //$NON-NLS-1$
            b = false;
        }

        return b;
View Full Code Here

    /**
     * Creates new TilesetManager
     */
    public TilesetManager(Component comp) throws IOException {
        this.comp = comp;
        tracker = new MediaTracker(comp);
        try {
            camos = new DirectoryItems(new File("data/images/camo"), "", //$NON-NLS-1$ //$NON-NLS-2$
                    ImageFileFactory.getInstance());
        } catch (Exception e) {
            camos = null;
View Full Code Here

    public Image loadPreviewImage(Entity entity, Image camo, int tint, Component bp) {
        Image base = mechTileset.imageFor(entity, comp);
        EntityImage entityImage = new EntityImage(base, tint, camo, bp);
        Image preview = entityImage.loadPreviewImage();

        MediaTracker loadTracker = new MediaTracker(comp);
        loadTracker.addImage(preview, 0);
        try {
            loadTracker.waitForID(0);
        } catch (InterruptedException e) {
            // should never come here

        }
       
View Full Code Here

     */
    public synchronized void reset() {
        loaded = false;
        started = false;

        tracker = new MediaTracker(comp);
        hexTileset.reset();
    }
View Full Code Here

      return "no display";
    Object obj = fileManager.getFileAsImage(pathName, htParams);
    if (obj instanceof String)
      return obj;
    Image image = (Image) obj;
    MediaTracker tracker = new MediaTracker(display);
    tracker.addImage(image, 0);
    try {
      tracker.waitForID(0);
    } catch (InterruptedException e) {
      // Got to do something?
    }
    return image;
  }
View Full Code Here

      }
    } else {
      image = Toolkit.getDefaultToolkit().createImage(fullPathName);
    }
    try {
      MediaTracker mediaTracker = new MediaTracker(viewer.getDisplay());
      mediaTracker.addImage(image, 0);
      mediaTracker.waitForID(0);
      /* SUN but here for malformed URL - can't trap
       Uncaught error fetching image:
       java.lang.NullPointerException
       at sun.net.www.ParseUtil.toURI(Unknown Source)
       at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
View Full Code Here

  }

  public JBGPanel(String imagefile) {
    super();
    if (imagefile != null) { 
      MediaTracker mt = new MediaTracker(this);
      img = Toolkit.getDefaultToolkit().getImage(imagefile);
      mt.addImage(img, 0);
      try {
        mt.waitForAll();
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
    }
    rahmen.setHgap(40);
View Full Code Here

       
        // for our purposes, the images will almost always be loaded in full
        // by the time this method is called.  But it doesn't hurt to make
        // certain that they are ready to go.
        JLabel bogusImageObserver = new JLabel();
        MediaTracker t = new MediaTracker(bogusImageObserver);
        int id = 0;
        for (Image i : images)
            t.addImage(i, id++);
        try {
            t.waitForAll();
        } catch (InterruptedException e) {}

        // keep track of the "too big" image closest to the preferred size
        Image bigResult = null;
        int bigDelta = 1000;
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.